/* ==================================================
   RESET / VARIABLEN
================================================== */

* {
  box-sizing: border-box;
}

:root {
  --page-bg: #f5f5f7;

  --surface: #ffffff;
  --surface-soft: #eceef1;
  --surface-soft-2: #f2f3f5;

  --text: #1d1d1f;
  --muted: #77777d;
  --muted-2: #9a9aa0;

  --accent: #527fa8;
  --accent-soft: #edf3f8;

  --danger: #b84d4d;
  --danger-soft: rgba(184, 77, 77, .11);

  --success: #3f8a61;
  --success-soft: rgba(63, 138, 97, .11);

  --border: rgba(0, 0, 0, 0.065);

  --shadow:
    0 20px 55px rgba(20, 30, 45, 0.08),
    0 3px 12px rgba(20, 30, 45, 0.04);

  --card-radius: 30px;
  --small-radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page-bg: #101113;

    --surface: #1c1d20;
    --surface-soft: #27282c;
    --surface-soft-2: #232428;

    --text: #f5f5f7;
    --muted: #9d9fa6;
    --muted-2: #777981;

    --accent: #81a9d0;
    --accent-soft: #202d39;

    --danger: #ef8585;
    --danger-soft: rgba(239, 133, 133, .14);

    --success: #7bcf9d;
    --success-soft: rgba(123, 207, 157, .14);

    --border: rgba(255, 255, 255, 0.075);

    --shadow:
      0 22px 60px rgba(0, 0, 0, 0.24),
      0 3px 12px rgba(0, 0, 0, 0.15);
  }
}

/* ==================================================
   VIEWPORT
================================================== */

html {
  width: 100%;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "SF Pro Text",
    "Segoe UI",
    sans-serif;
  overscroll-behavior: none;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button,
[role="button"] {
  user-select: none;
  -webkit-user-select: none;
}

/* ==================================================
   APP / LAYOUT
================================================== */

.vocab-app {
  width: min(100%, 760px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2dvh, 22px);
}

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

.app-title {
  min-width: 0;
}

.app-title h1 {
  margin: 0;
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: .98;
  font-weight: 700;
  letter-spacing: -.055em;
}

.app-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: clamp(.8rem, 2vw, .95rem);
}

.direction-button {
  min-width: 112px;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.035);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.direction-button:active {
  transform: scale(.98);
}

.direction-button[aria-disabled="true"] {
  cursor: default;
  opacity: .9;
}

.direction-flag {
  font-size: 1.2rem;
  line-height: 1;
}

.direction-arrow {
  min-width: 20px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

/* ==================================================
   SCREENS
================================================== */

.screen {
  display: none;
  flex: 1;
  min-height: 0;
}

.screen.is-active {
  display: flex;
  flex-direction: column;
}

.screen--setup {
  justify-content: center;
}

.screen--test {
  gap: clamp(12px, 1.8dvh, 18px);
}

.screen--result {
  justify-content: center;
}

/* ==================================================
   SETUP
================================================== */

.setup-card,
.test-card,
.result-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.setup-card {
  padding: clamp(22px, 5vw, 38px);
}

.section + .section {
  margin-top: clamp(26px, 4vw, 34px);
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.section-title {
  margin: 0;
  font-size: clamp(1rem, 2.7vw, 1.12rem);
  font-weight: 700;
  letter-spacing: -.02em;
}

.text-button {
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--accent);
  font-size: .84rem;
  font-weight: 650;
  cursor: pointer;
}

.text-button:active {
  background: var(--accent-soft);
}

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

.block-option {
  min-height: 74px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-soft-2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  transition:
    background-color .18s ease,
    border-color .18s ease,
    transform .18s ease;
}

.block-option:active {
  transform: scale(.985);
}

.block-option.is-selected {
  background: var(--accent-soft);
  border-color: rgba(82, 127, 168, .18);
}

@media (prefers-color-scheme: dark) {
  .block-option.is-selected {
    border-color: rgba(129, 169, 208, .18);
  }
}

.block-option__label {
  font-size: .98rem;
  font-weight: 650;
  line-height: 1.25;
}

.block-option__check {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: transparent;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: .8rem;
  font-weight: 800;
}

.block-option.is-selected .block-option__check {
  color: var(--accent);
  border-color: rgba(82, 127, 168, .2);
}

.count-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft-2);
}

.count-option {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 650;
  cursor: pointer;
}

.count-option.is-selected {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 5px rgba(0,0,0,.045);
}

.setup-summary {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

.start-button,
.primary-button,
.secondary-button {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  font-weight: 700;
  cursor: pointer;
}

.start-button,
.primary-button {
  border: 1px solid rgba(82, 127, 168, .16);
  background: var(--accent-soft);
  color: var(--accent);
}

.start-button {
  margin-top: clamp(26px, 4vw, 34px);
}

.start-button:active,
.primary-button:active,
.secondary-button:active {
  transform: scale(.992);
}

.start-button:disabled {
  opacity: .4;
  cursor: default;
}

/* ==================================================
   TEST: PROGRESS
================================================== */

.progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
}

.progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .24s ease;
}

.progress-label {
  min-width: 55px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  text-align: right;
}

/* ==================================================
   TEST CARD
================================================== */

.test-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}

.test-card {
  width: min(100%, 620px);
  padding: clamp(20px, 4.5vw, 34px);
  transition: min-height .2s ease;
}

.prompt-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: clamp(18px, 4vw, 28px);
  align-items: center;
}

.concept-image-wrap {
  width: 132px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(145deg, #202124, #303236);
}

.concept-image-wrap.is-hidden {
  display: none;
}

.concept-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.prompt-meta {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.prompt-term {
  margin: 0;
  font-size: clamp(1.9rem, 6vw, 3rem);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

.answer-area {
  margin-top: clamp(26px, 4.5vw, 34px);
}

.answer-label,
.solution-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 650;
}

.answer-input {
  width: 100%;
  min-height: 54px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 15px;
  outline: none;
  background: var(--surface-soft-2);
  color: var(--text);
  font-size: 16px;
  line-height: 1.3;
  transition:
    border-color .18s ease,
    background-color .18s ease,
    box-shadow .18s ease;
}

.answer-input:focus {
  border-color: rgba(82, 127, 168, .35);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(82, 127, 168, .08);
}

@media (prefers-color-scheme: dark) {
  .answer-input:focus {
    border-color: rgba(129, 169, 208, .36);
    box-shadow: 0 0 0 4px rgba(129, 169, 208, .08);
  }
}

.reveal-button {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
}

.reveal-button:active {
  transform: scale(.992);
}

.solution-panel {
  display: none;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.solution-panel.is-visible {
  display: block;
}

.own-answer {
  margin: 0 0 20px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.solution-term {
  margin: 0;
  font-size: clamp(1.5rem, 4.5vw, 2.15rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.example {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.5;
}

.rating-controls {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.rating-controls.is-visible {
  display: grid;
}

.rating-button {
  min-height: 50px;
  border: 1px solid var(--border);
  border-radius: 15px;
  font-weight: 700;
  cursor: pointer;
}

.rating-button--wrong {
  background: var(--danger-soft);
  color: var(--danger);
}

.rating-button--correct {
  background: var(--success-soft);
  color: var(--success);
}

/* ==================================================
   RESULT
================================================== */

.result-card {
  width: min(100%, 600px);
  margin: auto;
  padding: clamp(28px, 6vw, 46px);
  text-align: center;
}

.result-eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.result-title {
  margin: 0;
  font-size: clamp(1.9rem, 6vw, 2.8rem);
  letter-spacing: -.05em;
}

.result-score {
  margin: 18px 0 0;
  font-size: clamp(2.9rem, 10vw, 5rem);
  line-height: .95;
  font-weight: 750;
  letter-spacing: -.06em;
}

.result-percent {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 650;
}

.mistakes {
  margin-top: 28px;
  text-align: left;
}

.mistakes h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.mistake-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.mistake-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft-2);
  font-size: .9rem;
  line-height: 1.35;
}

.mistake-item strong {
  font-weight: 700;
}

.result-actions {
  margin-top: 26px;
  display: grid;
  gap: 9px;
}

.secondary-button {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
}

.secondary-button.is-hidden,
.primary-button.is-hidden,
.mistakes.is-hidden {
  display: none;
}

/* ==================================================
   RESPONSIVE
================================================== */

@media (max-width: 620px) {
  .vocab-app {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .setup-card,
  .test-card,
  .result-card {
    border-radius: 26px;
  }

  .prompt-row {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .concept-image-wrap {
    width: 104px;
    border-radius: 18px;
  }

  .prompt-meta {
    margin-top: 1px;
  }
}

@media (max-width: 430px) {
  .app-title h1 {
    font-size: 1.82rem;
  }

  .direction-button {
    min-width: 102px;
    min-height: 42px;
    padding-inline: 10px;
  }

  .direction-flag {
    font-size: 1.12rem;
  }

  .setup-card {
    padding: 20px 16px;
  }

  .block-grid {
    grid-template-columns: 1fr;
  }

  .block-option {
    min-height: 60px;
  }

  .count-options {
    gap: 4px;
  }

  .count-option {
    min-height: 40px;
    padding-inline: 4px;
    font-size: .82rem;
  }

  .test-card {
    padding: 18px 16px 20px;
  }
}

@media (max-height: 700px) and (min-width: 621px) {
  .vocab-app {
    gap: 10px;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .test-card {
    padding-block: 22px;
  }

  .concept-image-wrap {
    width: 112px;
  }

  .prompt-row {
    grid-template-columns: 112px minmax(0, 1fr);
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .vocab-app {
    width: min(100%, 940px);
  }

  .screen--setup {
    justify-content: flex-start;
  }

  .setup-card {
    padding: 18px 22px;
  }

  .section + .section {
    margin-top: 18px;
  }

  .block-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .block-option {
    min-height: 58px;
  }

  .test-card {
    width: min(100%, 760px);
  }

  .prompt-row {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .concept-image-wrap {
    width: 96px;
  }

  .answer-area {
    margin-top: 16px;
  }

  .solution-panel {
    margin-top: 15px;
    padding-top: 15px;
  }
}

/* ==================================================
   ACCESSIBILITY / REDUCED MOTION
================================================== */

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(82, 127, 168, .34);
  outline-offset: 3px;
}

@media (prefers-color-scheme: dark) {
  button:focus-visible,
  input:focus-visible {
    outline-color: rgba(129, 169, 208, .38);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* ==================================================
   COOKIE-BANNER
================================================== */

#cookie-banner {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 9999;
  width: min(calc(100% - 24px), 560px);
  transform: translateX(-50%);
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 40px rgba(20, 25, 35, 0.14);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: #1d1d1f;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "Segoe UI",
    sans-serif;
  display: none;
}

#cookie-banner p {
  margin: 0;
  color: #6e6e73;
  font-size: 0.82rem;
  line-height: 1.5;
}

#cookie-banner a {
  color: inherit !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 13px;
}

.cookie-buttons button {
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

#decline-cookies {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #f2f2f4;
  color: #6e6e73;
}

#accept-cookies {
  border: 1px solid rgba(65, 116, 165, 0.15);
  background: #edf3f8;
  color: #4f7fae;
}

.cookie-buttons button:active {
  transform: scale(0.98);
}

@media (max-width: 480px) {
  #cookie-banner {
    width: calc(100% - 20px);
    padding: 14px;
    border-radius: 16px;
  }

  #cookie-banner p {
    font-size: 0.78rem;
  }

  .cookie-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .cookie-buttons button {
    width: 100%;
    min-height: 40px;
  }
}

@media (prefers-color-scheme: dark) {
  #cookie-banner {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(28, 29, 32, 0.96);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
    color: #f5f5f7;
  }

  #cookie-banner p {
    color: #a1a1a6;
  }

  #decline-cookies {
    border-color: rgba(255, 255, 255, 0.08);
    background: #28292d;
    color: #a9abb1;
  }

  #accept-cookies {
    border-color: rgba(129, 169, 208, 0.16);
    background: #202d39;
    color: #81a9d0;
  }
}


/* ==================================================
   V3: RUHIGERE KONFIGURATION
================================================== */

.screen--setup {
  justify-content: flex-start;
  padding-top: clamp(18px, 4dvh, 42px);
}

.setup-card {
  width: min(100%, 650px);
  margin: 0 auto;
}

.direction-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.direction-label {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.direction-button--setup {
  min-width: 154px;
  min-height: 52px;
  padding-inline: 18px;
  gap: 12px;
  box-shadow: 0 8px 26px rgba(20, 30, 45, 0.07);
}

.direction-button--setup .direction-flag {
  font-size: 1.35rem;
}

.direction-button--setup .direction-arrow {
  font-size: 1.15rem;
  min-width: 24px;
}

.data-status {
  margin: -3px 0 12px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
}

.data-status.is-ready {
  display: none;
}

.data-status.is-error {
  color: var(--danger);
}

.block-option__label small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 550;
}

.block-option {
  min-height: 66px;
  background: transparent;
}

.block-option.is-selected {
  background: var(--accent-soft);
}

.count-option:disabled {
  opacity: .28;
  cursor: default;
}

.start-button {
  margin-top: 24px;
}

@media (max-width: 430px) {
  .direction-section {
    align-items: center;
  }

  .direction-button--setup {
    min-width: 142px;
  }
}


/* ==================================================
   V4: WENIGER INFOTEXT / BESSERE WORTDARSTELLUNG
================================================== */

.block-option__label {
  display: block;
  font-size: 1rem;
  font-weight: 680;
  line-height: 1.22;
}

.block-option__label small {
  display: none !important;
}

.setup-summary[hidden],
.data-status[hidden] {
  display: none !important;
}

.prompt-copy {
  min-width: 0;
}

.prompt-term {
  max-width: 100%;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: auto;
  font-size: clamp(1.65rem, 5.4vw, 2.7rem);
  line-height: 1.02;
}

.test-card.has-no-image .prompt-row {
  grid-template-columns: 1fr;
  gap: 0;
}

.test-card.has-no-image .prompt-copy {
  text-align: left;
}

.test-card.has-no-image .prompt-term {
  max-width: min(100%, 13ch);
}

@media (max-width: 620px) {
  .test-card.has-no-image .prompt-copy {
    text-align: center;
  }

  .test-card.has-no-image .prompt-term {
    max-width: 100%;
  }
}

.section-title {
  line-height: 1.16;
}


/* ==================================================
   V5: MINIMALISTISCHER / LEICHTERE TYPOGRAFIE
================================================== */

.app-title h1 {
  font-weight: 680;
  letter-spacing: -.05em;
}

.app-title p {
  font-weight: 400;
}

.direction-label,
.section-title {
  font-weight: 600;
  letter-spacing: -.018em;
}

.text-button {
  font-weight: 560;
}

.block-option__label {
  font-weight: 560;
}

.count-option {
  font-weight: 560;
}

.count-option.is-selected {
  font-weight: 620;
}

.start-button {
  font-weight: 620;
}

.setup-card {
  padding: clamp(22px, 4.2vw, 34px);
}

.direction-section {
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.section + .section {
  margin-top: clamp(22px, 3.4vw, 28px);
}

.section-heading-row {
  margin-bottom: 11px;
}

.block-option {
  min-height: 62px;
}

.direction-button--setup {
  min-width: 148px;
  min-height: 50px;
  box-shadow: 0 5px 18px rgba(20, 30, 45, 0.05);
}

/* Testkarte ruhiger und besser für lange Begriffe */
.prompt-meta {
  font-weight: 600;
  letter-spacing: .045em;
}

.prompt-term {
  font-size: clamp(1.55rem, 4.7vw, 2.35rem);
  font-weight: 640;
  line-height: 1.06;
  letter-spacing: -.035em;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: manual;
}

.test-card.has-no-image .prompt-term {
  max-width: 100%;
}

.answer-label,
.solution-label {
  font-weight: 560;
}

.solution-term {
  font-weight: 640;
}

.reveal-button,
.rating-button {
  font-weight: 600;
}

@media (max-width: 620px) {
  .prompt-term {
    font-size: clamp(1.5rem, 8vw, 2.15rem);
  }
}


/* ==================================================
   V6: KLARERE LÖSUNG + SELBSTEINSCHÄTZUNG
================================================== */

.answer-area.is-revealed .answer-input {
  background: var(--surface-soft-2);
  opacity: .95;
}

.solution-panel {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.compare-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-soft-2);
}

.compare-card--solution {
  background: var(--accent-soft);
  border-color: rgba(82, 127, 168, .18);
  box-shadow: inset 0 0 0 1px rgba(82, 127, 168, .03);
}

@media (prefers-color-scheme: dark) {
  .compare-card--solution {
    border-color: rgba(129, 169, 208, .18);
  }
}

.compare-card__label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 620;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.compare-card__value {
  margin: 0;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.compare-card--solution .compare-card__value {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 670;
  line-height: 1.08;
  letter-spacing: -.03em;
}

.example {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.5;
}

.self-check-box {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(82, 127, 168, .14);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(82,127,168,.05), rgba(82,127,168,.02));
}

@media (prefers-color-scheme: dark) {
  .self-check-box {
    border-color: rgba(129, 169, 208, .14);
    background: linear-gradient(180deg, rgba(129,169,208,.08), rgba(129,169,208,.03));
  }
}

.self-check-title {
  margin: 0 0 4px;
  font-size: .98rem;
  font-weight: 650;
  letter-spacing: -.02em;
}

.self-check-text {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}

.rating-controls {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.rating-controls.is-visible {
  display: grid;
}

.rating-button {
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 17px;
  font-weight: 640;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.rating-button__main {
  display: block;
  font-size: 1.02rem;
}

.rating-button__sub {
  display: block;
  margin-top: 4px;
  font-size: .76rem;
  font-weight: 560;
  opacity: .82;
}

.rating-button--wrong {
  background: var(--danger-soft);
  color: var(--danger);
}

.rating-button--correct {
  background: var(--success-soft);
  color: var(--success);
}


/* ==================================================
   V7: RUHIGE KORREKTUR / EINMALIGER HINWEIS
================================================== */

.compare-grid {
  gap: 10px;
}

.compare-card {
  padding: 12px 14px;
  border-radius: 16px;
}

.compare-card--solution {
  background: var(--accent-soft);
}

.compare-card__label {
  margin-bottom: 5px;
  font-size: .72rem;
  font-weight: 580;
  letter-spacing: .04em;
}

.compare-card__value {
  font-size: .98rem;
}

.compare-card--solution .compare-card__value {
  font-size: clamp(1.38rem, 3.7vw, 1.85rem);
  font-weight: 640;
}

.example {
  margin-top: 7px;
  font-size: .88rem;
}

.self-check-box {
  position: relative;
  margin-top: 12px;
  padding: 11px 38px 11px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft-2);
}

.self-check-box[hidden] {
  display: none !important;
}

.self-check-title {
  margin: 0 0 2px;
  font-size: .86rem;
  font-weight: 610;
}

.self-check-text {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.4;
}

.self-check-close {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.rating-controls {
  gap: 10px;
  margin-top: 12px;
}

.rating-button {
  min-height: 48px;
  padding: 9px 14px;
  border-radius: 14px;
  font-size: .93rem;
  font-weight: 610;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.rating-button__main,
.rating-button__sub {
  display: contents;
}

/* Bild im Test bewusst klein und dezent */
.prompt-row {
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 20px;
}

.concept-image-wrap {
  width: 104px;
  border-radius: 18px;
}

@media (max-width: 620px) {
  .concept-image-wrap {
    width: 92px;
  }
}


/* ==================================================
   V8: REDUNDANZ ENTFERNT
================================================== */

.compare-grid {
  gap: 0;
}

.solution-panel {
  margin-top: 20px;
  padding-top: 18px;
}

.rating-controls {
  margin-top: 10px;
}


/* ==================================================
   PDF-AKTION
================================================== */

.pdf-button {
  width: 100%;
  min-height: 48px;
  margin-top: 9px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 580;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    background-color .18s ease,
    color .18s ease,
    transform .18s ease;
}

.pdf-button:not(:disabled):hover {
  background: var(--surface-soft-2);
  color: var(--text);
}

.pdf-button:not(:disabled):active {
  transform: scale(.992);
}

.pdf-button:disabled {
  opacity: .35;
  cursor: default;
}

.pdf-status {
  min-height: 1.2em;
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.35;
  text-align: center;
}

.pdf-status.is-error {
  color: var(--danger);
}

/* ==================================================
   MASTER 1.0 – HARDENING
================================================== */

.block-option.is-unavailable {
  opacity: .38;
  cursor: not-allowed;
  background: transparent;
}

.block-option.is-unavailable .block-option__check {
  display: none;
}

.data-status:not([hidden]) {
  display: block;
  margin: 0 0 12px;
}

.data-status.is-warning {
  color: var(--muted);
}

.data-status.is-error {
  color: var(--danger);
}

.pdf-status:empty {
  display: none;
}

.count-option:disabled {
  opacity: .28;
  cursor: default;
}

@media (max-width: 430px) {
  .section-title {
    max-width: 78%;
  }
}

/* ==================================================
   MASTER 1.1
   TEST-RICHTUNG + MOBILE PROMPT
================================================== */

/* Im laufenden Test: Richtungsanzeige dezent oben rechts */
.test-topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 34px;
}

.test-direction-pill {
  min-width: 96px;
  min-height: 34px;

  padding: 5px 10px;

  border: 1px solid var(--border);
  border-radius: 999px;

  background: var(--surface);
  color: var(--text);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  box-shadow: 0 1px 4px rgba(0, 0, 0, .025);

  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.test-direction-pill .direction-flag {
  font-size: 1.04rem;
}

.test-direction-pill .direction-arrow {
  min-width: 17px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
  text-align: center;
}


/* Mobile: Bild + Begriff bleiben wie auf Desktop nebeneinander */
@media (max-width: 620px) {

  .prompt-row {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;

    justify-items: stretch;
    align-items: center;

    text-align: left;
  }

  .prompt-copy {
    min-width: 0;
    text-align: left;
  }

  .concept-image-wrap {
    width: 92px;
    border-radius: 18px;
  }

  .prompt-meta {
    margin-top: 0;
  }

  .prompt-term {
    max-width: 100%;
    text-align: left;
    overflow-wrap: break-word;
  }

  .test-card.has-no-image .prompt-copy {
    text-align: left;
  }

  .test-card.has-no-image .prompt-term {
    max-width: 100%;
  }

  .test-topbar {
    min-height: 32px;
  }

  .test-direction-pill {
    min-width: 90px;
    min-height: 32px;
    padding: 4px 9px;
  }

  .test-direction-pill .direction-flag {
    font-size: 1rem;
  }
}


/* Sehr schmale Smartphones: Bild etwas kleiner, aber weiterhin links */
@media (max-width: 390px) {

  .prompt-row {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 13px;
  }

  .concept-image-wrap {
    width: 78px;
    border-radius: 16px;
  }

  .prompt-term {
    font-size: clamp(1.42rem, 7vw, 1.9rem);
  }
}

/* ==================================================
   MASTER 1.2
   TEST-CARD AUF MOBIL HÖHER POSITIONIEREN
================================================== */

/*
  Desktop bleibt nahezu unverändert.
  Auf schmalen Displays wird die Test-Card nicht mehr
  vertikal in der gesamten Resthöhe zentriert, sondern
  deutlich näher an Fortschritt / Richtungsanzeige gesetzt.
*/
@media (max-width: 620px) {

  .test-stage {
    place-items: start center;

    padding-top:
      clamp(14px, 2.8dvh, 28px);
  }
}


/*
  Bei sehr kleinen Displayhöhen noch kompakter,
  damit oberhalb der Card kein unnötiger Leerraum entsteht.
*/
@media (max-width: 620px) and (max-height: 740px) {

  .test-stage {
    padding-top: 8px;
  }
}

