:root {
  color-scheme: light;
  --paper: #f7f4ed;
  --surface: #fffdf8;
  --ink: #17332d;
  --muted: #60706b;
  --primary: #0a6753;
  --primary-strong: #074c3e;
  --accent: #e7a62a;
  --accent-soft: #fff1c9;
  --error: #a5322d;
  --error-soft: #fff0ed;
  --success: #176448;
  --success-soft: #e7f5ed;
  --line: #d7ded9;
  --shadow: 0 1rem 2.5rem rgb(23 51 45 / 10%);
  --radius: 1.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgb(231 166 42 / 16%), transparent 34rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

.page-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(0.75rem, 4vw, 1.5rem) 0;
}

/* Standard: Smartphone */
.quiz-container {
  width: 100%;
  padding: 1rem;
}

.app-header {
  margin-bottom: 1.25rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 12vw, 4.75rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.intro {
  max-width: 34rem;
  margin: 0.7rem 0 0;
  color: var(--muted);
}

.card {
  width: 100%;
  padding: clamp(1rem, 4.5vw, 2rem);
  overflow: hidden;
  border: 1px solid rgb(23 51 45 / 9%);
  border-radius: var(--radius);
  background: rgb(255 253 248 / 94%);
  box-shadow: var(--shadow);
}

.progress-row {
  margin-bottom: 1.35rem;
}

.progress-text {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.progress-track {
  width: 100%;
  height: 0.45rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e9e6;
}

.progress-bar {
  display: block;
  width: 12.5%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 280ms ease;
}

.question,
#solution-heading,
#prize-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 7.4vw, 2.35rem);
  line-height: 1.14;
  letter-spacing: -0.025em;
}

.hint {
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.9rem;
  border-left: 0.25rem solid var(--accent);
  border-radius: 0 0.65rem 0.65rem 0;
  background: var(--accent-soft);
  color: #5b4210;
}

.answer-placeholders {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.35rem;
  margin: 1.3rem 0;
}

.answer-character {
  display: inline-grid;
  width: clamp(1.25rem, 7.2vw, 2rem);
  min-width: 0;
  min-height: 2rem;
  place-items: center;
  border-bottom: 0.16rem solid var(--ink);
  font-size: clamp(1rem, 5.5vw, 1.35rem);
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.answer-character--separator {
  width: 0.8rem;
  border: 0;
  font-weight: 500;
}

.answer-character--highlight {
  border-color: var(--accent);
  border-radius: 0.3rem;
  background: var(--accent-soft);
  color: #6c4b0a;
}

form {
  display: grid;
  gap: 0.65rem;
}

label {
  font-weight: 750;
}

input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 0.9rem;
  border: 0.12rem solid var(--line);
  border-radius: 0.8rem;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.22rem rgb(10 103 83 / 16%);
}

input[aria-invalid="true"] {
  border-color: var(--error);
}

.button {
  display: inline-flex;
  width: 100%;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 0.8rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, opacity 140ms ease;
}

.button:active:not(:disabled) {
  transform: translateY(0.1rem);
}

.button:focus-visible,
.letter-card:focus-visible,
.text-link:focus-visible {
  outline: 0.2rem solid var(--accent);
  outline-offset: 0.2rem;
}

.button--primary {
  background: var(--primary);
  color: #fff;
}

.button--primary:hover:not(:disabled) {
  background: var(--primary-strong);
}

.button--secondary {
  background: #dfe9e5;
  color: var(--ink);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.feedback {
  min-height: 1.55rem;
  margin: 0;
  font-weight: 700;
}

.feedback--error {
  color: var(--error);
}

.feedback--success {
  color: var(--success);
}

.notice {
  margin-bottom: 1rem;
  padding: 0.9rem;
  border-radius: 0.8rem;
}

.notice--error {
  border: 1px solid #efb9b5;
  background: var(--error-soft);
  color: var(--error);
}

.instruction {
  margin: 0.75rem 0 1.2rem;
  color: var(--muted);
}

.solution-letters {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.45rem, 2.5vw, 0.7rem);
  margin: 1.25rem 0;
}

.letter-card {
  display: inline-grid;
  width: clamp(2.75rem, 14vw, 3.6rem);
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  place-items: center;
  border: 0.12rem solid var(--line);
  border-radius: 0.75rem;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 0.25rem 0 rgb(23 51 45 / 10%);
  font-size: clamp(1.15rem, 6vw, 1.45rem);
  font-weight: 900;
  cursor: pointer;
  user-select: none;
}

.letter-card[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  transform: translateY(-0.14rem);
}

.letter-card--fixed,
.letter-card--fixed:hover {
  border-color: #dca11f;
  background: var(--accent-soft);
  color: #654807;
  box-shadow: inset 0 0 0 0.12rem #fff, 0 0.2rem 0 rgb(108 75 10 / 16%);
  cursor: not-allowed;
}

.help-panel {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.help-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.8rem;
}

.help-copy h3,
.help-copy p {
  margin: 0;
}

.help-copy p {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.countdown {
  width: 9.8rem;
  margin: 0;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.prize-card {
  text-align: left;
}

.prize-card > * + * {
  margin-top: 0.85rem;
}

.prize-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 22rem;
  margin: 0 0 1.25rem;
  border-radius: 0.9rem;
  object-fit: cover;
}

.prize-description {
  padding: 1rem;
  border-radius: 0.8rem;
  background: var(--accent-soft);
  color: #5b4210;
  font-weight: 800;
}

.voucher {
  padding: 0.85rem;
  border: 1px dashed var(--primary);
  border-radius: 0.7rem;
  background: var(--success-soft);
}

.text-link {
  display: inline-block;
  max-width: 100%;
  color: var(--primary);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.confetti-layer {
  position: fixed;
  z-index: 9999;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  display: block;
  top: -2rem;
  width: 0.55rem;
  height: 0.85rem;
  border-radius: 0.1rem;
  box-shadow: 0 0.1rem 0.2rem rgb(23 51 45 / 18%);
  animation: confetti-fall var(--fall-duration, 2.4s) cubic-bezier(0.18, 0.7, 0.32, 1) forwards;
  will-change: transform, opacity;
}

.confetti-layer--reduced {
  display: grid;
  place-items: center;
}

.confetti-success {
  padding: 0.8rem 1.1rem;
  border: 0.14rem solid #fff;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0.75rem 2rem rgb(23 51 45 / 24%);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translate3d(0, -2vh, 0) rotate(0deg);
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 0), 105vh, 0) rotate(var(--spin, 540deg));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

}

/* Ab Tablet-Grösse */
@media (min-width: 768px) {
  .page-shell {
    padding-block: 3rem;
  }

  .quiz-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem;
  }

  .app-header {
    margin-bottom: 1.75rem;
  }

  .card {
    padding: 2.25rem;
  }

  form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  form label,
  form .feedback {
    grid-column: 1 / -1;
  }

  form .button {
    width: auto;
    min-width: 11rem;
  }

  .help-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .help-copy {
    grid-column: 1 / -1;
  }

  .help-panel .button {
    width: auto;
  }
}
