/* Brasilien-Quiz · Leben in Brasilien */
:root, :root[data-theme="light"] {
  --bg: #fbf7ee; --surface: #ffffff; --ink: #0f2238; --muted: #4d5e6e; --line: #e6dcc6;
  --green: #009c3b; --green-deep: #00843d; --green-soft: #e3f4e9; --green-ink: #06622f;
  --yellow: #ffdf00; --yellow-soft: #fff6c2; --blue: #002776; --blue-mid: #1f4fa3;
  --red: #c62828; --red-soft: #fdecea;
  --focus: #1f4fa3;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 16px;
  --shadow: 0 1px 0 rgba(8,23,42,0.04), 0 14px 30px -18px rgba(8,23,42,0.45);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.55 var(--body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-mid); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: #fff; padding: 0.5rem 0.8rem; border-radius: 8px; }
.wrap { width: min(44rem, 100%); margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }

/* Kopfleiste wie auf der Homepage */
.qbar { position: sticky; top: 0; z-index: 20; background: linear-gradient(100deg, #00843d 0%, #009c3b 55%, #0aa64a 100%); box-shadow: 0 3px 16px -8px rgba(0,40,20,0.55); }
.qbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; background: linear-gradient(90deg, var(--yellow) 0 50%, var(--blue-mid) 50% 100%); }
.qbar-in { width: min(44rem, 100%); margin: 0 auto; padding: 0.6rem 16px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.12rem; color: #fff; text-decoration: none; text-shadow: 0 1px 2px rgba(0,40,20,0.35); white-space: nowrap; }
.brand span { color: var(--yellow); }
.home-link { color: #fff; font-weight: 600; font-size: 0.95rem; text-decoration: none; padding: 0.35rem 0.7rem; border-radius: 999px; border: 1px solid rgba(255,255,255,0.5); white-space: nowrap; }
.home-link:hover { background: rgba(255,255,255,0.15); }

main { padding: 1.4rem 0 2.5rem; outline: none; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 1.4rem 1.25rem; }
.card + .card { margin-top: 1.1rem; }
h1, h2 { font-family: var(--display); line-height: 1.15; margin: 0; }
h1 { font-size: clamp(1.8rem, 6.5vw, 2.5rem); font-weight: 800; }
h2 { font-size: 1.3rem; }
.kicker { margin: 0 0 0.35rem; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-deep); }
.kicker::before { content: ""; display: block; width: 3rem; height: 4px; border-radius: 2px; margin-bottom: 0.6rem; background: linear-gradient(90deg, var(--green) 0 33.3%, var(--yellow) 33.3% 66.6%, var(--blue-mid) 66.6% 100%); }
.lead { font-size: 1.12rem; color: var(--muted); margin: 0.6rem 0 0; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.row.center { justify-content: center; }

/* Knöpfe: groß und gut zu treffen */
.btn { font: 700 1.05rem var(--body); border-radius: 12px; border: 0; padding: 0.8rem 1.3rem; min-height: 3rem; cursor: pointer; transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-main { background: var(--yellow); color: var(--blue); box-shadow: 0 3px 0 #d9b800, 0 8px 18px -10px rgba(0,40,20,0.5); }
.btn-main:hover { background: #ffe94d; }
.btn-ghost { background: transparent; color: var(--green-ink); border: 2px solid var(--green); }
.btn-ghost:hover { background: var(--green-soft); }
.btn-big { width: 100%; min-height: 3.4rem; font-size: 1.12rem; margin-top: 1rem; }

/* Start */
.start-pic { margin: 0 0 -2.2rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 16 / 9; }
.start-pic img { width: 100%; height: 100%; object-fit: cover; }
.start-card { position: relative; margin: 0 0.6rem; }
.chips { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chips li { background: var(--green-soft); color: var(--green-ink); border-radius: 999px; padding: 0.3rem 0.75rem; font-weight: 600; font-size: 0.92rem; }
.resume { margin-top: 1.1rem; background: var(--yellow-soft); border: 1px solid #f0dc7a; border-radius: 12px; padding: 0.9rem 1rem; }
.resume p { margin: 0; }
.start-form { margin-top: 1.2rem; }
.start-form label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.start-form small { font-weight: 400; color: var(--muted); }
.start-form input { width: 100%; font: 1.05rem var(--body); padding: 0.75rem 0.9rem; border-radius: 10px; border: 1px solid #cbd6cf; background: #fff; color: var(--ink); min-height: 3rem; }
.start-form input:focus { border-color: var(--green); outline: 2px solid var(--green); outline-offset: 1px; }
.hint { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--muted); }

/* Status und Fortschritt */
.status { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 0 0 0.5rem; font-weight: 700; }
.status p { margin: 0; }
.pos { color: var(--green-ink); }
.score { background: var(--yellow-soft); color: var(--blue); border-radius: 999px; padding: 0.2rem 0.75rem; font-size: 0.95rem; }
.progress { height: 10px; background: #e7e0cd; border-radius: 999px; overflow: hidden; margin-bottom: 1rem; }
.progress span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--green) 0%, #2bb35a 60%, var(--yellow) 100%); transition: width .5s ease; }

/* Frage */
.q-card { padding-top: 1.1rem; }
.q-pic { margin: -0.1rem 0 1rem; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; background: #e9e3d3; }
.q-pic img, .fb-pic img { width: 100%; height: 100%; object-fit: cover; }
.q-text { font-size: clamp(1.25rem, 4.6vw, 1.55rem); outline: none; }
.answers { display: grid; gap: 0.6rem; margin-top: 1.1rem; }
.answer { display: grid; grid-template-columns: 2.2rem 1fr 1.6rem; align-items: center; gap: 0.75rem; width: 100%; text-align: left; font: 600 1.06rem/1.35 var(--body); color: var(--ink);
  background: #fff; border: 2px solid #dfe6e1; border-radius: 12px; padding: 0.75rem 0.85rem; min-height: 3.4rem; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.answer:hover:not(:disabled) { border-color: var(--green); background: #f4fbf6; transform: translateY(-1px); box-shadow: 0 6px 14px -10px rgba(0,60,30,0.5); }
.letter { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--green-soft); color: var(--green-ink); font-weight: 800; }
.mark { font-weight: 800; font-size: 1.25rem; text-align: center; }
.answer:disabled { cursor: default; }
.answer.correct { border-color: var(--green); background: var(--green-soft); color: var(--green-ink); }
.answer.correct .letter { background: var(--green); color: #fff; }
.answer.correct .mark { color: var(--green); }
.answer.wrong { border-color: var(--red); background: var(--red-soft); color: #8e1b1b; }
.answer.wrong .letter { background: var(--red); color: #fff; }
.answer.wrong .mark { color: var(--red); }
.answer.dim { opacity: 0.55; }

.feedback { margin-top: 1.1rem; border-radius: 12px; padding: 1rem 1rem 0.2rem; border-left: 5px solid var(--green); background: #f6fbf7; animation: pop .3s ease; }
.feedback.is-wrong { border-left-color: var(--red); background: #fff8f7; }
.fb-title { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
.feedback.is-ok .fb-title { color: var(--green-ink); }
.feedback.is-wrong .fb-title { color: #a11f1f; }
.fb-text { margin: 0.4rem 0 0; }
.fb-pic { margin: 0.9rem 0 0; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; background: #e9e3d3; }
.feedback .btn-big { margin-bottom: 0.9rem; }
.keys-hint { display: none; text-align: center; font-size: 0.88rem; color: var(--muted); margin-top: 0.9rem; }
@media (hover: hover) and (pointer: fine) { .keys-hint { display: block; } }

/* Auswertung */
.result-card { text-align: center; }
.result-card .kicker::before { margin-inline: auto; }
.ring { --p: 0; width: 10.5rem; height: 10.5rem; margin: 0.8rem auto 0.4rem; border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), #ece5d2 0); display: grid; place-items: center; transition: --p 1s ease; }
.ring-in { width: 8.3rem; height: 8.3rem; border-radius: 50%; background: #fff; display: grid; place-content: center; box-shadow: inset 0 0 0 1px var(--line); }
.ring-in strong { font-family: var(--display); font-size: 3rem; line-height: 1; color: var(--green-ink); }
.ring-in span { color: var(--muted); font-weight: 600; }
.r-percent { margin: 0.2rem 0 0; font-weight: 700; color: var(--muted); }
.r-badge { margin: 0.6rem 0 0.2rem; }
.r-emoji { font-size: 2.6rem; }
.result-card h1 { font-size: clamp(1.5rem, 5.5vw, 2rem); outline: none; }
.review h2, .more h2 { margin-bottom: 0.4rem; }
.review ol { margin: 0.6rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.9rem; }
.rv-q { margin: 0; font-weight: 700; }
.rv-a { margin: 0.25rem 0 0; display: grid; gap: 0.1rem; font-size: 0.97rem; }
.rv-wrong { color: #a11f1f; }
.rv-right { color: var(--green-ink); font-weight: 700; }
.rv-e { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.97rem; }
.more-links { list-style: none; padding: 0; margin: 0.4rem 0 0; display: grid; gap: 0.45rem; }
.more-links a { display: flex; gap: 0.6rem; align-items: center; padding: 0.7rem 0.9rem; border-radius: 10px; background: #f6f2e7; color: var(--ink); text-decoration: none; font-weight: 600; }
.more-links a:hover { background: var(--green-soft); }
.soon { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.92rem; }

/* Fuß */
.qfoot { border-top: 4px solid transparent; border-image: linear-gradient(90deg, var(--green) 0 33.3%, var(--yellow) 33.3% 66.6%, var(--blue-mid) 66.6% 100%) 1; background: #f1f8f3; padding: 1.2rem 0 1.6rem; font-size: 0.92rem; color: var(--muted); }
.qfoot p { margin: 0.6rem 0 0; }
.credits summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.credits ul { margin: 0.5rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.25rem; overflow-wrap: anywhere; }

/* Dezente Animationen */
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.q-card.enter { animation: enter .35s ease; }
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (min-width: 640px) {
  .card { padding: 1.8rem 2rem; }
  .start-card { margin: 0 1.5rem; }
  .btn-big { width: auto; min-width: 16rem; }
  .start-form .btn-big { width: 100%; }
}

.r-hello { margin: 0 0 0.2rem; font-weight: 700; color: var(--muted); }
.status { margin-top: 0.4rem; }

/* Bilder nicht zu hoch, damit die Antworten sichtbar bleiben */
.q-pic, .fb-pic { aspect-ratio: auto; height: clamp(150px, 27vh, 240px); }

/* Urkunde und Teilen */
.cert h2 { margin-bottom: 0.3rem; }
.cert-intro { margin: 0 0 0.9rem; color: var(--muted); }
.cert-frame { margin: 0 auto; max-width: 26rem; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 4px rgba(8,23,42,0.08), 0 18px 34px -16px rgba(8,23,42,0.5); background: #f1ece0; aspect-ratio: 4 / 5; }
.cert-frame img { width: 100%; height: 100%; object-fit: contain; }
.cert.loading .cert-frame { background: linear-gradient(100deg, #f1ece0 40%, #faf6ec 50%, #f1ece0 60%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.share { display: grid; grid-template-columns: 1fr; gap: 0.55rem; margin-top: 1.1rem; }
.sbtn { display: flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 3.1rem; padding: 0.7rem 1rem; border-radius: 12px; font: 700 1.02rem var(--body); text-decoration: none; cursor: pointer; border: 2px solid transparent; color: var(--ink); background: #fff; }
.s-save { background: var(--yellow); color: var(--blue); box-shadow: 0 3px 0 #d9b800; border: 0; }
.s-save:hover { background: #ffe94d; }
.s-native { background: var(--blue-mid); color: #fff; border: 0; }
.s-wa { background: #25d366; color: #073b1c; }
.s-wa:hover { background: #2ee073; }
.s-fb { background: #1877f2; color: #fff; }
.s-fb:hover { background: #2d86f7; }
.s-copy { border-color: var(--green); color: var(--green-ink); }
.s-copy:hover { background: var(--green-soft); }
.share-msg { min-height: 1.2em; margin: 0.6rem 0 0; font-weight: 700; color: var(--green-ink); text-align: center; }
.share-msg:empty { display: none; }
.share-note { margin: 0.8rem 0 0; font-size: 0.9rem; color: var(--muted); }
@media (min-width: 640px) { .share { grid-template-columns: 1fr 1fr; } .s-save { grid-column: 1 / -1; } }

/* Bestenliste */
.board h2 { margin-bottom: 0.5rem; }
.board-tabs { display: inline-flex; gap: 0.3rem; background: #f1ece0; padding: 0.25rem; border-radius: 999px; margin-bottom: 0.7rem; }
.board-tabs button { font: 700 0.92rem var(--body); border: 0; background: transparent; padding: 0.4rem 0.9rem; border-radius: 999px; cursor: pointer; color: var(--muted); }
.board-tabs button[aria-pressed="true"] { background: #fff; color: var(--green-ink); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.board-list li { display: grid; grid-template-columns: 2.4rem 1fr auto auto; gap: 0.6rem; align-items: center; padding: 0.5rem 0.7rem; border-radius: 10px; background: #f8f5ec; }
.board-list li.top1 { background: #fff4c2; } .board-list li.top2 { background: #eef1f4; } .board-list li.top3 { background: #f7e9dc; }
.b-place { font-weight: 800; color: var(--green-ink); }
.b-nick { font-weight: 700; overflow-wrap: anywhere; }
.b-pts { font-weight: 800; color: var(--blue); }
.b-date { color: var(--muted); font-size: 0.85rem; }
.muted { color: var(--muted); font-size: 0.95rem; }
.board-form { margin-top: 1rem; border-top: 1px dashed var(--line); padding-top: 1rem; }
.bf-title { margin: 0 0 0.6rem; }
.board-form label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.board-form input[type=text] { width: 100%; font: 1.05rem var(--body); padding: 0.7rem 0.9rem; border-radius: 10px; border: 1px solid #cbd6cf; min-height: 3rem; }
.board-form .consent { display: grid; grid-template-columns: auto 1fr; gap: 0.55rem; font-weight: 400; color: var(--muted); margin: 0.8rem 0 0; font-size: 0.95rem; }
.board-form .consent input { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; accent-color: var(--green); }
.board-form .hp { position: absolute !important; left: -9999px; }
.board-msg { min-height: 1.2em; margin: 0.6rem 0 0; color: #a11f1f; font-weight: 700; }
.board-msg:empty { display: none; }
.board-form .btn { margin-top: 0.8rem; }
.board-done { margin: 0.9rem 0 0; font-weight: 700; color: var(--green-ink); }
@media (max-width: 420px) { .board-list li { grid-template-columns: 2rem 1fr auto; } .b-date { display: none; } }
