/* tenax português: tenax's orange + blue look. All colors are tokens; dark values below. */
:root {
  --bg: #F4F7FD;
  --surface: #FFFFFF;
  --text: #0B1B3F;
  --muted: #5B6787;
  --line: #E2E8F5;
  --blue: #1F5BFF;
  --blue-soft: #E8EFFF;
  --orange: #FF7A1A;
  --orange-soft: #FFF0E5;
  --green: #12B76A;
  --green-soft: #E3F8EE;
  --red: #E5484D;
  --red-soft: #FDECEC;
  --amber: #F5B400;
  --nav: #0B1B3F;
  --grad: linear-gradient(135deg, #1F5BFF, #3D7BFF 60%, #5A95FF);
  --warm: linear-gradient(135deg, #FF7A1A, #FF9A3D);
  --shadow: 0 6px 24px rgba(11, 27, 63, .08);
  --r: 20px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Sora', var(--font);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A1430;
    --surface: #121F45;
    --text: #EEF2FF;
    --muted: #9AA7C7;
    --line: #22325F;
    --blue: #4D7DFF;
    --blue-soft: #1A2B5E;
    --orange-soft: #3A2412;
    --green-soft: #0E3326;
    --red-soft: #3A1518;
    --nav: #050B1F;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0; }
a { color: var(--blue); text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

#app { max-width: 640px; margin: 0 auto; }
.view { padding: 16px 16px calc(112px + env(safe-area-inset-bottom)); }
body.full .view { padding-bottom: 32px; }

.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: 13px; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.de { color: var(--muted); }

/* ---------- logo ---------- */
.logo { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.5px; }
.logo b { color: var(--orange); }
.logo small { font-family: var(--font); font-weight: 600; font-size: 13px; opacity: .8; margin-left: 6px; }
.logo.big { font-size: 44px; color: var(--blue); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
  font-weight: 700; text-align: center;
  transition: transform .1s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--warm); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(255, 122, 26, .3); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: var(--red); }
.btn.wide { width: 100%; }
a.btn.wide { margin-top: 8px; }
.spk, .star {
  border: 0; background: transparent; padding: 4px 6px; margin-left: 4px;
  font-size: 18px; line-height: 1; border-radius: 10px; flex: none;
}
.spk:hover, .star:hover { background: var(--blue-soft); }
.star { color: var(--muted); font-size: 22px; }
.star.on { color: var(--amber); }

/* ---------- cards ---------- */
.card {
  display: block; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 16px; margin: 12px 0;
}
a.card { transition: transform .12s; }
a.card:active { transform: scale(.98); }
.card p { margin: 6px 0; }
.emoji { font-size: 34px; line-height: 1; flex: none; }
.emoji.big { font-size: 52px; }
.go { font-size: 28px; color: var(--muted); flex: none; }
.label { font-weight: 700; color: var(--muted); }

/* ---------- home ---------- */
.hero {
  background: var(--grad); color: #fff; border-radius: 24px;
  padding: 18px 18px 16px; box-shadow: 0 10px 30px rgba(31, 91, 255, .3);
}
.hero-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.icon-btn { font-size: 20px; padding: 6px 8px; border-radius: 12px; background: rgba(255, 255, 255, .16); }
.hero h1 { font-size: 26px; }
.hero .sub { margin: 4px 0 14px; font-weight: 600; }
.hero .sub span { opacity: .75; font-weight: 400; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: rgba(255, 255, 255, .16); border-radius: 14px; padding: 10px 8px; text-align: center; display: flex; flex-direction: column; }
.stats b { font-size: 18px; }
.stats span { font-size: 12px; opacity: .85; }

.continue, .row-card, .unit-card { display: flex; align-items: center; gap: 14px; }
.continue { border: 2px solid var(--orange); }
.continue small, .unit-card small { color: var(--orange); font-weight: 700; }
.continue b, .unit-card b, .row-card b { font-family: var(--display); font-size: 18px; }
.row-card.hot { border: 2px solid var(--blue); }
.steps { display: flex; gap: 5px; margin-top: 8px; }
.steps i { width: 26px; height: 6px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--green); }

.wod .wod-row, .end-box .wod-row { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.wod-word { font-family: var(--display); font-size: 30px; color: var(--blue); }
.mean { color: var(--text); }
.mean.big { font-size: 20px; font-weight: 600; }

h2.section { font-size: 18px; margin: 22px 4px 4px; }

/* ---------- games grid ---------- */
.games { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.game {
  display: flex; flex-direction: column; gap: 2px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); color: var(--text);
}
.game b { font-family: var(--display); font-size: 17px; }
.game .muted { font-size: 13px; line-height: 1.35; }
.g-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; margin-bottom: 6px; background: var(--blue-soft); }
.g-pares .g-icon, .g-ouvir .g-icon { background: var(--orange-soft); }
.g-forca .g-icon, .g-falar .g-icon { background: var(--green-soft); }

/* ---------- pages ---------- */
.page-head { margin: 8px 4px 4px; }
.page-head h1 { font-size: 28px; }
.page-head h1 span { font-family: var(--font); font-size: 16px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.page-head p { margin: 6px 0 0; }
.back { display: inline-block; font-weight: 700; padding: 6px 2px; }
.chip { flex: none; font-weight: 700; font-size: 14px; padding: 4px 10px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); }
.unit-card.done .chip { background: var(--green-soft); color: var(--green); }
.unit-card.cur { border: 2px solid var(--orange); }
.unit-card em { font-style: normal; }

/* ---------- unit page ---------- */
.unit-head { display: flex; gap: 14px; align-items: center; margin: 6px 4px 0; }
.unit-head small { color: var(--orange); font-weight: 700; }
.unit-head h1 { font-size: 28px; }
.goal { background: var(--blue-soft); border-radius: 14px; padding: 10px 14px; font-weight: 600; margin: 14px 0 0; }
.step h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.step h2 .muted { font-family: var(--font); font-size: 15px; font-weight: 600; }
.num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-size: 15px; flex: none; }
.num.on { background: var(--green); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.actions.top { justify-content: space-between; margin: 0 0 10px; }
.done-tag { color: var(--green); font-weight: 700; padding: 10px 4px; }

.words { list-style: none; padding: 0; margin: 0; }
.words li { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.words li:last-child { border-bottom: 0; }
.words .pt { font-weight: 700; font-size: 17px; }
.words .mean { flex: 1 1 100%; order: 3; color: var(--muted); font-size: 14px; }
.words .star { margin-left: auto; }
@media (min-width: 520px) {
  .words .mean { flex: 1; order: 0; padding-left: 8px; }
}

.rule { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.rule:first-of-type { border-top: 0; padding-top: 0; }
.rule h3 { font-size: 17px; color: var(--blue); }
.conj { border-collapse: collapse; margin: 8px 0; }
.conj td { padding: 4px 14px 4px 0; }
.conj td:first-child { color: var(--muted); }
.ex { list-style: none; padding: 0; margin: 6px 0; }
.ex li { background: var(--bg); border-radius: 12px; padding: 8px 12px; margin: 6px 0; }
.ex .pt { font-weight: 700; }
.ex .tr { display: block; color: var(--muted); font-size: 14px; }
.tip-de { background: var(--orange-soft); border-radius: 14px; padding: 12px 14px; margin-top: 12px; }
.tip-de p { margin: 4px 0 0; }

.dialogue { display: flex; flex-direction: column; gap: 10px; }
.line { max-width: 88%; }
.line.r { align-self: flex-end; text-align: right; }
.line small { color: var(--muted); font-weight: 700; padding: 0 8px; }
.bubble { background: var(--blue-soft); border-radius: 18px 18px 18px 6px; padding: 10px 14px; text-align: left; }
.line.r .bubble { background: var(--orange-soft); border-radius: 18px 18px 6px 18px; }
.bubble p { margin: 0; }
.bubble .pt { font-weight: 600; }
.bubble .tr { color: var(--muted); font-size: 14px; margin-top: 2px; }
.hide-tr .tr { display: none; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }

/* ---------- quiz ---------- */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.topbar .x { font-size: 20px; color: var(--muted); padding: 6px 10px; border-radius: 12px; }
.topbar .bar { flex: 1; height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; }
.topbar .bar i { display: block; height: 100%; background: var(--warm); border-radius: 6px; transition: width .3s; }
.topbar .count { font-weight: 700; color: var(--muted); font-size: 14px; }
.topbar .g-title { flex: 1; text-align: center; font-family: var(--display); font-size: 18px; }
.topbar > span:last-child:empty { width: 40px; }

.q-kind { color: var(--muted); font-weight: 700; font-size: 14px; margin: 0 0 6px; }
.q-text { font-family: var(--display); font-size: 24px; margin: 4px 0; }
.q-text.sm { font-size: 19px; }
.q-tr { color: var(--muted); margin: 4px 0 16px; }
.blank { display: inline-block; min-width: 70px; padding: 0 10px; border-bottom: 3px dashed var(--orange); color: var(--orange); text-align: center; }
.blank.right { color: var(--green); border-color: var(--green); border-bottom-style: solid; }
.blank.wrong { color: var(--red); border-color: var(--red); border-bottom-style: solid; }
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.opts.col { grid-template-columns: 1fr 1fr; }
.opt {
  min-height: 54px; padding: 10px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: 17px; box-shadow: var(--shadow);
}
.opts.col .opt { font-size: 15px; font-weight: 600; }
.opt.right { border-color: var(--green); background: var(--green-soft); }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt:disabled { cursor: default; }

.type-form { display: flex; gap: 8px; margin: 16px 0 10px; }
input:not([type=checkbox]) {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--surface);
  font-size: 17px; outline: none;
}
input:focus { border-color: var(--blue); }
.accents { display: flex; flex-wrap: wrap; gap: 6px; }
.acc { min-width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 17px; }

.slot, .bank { display: flex; flex-wrap: wrap; gap: 8px; min-height: 58px; padding: 10px; border-radius: 16px; }
.slot { border: 2px dashed var(--line); margin: 14px 0 10px; align-items: center; }
.slot.right { border-color: var(--green); background: var(--green-soft); border-style: solid; }
.slot.wrong { border-color: var(--red); background: var(--red-soft); border-style: solid; }
.hint { color: var(--muted); }
.tile { padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 17px; box-shadow: 0 2px 0 var(--line); }
.tile:disabled { opacity: .25; }
.row-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

.big-say { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 16px auto; width: 120px; height: 120px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; font-size: 40px; box-shadow: 0 10px 30px rgba(31, 91, 255, .35); justify-content: center; }
.big-say span { font-size: 12px; font-weight: 700; }

.fb { display: none; }
.fb.show { display: block; margin-top: 18px; padding: 16px; border-radius: 18px; animation: up .25s ease-out; }
.fb.ok { background: var(--green-soft); }
.fb.no { background: var(--red-soft); }
.fb b { font-family: var(--display); font-size: 18px; }
.fb.ok > b { color: var(--green); }
.fb.no > b { color: var(--red); }
.fb p { margin: 6px 0 12px; font-size: 17px; }
.fb .btn { width: 100%; }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }

/* ---------- end screens ---------- */
.end { text-align: center; padding: 30px 8px; }
.big-emoji { font-size: 72px; }
.end h1 { font-size: 30px; margin: 8px 0; }
.score { font-family: var(--display); font-size: 24px; color: var(--blue); margin: 6px 0; }
.end-actions { display: flex; flex-direction: column; gap: 10px; max-width: 320px; margin: 22px auto 0; }
.end-box { text-align: center; padding: 8px 0; }
.end-box .wod-row { justify-content: center; }
.end-box .btn { margin-top: 10px; min-width: 200px; }

/* ---------- my words ---------- */
.review-cta { display: flex; align-items: center; gap: 12px; }
.review-cta.hot { border: 2px solid var(--blue); }
.review-cta b { font-family: var(--display); font-size: 18px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.form label.check { flex-direction: row; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add-word .btn { align-self: flex-start; }
.saved li { flex-wrap: wrap; }
.boxes { display: flex; gap: 3px; margin-left: auto; }
.boxes i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.boxes i.on { background: var(--green); }
.del { border: 0; background: transparent; color: var(--muted); font-size: 22px; padding: 0 6px; }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.flash, .say-card { text-align: center; }
.flash-word { font-family: var(--display); font-size: 38px; color: var(--blue); margin: 16px 0 4px; }
.flash .type-form { max-width: 420px; margin: 16px auto; }
.flash .row-btns .btn { flex: 1; max-width: 220px; }
.reveal { margin: 14px 0; }

/* ---------- Palavra ---------- */
.wd-board { display: grid; gap: 6px; justify-content: center; margin: 10px 0; }
.wd-row { display: grid; grid-template-columns: repeat(5, clamp(44px, 13vw, 58px)); gap: 6px; }
.wd-cell {
  aspect-ratio: 1; display: grid; place-items: center;
  border: 2px solid var(--line); border-radius: 10px; background: var(--surface);
  font-family: var(--display); font-size: 24px; font-weight: 700;
}
.wd-cell.filled { border-color: var(--muted); }
.wd-cell.ok, .key.ok { background: var(--green); border-color: var(--green); color: #fff; }
.wd-cell.near, .key.near { background: var(--amber); border-color: var(--amber); color: #fff; }
.wd-cell.no { background: var(--muted); border-color: var(--muted); color: #fff; }
.key.no { opacity: .35; }
.wd-msg { min-height: 24px; color: var(--red); font-weight: 600; margin: 4px 0; }
.kb { display: flex; flex-direction: column; gap: 6px; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.key {
  flex: 1; max-width: 44px; height: 52px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: 15px; padding: 0;
}
.key.wide { flex: 1.6; max-width: 70px; font-size: 13px; }
.legend { text-align: center; color: var(--muted); font-size: 13px; margin-top: 14px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin: 0 2px 0 8px; }
.legend i.ok { background: var(--green); }
.legend i.near { background: var(--amber); }
.legend i.no { background: var(--muted); }

/* ---------- Pares ---------- */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.match .col { display: flex; flex-direction: column; gap: 10px; }
.m-card {
  min-height: 58px; padding: 8px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: 15px; box-shadow: var(--shadow);
}
.m-card.pt { font-weight: 700; font-size: 17px; color: var(--blue); }
.m-card.sel { border-color: var(--blue); background: var(--blue-soft); }
.m-card.done { border-color: var(--green); background: var(--green-soft); opacity: .6; }
.m-card.wrong { border-color: var(--red); background: var(--red-soft); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ---------- Forca ---------- */
.forca { text-align: center; }
.gallows { width: 130px; height: 130px; }
.gallows line, .gallows circle { stroke: var(--text); stroke-width: 4; stroke-linecap: round; fill: none; }
.gallows .frame line { stroke: var(--muted); }
.gallows.lost .man line, .gallows.lost .man circle { stroke: var(--red); }
.clue { font-weight: 600; margin: 6px 0 14px; }
.fc-word { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 10px 0; min-height: 46px; }
.fc-word span {
  width: 32px; height: 42px; border-bottom: 3px solid var(--blue);
  font-family: var(--display); font-size: 26px; font-weight: 700; display: grid; place-items: end center;
}
.fc-word .gap { width: 16px; }
.fc-keys { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.fc-keys .key { flex: 0 0 auto; width: 40px; height: 46px; }

/* ---------- Falar ---------- */
.mic {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 130px; height: 130px; margin: 18px auto 8px; border-radius: 50%; border: 0;
  background: var(--warm); color: #fff; font-size: 44px; box-shadow: 0 10px 30px rgba(255, 122, 26, .35);
}
.mic span { font-size: 12px; font-weight: 700; }
.mic.on { animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.07); box-shadow: 0 0 0 14px rgba(255, 122, 26, .15); } }
.heard { min-height: 48px; font-size: 17px; }
.notice { text-align: center; }

/* ---------- welcome ---------- */
.welcome { text-align: center; padding-top: 40px; }
.kicker { margin: 0; font-weight: 700; color: var(--orange); letter-spacing: 2px; }
.welcome h1 { font-size: 34px; margin-top: 26px; }
.lead { color: var(--muted); font-size: 17px; max-width: 420px; margin: 10px auto 18px; }
.welcome .form { text-align: left; max-width: 420px; margin: 0 auto; }

/* ---------- menu ---------- */
#nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(440px, calc(100% - 24px));
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  padding: 6px; border-radius: 22px; background: var(--nav);
  box-shadow: 0 10px 30px rgba(11, 27, 63, .35); z-index: 10;
}
#nav a {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 7px 4px; border-radius: 16px; color: #C9D3EE; font-size: 12px; font-weight: 700;
}
#nav a span { font-size: 20px; }
#nav a.on { background: var(--blue); color: #fff; }

#toast {
  position: fixed; left: 50%; top: 16px; transform: translate(-50%, -80px);
  background: var(--nav); color: #fff; font-weight: 700;
  padding: 10px 18px; border-radius: 99px; z-index: 20;
  transition: transform .25s; pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
