:root {
  color-scheme: light;
  --ink: #1f2937;
  --muted: #667085;
  --line: #dfe5ec;
  --accent: #176b4d;
  --accent-dark: #0e5038;
  --paper: #ffffff;
  --page: #eef3f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.quiz-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.quiz-card {
  width: min(100%, 720px);
  padding: clamp(22px, 5vw, 44px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(31, 41, 55, .09);
}

.quiz-header { margin-bottom: 26px; }
.eyebrow { margin: 0 0 4px; color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { margin: 0; line-height: 1.15; }
h1 { font-size: clamp(2rem, 6vw, 3.3rem); }
h2 { font-size: clamp(1.7rem, 5vw, 2.5rem); }
.intro { margin: 12px 0 0; color: var(--muted); }

.status-row { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 14px; color: var(--muted); font-size: .92rem; font-weight: 700; }
.image-frame { display: grid; min-height: 330px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.image-frame img {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  /* Zamienia zdjęcie z jasnym tłem w jednolitą czarną sylwetkę liścia. */
  filter: grayscale(1) contrast(1000%);
}
.image-frame img.is-color { filter: none; }
.image-frame + .answer-form { margin-top: 22px; }
.photo-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 12px 0 6px; color: var(--muted); font-size: .9rem; font-weight: 700; }
.photo-button { min-width: 42px; padding: 6px 12px; color: var(--accent); background: #e8f2ed; font-size: 1.2rem; line-height: 1; }
.photo-button:hover { background: #d9eae1; }
.color-toggle { padding: 7px 12px; color: var(--accent); background: #e8f2ed; font-size: .84rem; }
.color-toggle:hover { background: #d9eae1; }

.answer-form label { display: block; margin-bottom: 8px; font-weight: 750; }
.answer-controls { display: flex; gap: 10px; }
input, button { font: inherit; }
input { min-width: 0; flex: 1; padding: 12px 14px; border: 1px solid #c8d0d9; border-radius: 10px; color: var(--ink); background: #fff; }
input:focus { outline: 3px solid rgba(23, 107, 77, .18); border-color: var(--accent); }
button { padding: 12px 18px; border: 0; border-radius: 10px; color: #fff; background: var(--accent); cursor: pointer; font-weight: 750; }
button:hover { background: var(--accent-dark); }
button:disabled { cursor: default; opacity: .65; }
.secondary-button { margin-top: 16px; color: var(--accent); background: #e8f2ed; }
.secondary-button:hover { background: #d9eae1; }

.feedback { min-height: 28px; margin-top: 16px; font-weight: 750; }
.feedback.correct { color: #14734a; }
.feedback.wrong { color: #b42318; }
.hint { margin: 4px 0 0; padding: 12px 14px; border-left: 4px solid #d8a12b; border-radius: 8px; color: #604814; background: #fff8e7; }
.summary { padding-top: 12px; text-align: center; }
.summary h2 { margin-top: 10px; }
.summary p:not(.eyebrow) { color: var(--muted); }
noscript { display: block; margin-top: 20px; color: #b42318; }

@media (max-width: 520px) {
  .quiz-shell { padding: 12px; }
  .quiz-card { border-radius: 16px; }
  .image-frame { min-height: 250px; }
  .answer-controls { flex-direction: column; }
  .answer-controls button { width: 100%; }
}
