:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --panel: #fffdfa;
  --ink: #171717;
  --muted: #6f6a62;
  --line: #ded7cd;
  --green: #1f8a57;
  --green-dark: #14613d;
  --blue: #2769b3;
  --blue-dark: #184b83;
  --red: #b84734;
  --shadow: 0 18px 44px rgba(42, 32, 18, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.app {
  width: min(100%, 460px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto auto minmax(380px, 1fr) auto;
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.55rem;
  line-height: 1.1;
}

.counter {
  min-width: 72px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.progress-wrap {
  height: 8px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ded3;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 180ms ease;
}

.card,
.results {
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.tag-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.tag {
  max-width: 48%;
  padding: 7px 9px;
  border: 1px solid #c9dbce;
  border-radius: 999px;
  background: #edf8f1;
  color: var(--green-dark);
  font-size: 0.75rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-muted {
  border-color: #d8d2c9;
  background: #f5f1ea;
  color: var(--muted);
}

.prompt-wrap {
  min-height: 145px;
  display: grid;
  place-items: center;
  text-align: center;
}

.prompt {
  width: 100%;
  margin: 0;
  font-size: clamp(2.25rem, 14vw, 4.7rem);
  font-weight: 900;
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.subprompt {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.4;
}

.answer {
  display: grid;
  gap: 15px;
}

.hidden {
  display: none !important;
}

.facts {
  margin: 0;
  display: grid;
  gap: 8px;
}

.fact {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee8df;
}

.fact dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.fact dd {
  margin: 0;
  min-width: 0;
  font-size: 1rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.examples {
  padding: 13px;
  border-radius: 8px;
  background: #f4f7fb;
}

.example-de {
  margin-bottom: 8px;
  color: #153d68;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.38;
}

.example-en {
  margin-bottom: 0;
  color: #536170;
  line-height: 1.4;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr 64px;
  gap: 10px;
}

.button {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 10px 20px rgba(20, 20, 20, 0.14);
}

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

.button-next {
  background: var(--red);
}

.button-show {
  background: var(--blue);
}

.button-pass {
  background: var(--green);
  font-size: 1.55rem;
}

.results {
  padding: 20px;
}

.results h2 {
  margin-bottom: 16px;
  font-size: 2rem;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.score-grid div {
  min-height: 84px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8f3;
  text-align: center;
}

.score-grid span {
  display: block;
  font-size: 1.9rem;
  font-weight: 950;
}

.score-grid small {
  color: var(--muted);
  font-weight: 800;
}

.failed-list-wrap h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.failed-list {
  max-height: 190px;
  margin: 0 0 16px;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.failed-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #eee8df;
  font-weight: 800;
}

.failed-list small {
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (min-width: 700px) {
  body {
    display: grid;
    place-items: center;
  }

  .app {
    min-height: 780px;
  }
}
