:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  --radius: 14px;

  --ok-bg: #ecfdf5;
  --ok: #065f46;
  --bad-bg: #fef2f2;
  --bad: #991b1b;

  --btn: #1f2937;
  --btn-hover: #111827;
  --btn-disabled: #9ca3af;
}

* { 
    box-sizing: border-box;
    unicode-bidi: isolate;
  }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, sans-serif;
  background: linear-gradient(45deg, rgba(15, 85, 105, 1) 79%, rgba(82, 183, 193, 1) 100%);
  border-bottom: 3px solid #ffffff;
  color: var(--text);
  line-height: 1.45;
}

span {
  color: #52B7C1;
}

header {
  display: block;
  position: static;
  width: 100%;
  z-index: 200;
}

.logoheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  margin: 0;
  float: none;

  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  line-height: 1;
  color: #000;
}

.headertext {
  display: block;
  font-family: 'Inter', 'Poppins', sans-serif;
  width: auto;
  font-size: clamp(18px, 4.6vw, 28px);
  font-weight: 900;
  color: #FFFFFF;
  height: auto;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.1;
}

.logo {
  display: block;
  width: auto;
  float: none;
  margin: 0;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  padding-bottom: 72px; /* Platz für festen Footer */
}

.card {
  width: 100%;
  height: auto;
  max-width: 780px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}



.logo img {
  display: block;
  width: auto;
  height: clamp(40px, 9vw, 64px);
  max-width: min(220px, 40vw);
}

@media (min-width: 640px) {
  .card { padding: 26px; }
  .logo img {
    height: 70px;
    max-width: 320px;
  }
}

h1, h2 {
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 14px 0;
  color: var(--muted);
}

.question {
  margin: 12px 0 14px 0;
  font-size: 1.05rem;
}

input[type="email"]{
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
}

/* NEU: optionales Bild zur Frage */
.question-media {
  margin: 10px 0 14px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.question-media img {
  display: block;
  width: 100%;
  height: auto;
}

.question-media figcaption {
  padding: 10px 12px;
  font-size: 0.92rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.answers {
  margin: 10px 0 14px 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.answers label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.answers input {
  margin-top: 3px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--btn);
  color: #fff;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.04s ease, background 0.15s ease, opacity 0.15s ease;
}

button:hover {
  background: var(--btn-hover);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  background: var(--btn-disabled);
  cursor: not-allowed;
  opacity: 0.85;
}

.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.secondary:hover {
  background: #f9fafb;
}

.feedback {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.correct {
  border-color: rgba(6, 95, 70, 0.25);
  background: var(--ok-bg);
  color: var(--ok);
}

.incorrect {
  border-color: rgba(153, 27, 27, 0.25);
  background: var(--bad-bg);
  color: var(--bad);
}

.result {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.small {
  font-size: 0.92rem;
  color: var(--muted);
}

.hr {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
  border: 0;
}

.list {
  margin: 10px 0 0 0;
  padding-left: 18px;
  color: var(--text);
}

/* NEU: Score-Anzeige (z. B. oben in der Karte) */
.scorebar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 0.92rem;
  color: var(--text);
}

/* NEU: Highscore-Tabelle */
.highscores {
  margin-top: 14px;
}

.highscores table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.highscores th,
.highscores td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.highscores th {
  background: #f9fafb;
  color: var(--text);
  font-weight: 700;
}

.highscores tr:last-child td {
  border-bottom: 0;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}

input[type="text"] {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 1rem;
  min-width: 220px;
}

.privacy-note {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Footer / Legal */
.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  z-index: 150;
}

.footer-nav {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  font-size: 0.95rem;
}

.footer-nav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 650;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-nav span {
  color: rgba(255, 255, 255, 0.75);
}

.card.legal a {
  color: var(--text);
  text-decoration: underline;
}

.button-like {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--btn);
  color: #fff !important;
  font-weight: 650;
  text-decoration: none !important;
}

.button-like:hover {
  background: var(--btn-hover);
}

.rubric {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.rubric-title {
  font-size: 1.1rem;
  font-weight: 750;
  margin: 0 0 6px 0;
  color: var(--text);
}

.rubric-desc {
  margin: 0;
}

/* Verhindert Überläufe in der Kachel (lange Wörter/URLs/Bilder) */
.card {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.card img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Mobile Typografie: Text & Buttons gut lesbar */
body {
  font-size: clamp(16px, 4vw, 18px);
}

button {
  font-size: 1rem;
  padding: 12px 16px;
}

@media (max-width: 420px) {
  .logoheader {
    flex-wrap: wrap;
  }
  .headertext {
    flex: 1 1 100%;
  }
  .logo {
    margin-left: auto;
  }
}
