/* Interface de 3 metros: tudo grande, alto contraste, foco muito visível. */
:root {
  --bg: #0f1a2e;
  --bg2: #17243d;
  --card: #1f2f4d;
  --line: #2f4268;
  --text: #f4f1ea;
  --muted: #a9b4c8;
  --accent: #ffc94a;
  --ok: #4ade80;
  --bad: #ff6b6b;
  --kid: #ffc94a;
  font-size: clamp(16px, 1.55vw, 44px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", "Samsung One", Roboto, "Helvetica Neue", Arial, sans-serif; }
body { overflow: hidden; }
#app { height: 100%; padding: 4vh 5vw; display: flex; flex-direction: column; } /* margem de overscan */

h1 { font-size: 2.6rem; margin: 0 0 .3em; letter-spacing: -.01em; }
h2 { font-size: 1.6rem; margin: 0 0 .4em; }
p { margin: 0 0 .6em; line-height: 1.4; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.row { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.center { text-align: center; align-items: center; justify-content: center; }
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }

button {
  font: inherit; color: inherit; background: var(--card); border: 3px solid var(--line);
  border-radius: 1rem; padding: .7em 1.4em; font-size: 1.2rem; cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
button.primary { background: var(--kid); color: #1a1a1a; border-color: var(--kid); font-weight: 700; }
button:focus, input:focus { outline: none; border-color: #fff; box-shadow: 0 0 0 .3rem rgba(255,255,255,.35);
  transform: scale(1.06); }
button.primary:focus { box-shadow: 0 0 0 .35rem #fff; }
button.small { font-size: .95rem; padding: .45em .9em; }
button.danger:focus { border-color: var(--bad); box-shadow: 0 0 0 .3rem rgba(255,107,107,.45); }
input[type=text] { font: inherit; font-size: 1.2rem; background: var(--bg); color: var(--text);
  border: 3px solid var(--line); border-radius: .8rem; padding: .4em .7em; width: 11em; }

/* ---- Início ---- */
.kids { display: flex; gap: 3vw; justify-content: center; margin-top: 5vh; }
.kid-card { width: 26vw; min-height: 34vh; display: flex; flex-direction: column; justify-content: center;
  align-items: center; gap: .6rem; border-width: 4px; }
.kid-card .avatar { width: 7rem; height: 7rem; border-radius: 50%; display: grid; place-items: center;
  font-size: 3.4rem; font-weight: 800; color: #1a1a1a; }
.kid-card .name { font-size: 2rem; font-weight: 700; }
.kid-card .status { color: var(--muted); font-size: 1rem; }
.kid-card .done { color: var(--ok); }

/* ---- Painel da criança ---- */
.level-card { background: var(--bg2); border: 3px solid var(--line); border-radius: 1.4rem; padding: 1.6rem 2rem;
  display: flex; gap: 2rem; align-items: center; margin: 2vh 0 3vh; }
.level-code { font-size: 4.4rem; font-weight: 800; color: var(--kid); line-height: 1; min-width: 2.6em; text-align: center; }
.dots { display: flex; gap: .5rem; margin-top: .6rem; }
.dot { width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 3px solid var(--line); }
.dot.on { background: var(--ok); border-color: var(--ok); }
.ladder { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: auto; }
.ladder span { font-size: .8rem; padding: .25em .5em; border-radius: .4rem; background: var(--bg2); color: var(--muted); }
.ladder span.past { background: rgba(74,222,128,.18); color: var(--ok); }
.ladder span.now { background: var(--kid); color: #1a1a1a; font-weight: 700; }

/* ---- Folha ---- */
.sheet { display: grid; grid-template-columns: 1.25fr 1fr; gap: 4vw; flex: 1; min-height: 0; }
.q-area { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3vh; }
.question { font-size: 5rem; font-weight: 700; text-align: center; line-height: 1.15; font-variant-numeric: tabular-nums; }
.question small { font-size: .5em; color: var(--muted); font-weight: 600; }
.answer { min-width: 6em; min-height: 1.4em; font-size: 4rem; font-weight: 700; text-align: center;
  border-bottom: .3rem solid var(--kid); padding: 0 .3em; font-variant-numeric: tabular-nums; }
.answer.ok { color: var(--ok); border-color: var(--ok); }
.answer.bad { color: var(--bad); border-color: var(--bad); animation: shake .35s; }
.feedback { font-size: 1.5rem; min-height: 1.5em; font-weight: 600; }
.feedback.ok { color: var(--ok); } .feedback.bad { color: var(--bad); } .feedback.info { color: var(--accent); }
@keyframes shake { 25% { transform: translateX(-.4rem); } 75% { transform: translateX(.4rem); } }

.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .78em; line-height: 1.05; margin: 0 .1em; }
.fr span:first-child { border-bottom: .08em solid currentColor; padding: 0 .15em; }

.pad-wrap { display: flex; flex-direction: column; justify-content: center; gap: 1.2rem; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.pad button { font-size: 2.2rem; padding: .35em 0; font-weight: 700; border-radius: .9rem; }
.pad button.ok-key { background: var(--ok); border-color: var(--ok); color: #0b2a16; }
.pad .extras { grid-column: 1 / -1; display: flex; gap: .8rem; }
.pad .extras button { flex: 1; }
.hud { display: flex; gap: 2rem; font-size: 1.2rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hud b { color: var(--text); }
.progress { height: .6rem; background: var(--bg2); border-radius: 1rem; overflow: hidden; margin: 1.2vh 0 2vh; }
.progress > i { display: block; height: 100%; background: var(--kid); transition: width .3s; }
.paper { font-size: 1rem; color: var(--accent); }

/* ---- Resultado ---- */
.result { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; gap: 2.2vh; text-align: center; }
.stars { font-size: 5rem; letter-spacing: .3em; color: var(--accent); }
.stats { display: flex; gap: 3vw; }
.stat { background: var(--bg2); border-radius: 1.2rem; padding: 1.2rem 2rem; min-width: 12rem; }
.stat b { display: block; font-size: 2.6rem; }
.stat.good b { color: var(--ok); } .stat.warn b { color: var(--accent); }
.banner { font-size: 2rem; font-weight: 800; color: var(--ok); }

/* ---- Pais ---- */
.parents { display: grid; grid-template-columns: 1fr 1fr; gap: 2vw; flex: 1; min-height: 0; }
.pcard { background: var(--bg2); border-radius: 1.2rem; padding: 1.2rem 1.5rem; display: flex; flex-direction: column; gap: .9rem; min-height: 0; }
.hist { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.hist th, .hist td { text-align: left; padding: .25em .4em; border-bottom: 1px solid var(--line); }
.hist th { color: var(--muted); font-weight: 600; }
.hist .y { color: var(--ok); } .hist .n { color: var(--muted); }
.pin-dots { font-size: 3rem; letter-spacing: .5em; min-height: 1.3em; }
.hint { font-size: .9rem; color: var(--muted); }

/* ---- Matérias ---- */
.subjects { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; margin-top: 3vh; }
.subj-card { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; min-height: 23vh;
  padding: 1.1rem 1.3rem; border-color: var(--line); text-align: left; }
.subj-card .badge { font-size: 1.5rem; font-weight: 800; color: #1a1a1a; background: var(--sc); border-radius: .7rem;
  padding: .15em .5em; min-width: 2.6em; text-align: center; }
.subj-card .sname { font-size: 1.45rem; font-weight: 700; margin-top: .3rem; }
.subj-card .slevel { color: var(--muted); font-size: 1rem; }
.subj-card .sdone { color: var(--ok); font-size: 1rem; font-weight: 600; }
.subj-card:focus { border-color: var(--sc); box-shadow: 0 0 0 .3rem var(--sc); }

.info { background: var(--bg2); border-left: .4rem solid var(--kid); border-radius: 1rem; padding: 1rem 1.4rem; margin: 0 0 3vh; }
.info h3 { margin: 0 0 .5em; font-size: 1.2rem; color: var(--kid); }
.info p { font-size: 1rem; margin-bottom: .4em; }
.info.intro { padding: .7rem 1.2rem; margin-bottom: 2vh; } .info.intro h3 { font-size: 1.05rem; margin-bottom: .3em; }
.info.intro p { font-size: .88rem; line-height: 1.35; margin-bottom: .25em; } .info.intro .hint { font-size: .75rem; }

/* ---- Múltipla escolha ---- */
.sheet.mc { grid-template-columns: 1fr 1fr; }
.question.mcq { font-size: 2.6rem; line-height: 1.25; }
.question.mcq.long { font-size: 1.75rem; text-align: left; }
.opts { display: flex; flex-direction: column; gap: .9rem; }
.opt { text-align: left; font-size: 1.45rem; padding: .7em 1em; display: flex; gap: .8em; align-items: center; }
.opt .n { flex: none; width: 1.8em; height: 1.8em; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-weight: 700; font-size: .85em; }
.opt.ok { background: rgba(74,222,128,.22); border-color: var(--ok); }
.opt.bad { background: rgba(255,107,107,.2); border-color: var(--bad); opacity: .75; }
.opt:disabled { cursor: default; }

/* ---- Memória ---- */
.mem { display: grid; gap: 1rem; flex: 1; min-height: 0; margin: 2vh auto; width: min(100%, 70rem); }
.card { font-size: 3rem; font-weight: 800; padding: 0; min-height: 7rem; background: var(--card); }
.card.up { background: var(--bg2); }
.card.word { font-size: 1.35rem; }
.card.done { border-color: var(--ok); background: rgba(74,222,128,.15); }

/* ---- Pais (v2) ---- */
.levels-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.levels-table td { padding: .2em .3em; border-bottom: 1px solid var(--line); }
.levels-table .lvname { width: 100%; }

/* ---- Tempo de TV ---- */
.tv-panel { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin-top: 2.5vh;
  background: var(--bg2); border-radius: 1rem; padding: .9rem 1.3rem; font-size: 1.1rem; }
.tv-panel .tv-on { color: var(--ok); }

/* aviso do vigia: app de streaming bloqueado fora de sessão */
.aviso { background: var(--bg2); border-left: .4rem solid var(--bad); border-radius: 1rem; padding: .9rem 1.4rem; margin: 0 0 2vh;
  display: flex; flex-direction: column; gap: .3em; }
.aviso b { font-size: 1.6rem; color: var(--bad); } .aviso span { font-size: 1.1rem; }
