:root {
  --navy: #1c2b66;
  --blue: #2447a8;
  --gold: #f9c61b;
  --red: #d93a26;
  --red-dark: #b82a18;
  --green: #17803f;
  --bg: #fdf8ec;
  --card: #ffffff;
  --ink: #14213d;
  --muted: #5b6785;
  --line: #dde3ef;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(11, 46, 107, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  min-height: 100vh;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- topo ---------- */
.topbar {
  position: relative; z-index: 2;
  background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff;
  border-bottom: 5px solid var(--gold);
  padding: .45rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  box-shadow: 0 3px 10px rgba(120, 20, 10, .25);
}
.brand { font-weight: 900; letter-spacing: .03em; display: flex; align-items: center; gap: .7rem; text-transform: uppercase; line-height: 1.1; }
.brand small { display: block; font-weight: 600; font-size: .68rem; letter-spacing: .08em; color: #ffe38a; }
.brand-logo { height: 54px; width: auto; margin: 0 0 -20px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .3)); }
.topbar a, .topbar button.link { color: #ffe9b0; text-decoration: none; font-size: .9rem; background: none; border: 0; cursor: pointer; }
.topbar a:hover, .topbar button.link:hover { color: #fff; text-decoration: underline; }

main { max-width: 760px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
main.wide { max-width: 1100px; }

/* ---------- cartões e botões ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem;
}
.hero { text-align: center; padding: 1rem 0 1.25rem; }
.hero p { color: var(--muted); }
.grid { display: grid; gap: 1rem; }

.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  padding: .75rem 1.2rem; border-radius: 10px; background: var(--blue); color: #fff;
  transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.gold { background: var(--gold); color: #3a2a00; box-shadow: 0 2px 0 #b58f00; }
.btn.ghost { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
.btn.danger { background: var(--red); }
.btn.small { padding: .35rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn.big { font-size: 1.15rem; padding: .95rem 1.6rem; width: 100%; }

label { display: block; font-weight: 600; margin-bottom: .25rem; font-size: .92rem; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: .65rem .75rem; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, .option:focus-visible {
  outline: 3px solid rgba(20, 80, 184, .35); outline-offset: 1px; border-color: var(--blue);
}
textarea { resize: vertical; min-height: 4.5rem; }
.field { margin-bottom: .9rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.check input { width: 1.1rem; height: 1.1rem; }
.error-msg { color: var(--red); font-weight: 600; margin: .5rem 0; }

/* ---------- escolha da avaliação ---------- */
.exam-card h2 { color: var(--navy); }
.exam-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 1rem; }
.chip {
  background: #e8efff; color: var(--navy); border-radius: 999px;
  padding: .2rem .65rem; font-size: .82rem; font-weight: 700;
}
.chip.gold { background: #fff0bd; }
.chip.ok { background: #d9f3e3; color: var(--green); }
.chip.bad { background: #fde0e4; color: var(--red); }
.chip.gray { background: #eceff5; color: var(--muted); }

.rules {
  background: #fff8e0; border: 2px solid var(--gold); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin: 1rem 0;
}
.rules h3 { color: var(--navy); }
.rules ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.rules li { margin-bottom: .3rem; }
.rules strong { color: var(--red); }

/* ---------- contagem regressiva ---------- */
.countdown { text-align: center; padding: 1.5rem 0; }
.countdown .warn {
  background: var(--red); color: #fff; border-radius: var(--radius); border: 3px solid var(--gold);
  padding: 1rem; margin-bottom: 1.5rem; font-size: 1.15rem;
}
.countdown .warn b { color: var(--gold); font-size: 1.5rem; }
.count-num {
  width: 190px; height: 190px; margin: 0 auto 1rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 6rem; font-weight: 900; color: var(--navy);
  background: #fff; border: 10px solid var(--gold); box-shadow: var(--shadow);
}
.count-num.pop { animation: pop .9s ease-out; }
@keyframes pop { 0% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ---------- pergunta ---------- */
.q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; font-weight: 700; color: var(--navy); }
.time-num {
  min-width: 3.2rem; text-align: center; font-size: 1.5rem; font-weight: 900;
  background: var(--navy); color: #fff; border-radius: 10px; padding: .1rem .5rem;
}
.time-num.danger { background: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .6; } }
.timer-bar { height: 14px; background: #dfe6f5; border-radius: 999px; overflow: hidden; margin-bottom: 1.1rem; }
.timer-bar > span { display: block; height: 100%; width: 100%; background: var(--blue); transition: width .1s linear, background .3s; }
.timer-bar.danger > span { background: var(--red); }

.question-card { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.question-text { font-size: 1.3rem; font-weight: 700; margin-bottom: 1.1rem; }
.options { display: grid; gap: .65rem; }
.option {
  display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left;
  font: inherit; font-size: 1.08rem; padding: .85rem 1rem; border-radius: 12px;
  background: #fff; border: 2px solid var(--line); color: var(--ink); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.option:hover:not(:disabled) { border-color: var(--blue); background: #f0f5ff; }
.option .letter {
  flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: #e8efff; color: var(--navy); font-weight: 800;
}
.option.selected { border-color: var(--blue); background: #dfeaff; }
.option.selected .letter { background: var(--blue); color: #fff; }
.option:disabled { cursor: default; }
.q-img { display: block; max-width: 100%; max-height: 220px; margin: 0 auto 1rem; border-radius: 10px; -webkit-user-drag: none; }
.options.has-images { grid-template-columns: 1fr 1fr; }
.option.with-img { flex-direction: column; align-items: stretch; gap: .5rem; padding: .6rem; }
.option .cap { display: flex; align-items: center; gap: .6rem; }
.opt-img { display: block; width: 100%; height: auto; max-height: 150px; object-fit: contain; border-radius: 8px; background: #eef3fc; pointer-events: none; -webkit-user-drag: none; }
@media (max-width: 420px) { .option.with-img { font-size: .95rem; } .option .letter { width: 1.7rem; height: 1.7rem; } }
.banner {
  text-align: center; font-weight: 800; color: var(--red); background: #fde8eb;
  border-radius: 10px; padding: .6rem; margin-top: 1rem;
}

/* ---------- resultado ---------- */
.result { text-align: center; }
.ring {
  --p: 0; width: 170px; height: 170px; border-radius: 50%; margin: .5rem auto 1rem;
  background: conic-gradient(var(--ring-color, var(--blue)) calc(var(--p) * 1%), #e3e9f6 0);
  display: grid; place-items: center;
}
.ring > div {
  width: 134px; height: 134px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; font-size: 2.2rem; font-weight: 900; color: var(--navy);
}
.verdict { font-size: 1.5rem; font-weight: 900; }
.verdict.ok { color: var(--green); }
.verdict.bad { color: var(--red); }
.review { text-align: left; margin-top: 1.5rem; display: grid; gap: .7rem; }
.review-item { border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 10px; padding: .75rem .9rem; background: #fff; }
.review-item.ok { border-left-color: var(--green); }
.review-item.bad { border-left-color: var(--red); }
.review-item .q { font-weight: 700; margin-bottom: .3rem; }
.review-item .expl { color: var(--muted); font-size: .92rem; margin-top: .3rem; }

/* ---------- avisos ---------- */
.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: .75rem 1.1rem; border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); z-index: 100; max-width: 92vw; font-weight: 600;
}
.toast.bad { background: var(--red); }
.toast.ok { background: var(--green); }

@media (max-width: 520px) {
  h1 { font-size: 1.5rem; }
  .question-text { font-size: 1.15rem; }
  .count-num { width: 160px; height: 160px; font-size: 5rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================ ADMIN ============================ */
.login-card { max-width: 380px; margin: 3rem auto; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1.1rem; border-bottom: 2px solid var(--line); }
.tab {
  background: none; border: 0; font: inherit; font-weight: 700; color: var(--muted);
  padding: .6rem 1rem; cursor: pointer; border-bottom: 4px solid transparent; margin-bottom: -2px;
}
.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); border-bottom-color: var(--gold); }

.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar > * { flex: 0 1 auto; }
.toolbar select, .toolbar input[type=search] { width: auto; min-width: 200px; }
.toolbar .spacer { flex: 1 1 auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.7rem; color: var(--navy); }
.stat span { color: var(--muted); font-size: .85rem; font-weight: 600; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #eef2fb; color: var(--navy); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: normal; text-align: right; min-width: 128px; }
td.actions .btn { margin: .15rem 0; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

.section-title { margin: 1.6rem 0 .6rem; color: var(--navy); }
.q-list { display: grid; gap: .6rem; }
.q-item { display: flex; gap: .8rem; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem; }
.q-item.off { opacity: .55; }
.q-item .body { flex: 1; min-width: 0; }
.q-item .body .t { font-weight: 700; }
.q-item .body ul { margin: .35rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: .9rem; }
.q-item .body li.right { color: var(--green); font-weight: 700; }

dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(640px, 94vw); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); color: var(--ink); }
dialog::backdrop { background: rgba(11, 30, 70, .55); }
.dlg-head { background: var(--navy); color: #fff; padding: .85rem 1.1rem; font-weight: 800; border-bottom: 4px solid var(--gold); }
.dlg-body { padding: 1.1rem; max-height: 70vh; overflow-y: auto; }
.dlg-foot { padding: .8rem 1.1rem; display: flex; justify-content: flex-end; gap: .6rem; border-top: 1px solid var(--line); background: #f7f9fd; }
.opt-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .45rem; }
.opt-row input[type=radio] { width: 1.2rem; height: 1.2rem; flex: none; accent-color: var(--green); }
.opt-row input[type=text] { flex: 1; }
code.block { display: block; background: #0e1a33; color: #d6e4ff; padding: .7rem; border-radius: 8px; font-size: .78rem; overflow-x: auto; white-space: pre; margin-bottom: .75rem; }

/* upload de imagem no admin */
.img-picker { display: inline-flex; align-items: center; gap: .4rem; flex: none; }
.thumb { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; border: 1px solid var(--line); background: #eef3fc; }
.q-item .body .t .q-thumb { display: block; max-height: 70px; margin-bottom: .3rem; border-radius: 6px; }
.q-item li .thumb { width: 28px; height: 28px; vertical-align: middle; margin-right: .35rem; }
.opt-row { flex-wrap: wrap; }

.retry-box { text-align: left; margin: 1.1rem 0; }
.retry-box .btn { margin-top: .5rem; }

/* ---- pergunta de ligar colunas (português ↔ idioma) */
.match-help { margin: 0 0 .6rem; font-size: .92rem; }
.match-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.match-col { display: grid; gap: .45rem; align-content: start; }
.match-title { font-weight: 800; color: var(--navy); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.match-item {
  font: inherit; font-weight: 600; color: var(--ink); text-align: center; cursor: pointer;
  background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: .55rem .4rem; min-height: 2.6rem;
  transition: border-color .12s, background .12s;
}
.match-item:hover:not(:disabled) { border-color: var(--blue); background: #f0f5ff; }
.match-item.active { border-color: var(--blue); background: #dfeaff; box-shadow: 0 0 0 3px rgba(20, 80, 184, .25); }
.match-item:disabled { cursor: default; }
.match-count { text-align: center; margin: .8rem 0 .5rem; font-weight: 700; color: var(--muted); }
.match .btn { display: block; margin: 0 auto; }
.match-item.paired { color: #0b1b3a; }
.pc-0 { border-color: #1450b8; background: #dbe7ff; }
.pc-1 { border-color: #c8102e; background: #fde0e4; }
.pc-2 { border-color: #17803f; background: #d9f3e3; }
.pc-3 { border-color: #b97d00; background: #fff0bd; }
.pc-4 { border-color: #7b3fc4; background: #eadcfb; }
.pc-5 { border-color: #0e8a96; background: #d3f1f4; }
.pc-6 { border-color: #d6531a; background: #ffe2d3; }
.pc-7 { border-color: #5a6b00; background: #eef3c4; }
.pc-8 { border-color: #c2307f; background: #fbdcec; }
.pc-9 { border-color: #3f4a6b; background: #e1e5ef; }
.pc-10 { border-color: #2a6f4f; background: #cdeede; }
.pc-11 { border-color: #8a4b1d; background: #f3e1d0; }
.review-item div, td.pre { white-space: pre-line; }

/* ---------- identidade Desbravadores ---------- */
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(211, 38, 28, .05) 0 90px, transparent 91px),
    radial-gradient(circle at 92% 70%, rgba(246, 196, 0, .12) 0 140px, transparent 141px);
  background-attachment: fixed;
}
.card { border: 2px solid #efe3bf; box-shadow: 0 3px 12px rgba(120, 70, 0, .1); }
.hero { padding: .6rem 0 1.4rem; }
.hero-logo { width: 118px; height: auto; display: block; margin: .2rem auto .6rem; filter: drop-shadow(0 6px 8px rgba(120, 20, 10, .3)); }
.hero h1 { color: var(--navy); text-transform: uppercase; letter-spacing: .04em; font-weight: 900; font-size: 1.55rem; }
.hero h1::after { content: ''; display: block; width: 90px; height: 5px; border-radius: 3px; margin: .5rem auto 0; background: linear-gradient(90deg, var(--red) 0 50%, var(--gold) 50%); }

.exam-card { display: flex; gap: 1rem; align-items: flex-start; border-top: 6px solid var(--red); }
.exam-card .badge { flex: none; width: 92px; height: 92px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); }
.exam-card .exam-body { flex: 1; min-width: 0; }
.exam-card h2 { color: var(--navy); font-weight: 900; }
.exam-card .btn { width: 100%; }
.intro-head { display: flex; gap: 1rem; align-items: center; margin-bottom: .5rem; }
.intro-head .badge { width: 84px; height: 84px; flex: none; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); }
.intro-head h2 { margin: 0; color: var(--navy); font-weight: 900; }
.result-badge { width: 84px; height: 84px; display: block; margin: 0 auto .5rem; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); }
.count-badge { width: 70px; height: 70px; display: block; margin: 0 auto .8rem; }
.exam-thumb { width: 64px; height: 64px; flex: none; }
.card.has-thumb { display: flex; gap: .9rem; align-items: flex-start; }
.card.has-thumb > .grow { flex: 1; min-width: 0; }
.q-head .tag { display: flex; align-items: center; gap: .4rem; }
.q-head .tag img { width: 28px; height: 28px; }
.timer-bar > span { background: linear-gradient(90deg, var(--blue), #3b63d6); }
.timer-bar.danger > span { background: var(--red); }
@media (max-width: 420px) {
  .exam-card { flex-direction: column; align-items: center; text-align: center; }
  .exam-card .exam-meta { justify-content: center; }
  .brand small { display: none; }
  .brand-logo { height: 46px; margin-bottom: -16px; }
  .intro-head { flex-direction: column; text-align: center; }
}

/* =====================================================================
   PELE JUVENIL (tela dos alunos): cores fortes, contornos grossos, "adesivos"
   ===================================================================== */
.kids { --ink-line: #1c2b66; font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; background-image: url(/img/bg-pattern.svg); background-size: 160px; background-attachment: fixed; }
.kids h1, .kids h2, .kids h3 { font-weight: 900; }
.kids .card { border: 3px solid var(--ink-line); border-radius: 22px; box-shadow: 0 6px 0 var(--ink-line); }
.kids .btn {
  border: 3px solid var(--ink-line); border-radius: 16px; box-shadow: 0 5px 0 var(--ink-line);
  font-weight: 900; letter-spacing: .01em; transition: transform .08s, box-shadow .08s, filter .15s;
}
.kids .btn:hover:not(:disabled) { filter: none; transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink-line); }
.kids .btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink-line); }
.kids .btn.gold { background: var(--gold); color: var(--ink-line); }
.kids .btn.ghost { background: #fff; color: var(--ink-line); }
.kids .chip { border: 2px solid var(--ink-line); background: #fff; font-weight: 800; }
.kids .chip.gold { background: var(--gold); }
.kids input[type=text] { border: 3px solid var(--ink-line); border-radius: 14px; }
.kids input:focus { outline: 4px solid rgba(249, 198, 27, .6); border-color: var(--ink-line); }

.kids .topbar { border-bottom: 6px solid var(--gold); }
.kids .brand-logo { height: 64px; margin-bottom: -26px; animation: wiggle 6s ease-in-out infinite; transform-origin: 50% 20%; }
@keyframes wiggle { 0%, 88%, 100% { transform: rotate(0); } 91% { transform: rotate(-5deg); } 94% { transform: rotate(5deg); } 97% { transform: rotate(-3deg); } }

.kids .hero { padding-top: 1.2rem; }
.kids .hero-logo { width: 140px; animation: floaty 3.2s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-8px) rotate(-2deg); } }
.kids .hero h1 { font-size: 1.9rem; color: var(--red); text-shadow: 0 3px 0 var(--gold); text-transform: uppercase; letter-spacing: .02em; }
.kids .hero h1::after { height: 7px; width: 120px; }
.kids .hero p { font-size: 1.1rem; font-weight: 700; color: var(--ink-line); }

.kids .exam-card { border-top-width: 3px; background: #fff; transition: transform .15s; position: relative; }
.kids .exam-card:hover { transform: translateY(-4px) rotate(-.4deg); }
.kids .exam-card .badge { width: 104px; height: 104px; animation: floaty 4s ease-in-out infinite; }
.kids .exam-card h2 { color: var(--ink-line); }

.kids .rules { background: #fff6cf; border: 3px dashed var(--ink-line); border-radius: 18px; }
.kids .rules h3 { color: var(--red); }
.kids .rules li::marker { color: var(--red); }
.kids .intro-head .badge { width: 96px; height: 96px; }

.kids .countdown .warn { border: 3px solid var(--ink-line); box-shadow: 0 6px 0 var(--ink-line); border-radius: 20px; background: var(--red); }
.kids .count-num { border: 12px solid var(--gold); outline: 4px solid var(--ink-line); color: var(--red); animation: none; box-shadow: 0 8px 0 var(--ink-line); }
.kids .count-num.pop { animation: pop .9s cubic-bezier(.2, 1.6, .4, 1); }
.kids .count-badge { width: 84px; height: 84px; animation: floaty 3s ease-in-out infinite; }

/* pergunta */
.kids .q-head { font-size: 1.05rem; }
.kids .q-head > span:first-child { background: var(--gold); border: 3px solid var(--ink-line); border-radius: 999px; padding: .15rem .8rem; }
.kids .time-num { background: var(--blue); border: 3px solid var(--ink-line); border-radius: 999px; padding: .1rem .8rem; box-shadow: 0 3px 0 var(--ink-line); }
.kids .time-num.danger { background: var(--red); }
.kids .timer-bar { height: 22px; border: 3px solid var(--ink-line); background: #fff; border-radius: 999px; }
.kids .timer-bar > span {
  background: repeating-linear-gradient(-45deg, #3a63d6 0 12px, var(--blue) 12px 24px); background-size: 34px 34px;
  animation: barmove 1s linear infinite;
}
.kids .timer-bar.danger > span { background: repeating-linear-gradient(-45deg, #ff6a52 0 12px, var(--red) 12px 24px); }
@keyframes barmove { to { background-position: 34px 0; } }
.kids .question-text { font-size: 1.4rem; font-weight: 900; color: var(--ink-line); }
.kids .option {
  border: 3px solid var(--ink-line); border-radius: 16px; background: #fff; box-shadow: 0 4px 0 var(--ink-line);
  font-weight: 700; transition: transform .08s, box-shadow .08s, background .12s;
}
.kids .option:hover:not(:disabled) { background: #fff6cf; border-color: var(--ink-line); transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink-line); }
.kids .option:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink-line); }
.kids .option .letter { border: 3px solid var(--ink-line); color: #fff; font-weight: 900; }
.kids .option:nth-child(1) .letter { background: var(--red); }
.kids .option:nth-child(2) .letter { background: var(--blue); }
.kids .option:nth-child(3) .letter { background: var(--gold); color: var(--ink-line); }
.kids .option:nth-child(4) .letter { background: #2aa84f; }
.kids .option:nth-child(5) .letter { background: #8a4fd6; }
.kids .option:nth-child(6) .letter { background: #e8741c; }
.kids .option.selected { background: var(--gold); transform: translateY(3px); box-shadow: 0 1px 0 var(--ink-line); border-color: var(--ink-line); }
.kids .option.selected .letter { background: #fff; color: var(--ink-line); }
.kids .banner { background: var(--red); color: #fff; border: 3px solid var(--ink-line); border-radius: 14px; }

.kids .match-item { border: 3px solid var(--ink-line); border-radius: 14px; box-shadow: 0 3px 0 var(--ink-line); font-weight: 800; transition: transform .08s, box-shadow .08s, background .12s; }
.kids .match-item:hover:not(:disabled) { transform: translateY(-1px); background: #fff6cf; border-color: var(--ink-line); }
.kids .match-item.active { background: var(--gold); border-color: var(--ink-line); box-shadow: 0 0 0 4px rgba(249, 198, 27, .5), 0 3px 0 var(--ink-line); transform: translateY(-2px); }
.kids .match-item.paired { border-color: var(--ink-line); box-shadow: 0 3px 0 var(--ink-line); }
.kids .match-title { background: var(--ink-line); color: #fff; border-radius: 999px; padding: .15rem .6rem; }
.kids .match-count { color: var(--ink-line); font-size: 1.05rem; }

/* resultado */
.kids .result h2 { font-size: 1.5rem; color: var(--ink-line); }
.kids .ring { filter: drop-shadow(0 5px 0 var(--ink-line)); }
.kids .ring > div { border: 4px solid var(--ink-line); }
.kids .verdict { font-size: 1.7rem; }
.kids .verdict.ok { color: #1f9a46; }
.kids .review-item { border: 3px solid var(--ink-line); border-left-width: 10px; border-radius: 14px; }
.kids .review-item.ok { border-color: var(--ink-line); border-left-color: #2aa84f; }
.kids .review-item.bad { border-color: var(--ink-line); border-left-color: var(--red); }
.kids .result-badge { width: 110px; height: 110px; animation: floaty 3s ease-in-out infinite; }
.kids .retry-box { background: #e9f0ff; border: 3px dashed var(--ink-line); }

/* confete (aprovado!) */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i {
  position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px;
  animation: confetti-fall var(--dur, 3.5s) linear var(--delay, 0s) forwards;
}
@keyframes confetti-fall {
  0% { transform: translate3d(0, -20px, 0) rotate(0); opacity: 1; }
  100% { transform: translate3d(var(--dx, 0px), 105vh, 0) rotate(var(--rot, 540deg)); opacity: .9; }
}
@media (max-width: 420px) { .kids .hero h1 { font-size: 1.5rem; } .kids .exam-card .badge { width: 92px; height: 92px; } }
.kids .countdown .muted, .kids .hero p { background: rgba(255, 253, 245, .92); display: inline-block; padding: .15rem .9rem; border-radius: 999px; }

/* título legível sobre o fundo estampado */
.kids .hero h1 {
  display: inline-block; color: var(--ink-line); text-shadow: none; letter-spacing: .02em;
  background: #fff; border: 3px solid var(--ink-line); border-radius: 16px; box-shadow: 0 5px 0 var(--ink-line);
  padding: .35rem 1.1rem;
}
.kids .hero h1::after { display: none; }
.kids .hero { position: relative; }
.kids .hero .hero-underline { display: block; width: 120px; height: 7px; border-radius: 4px; margin: .7rem auto .6rem; background: linear-gradient(90deg, var(--red) 0 50%, var(--gold) 50%); }
.kids .countdown .muted, .kids .hero p { font-weight: 800; color: var(--ink-line); }

/* insígnias reais das especialidades (ovais, 570x476) */
.exam-card .badge, .intro-head .badge, .result-badge, .count-badge, .exam-thumb { height: auto !important; object-fit: contain; }
.kids .exam-card .badge { width: 124px; }
.kids .intro-head .badge { width: 112px; }
.kids .result-badge { width: 130px; }
.kids .count-badge { width: 100px; }
.exam-thumb { width: 78px; }
@media (max-width: 420px) { .kids .exam-card .badge { width: 120px; } }

/* =====================================================================
   MOBILE-FIRST: toque, alvos grandes e cronômetro sempre visível
   ===================================================================== */
button, .btn, .option, .match-item, .topbar a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.btn.small { min-height: 44px; }
.topbar a, .topbar button.link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .35rem; }
.q-sticky {
  position: sticky; top: 0; z-index: 5;
  margin: 0 -1rem .7rem; padding: .55rem 1rem .1rem;
  background: var(--bg); border-bottom: 3px solid rgba(28, 43, 102, .12);
}
.q-sticky .q-head { margin-bottom: .45rem; }
.q-sticky .timer-bar { margin-bottom: .55rem; }
.toast { width: max-content; max-width: calc(100vw - 2rem); pointer-events: none; text-align: center; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
/* ligar colunas: contador + confirmar sempre à vista, mesmo com 12 pares */
.match-foot {
  position: sticky; bottom: 0; z-index: 4; margin: .8rem -.4rem -.4rem; padding: .5rem .4rem calc(.5rem + env(safe-area-inset-bottom, 0px));
  background: #fff; border-top: 3px solid rgba(28, 43, 102, .15);
}
.match-foot .match-count { margin: 0 0 .4rem; }
.match-foot .btn { width: 100%; padding: .6rem 1rem; }

/* ---- admin no celular */
.topbar nav { display: flex; align-items: center; gap: .2rem .9rem; flex-wrap: wrap; justify-content: flex-end; }
#logout { border-left: 1px solid rgba(255, 255, 255, .45); padding-left: .9rem; }
@media (max-width: 560px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 0; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 1 1 auto; text-align: center; white-space: nowrap; padding: .75rem .45rem; font-size: .85rem; min-height: 44px; }
  .toolbar select, .toolbar input[type=search] { flex: 1 1 100%; width: 100%; min-width: 0; }
  .toolbar .spacer { display: none; }
  .toolbar .btn { flex: 1 1 auto; text-align: center; }
  .login-card { margin: 1.2rem auto; }
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .dlg-body { max-height: calc(100dvh - 10rem); }
  .dlg-foot .btn { flex: 1 1 auto; }
}
@media (max-width: 560px) { .hide-sm { display: none; } #logout { padding-left: .7rem; } }
@media (max-width: 420px) {
  .topbar { gap: .5rem; padding-left: .7rem; padding-right: .7rem; }
  .brand { font-size: .85rem; gap: .4rem; }
  .topbar nav { flex-wrap: nowrap; gap: 0 .5rem; white-space: nowrap; }
  .topbar a, .topbar button.link { font-size: .85rem; }
}

/* ---- resultados em cartões no celular (sem rolar para o lado) */
@media (max-width: 700px) {
  .table-wrap:has(table.attempts) { background: none; border: 0; box-shadow: none; overflow: visible; }
  table.attempts, table.attempts tbody { display: block; }
  table.attempts thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.attempts tbody { display: grid; gap: .8rem; }
  table.attempts tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .9rem; padding: .85rem;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  }
  table.attempts td { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: 0; border: 0; min-width: 0; }
  table.attempts td::before { content: attr(data-l); font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
  table.attempts td.who { grid-column: 1 / -1; font-size: 1.05rem; font-weight: 800; color: var(--navy); }
  table.attempts td.who::before { display: none; }
  table.attempts td.wide, table.attempts td.actions { grid-column: 1 / -1; }
  table.attempts td.actions { flex-direction: row; flex-wrap: wrap; gap: .45rem; padding-top: .35rem; border-top: 1px solid var(--line); }
  table.attempts td.actions::before { display: none; }
  table.attempts td.actions .btn { flex: 1 1 auto; margin: 0; min-height: 44px; }
}
@media (max-width: 560px) { th, td { padding: .5rem .5rem; } th { white-space: normal; font-size: .7rem; } }

/* ---- lista de perguntas no celular: texto com a largura toda, botões embaixo */
.q-item .check { display: inline-flex; padding: .55rem; margin: -.55rem; }
.q-item .check input { width: 1.3rem; height: 1.3rem; accent-color: var(--blue); }
@media (max-width: 560px) {
  .q-item { flex-wrap: wrap; gap: .5rem .8rem; }
  .q-item .body { flex: 1 1 calc(100% - 3rem); }
  .q-item .q-actions { flex: 1 1 100%; display: flex; gap: .5rem; padding-top: .45rem; border-top: 1px solid var(--line); }
  .q-item .q-actions .btn { flex: 1 1 0; min-height: 44px; margin: 0; }
}
@media (max-width: 560px) {
  .card.has-thumb { flex-direction: column; gap: .6rem; }
  .card.has-thumb > .exam-thumb { width: 84px; }
  .dlg-body input[type=checkbox] { width: 1.3rem; height: 1.3rem; }
}

/* data limite no editor de avaliação */
.ends-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ends-row input { flex: 1 1 14rem; min-width: 0; }
.hint { font-size: .85rem; margin: .4rem 0 0; }
.exam-card.closed { filter: grayscale(.85); opacity: .85; }
.exam-card.closed .badge { animation: none; }
.ends-row input[type=datetime-local] { min-height: 44px; font: inherit; font-size: 1rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
