:root {
  --bg: #0f1220;
  --card: #171a2b;
  --text: #e9ecff;
  --muted: #aab0d6;
  --border: rgba(255,255,255,0.10);

  --good: #2ecc71;
  --bad: #ff5c5c;

  --btn: #2b3152;
  --btn2: #3a4280;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  background-image:
    radial-gradient(1200px 800px at 20% 10%, #1b2250, transparent),
    radial-gradient(1200px 800px at 90% 30%, #3a1b4f, transparent),
    linear-gradient(#0f1220, #0f1220);

  background-repeat: no-repeat;
  background-size: 1400px 900px, 1400px 900px, cover;
  background-position: 0 0, 100% 0, 0 0;

  background-color: #0f1220;
  color: var(--text);
}

html { 
  -webkit-text-size-adjust: 100%; 
}

.app {
  max-width: 860px;
  margin: 24px auto;
  padding: 0 12px 28px;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.title { margin: 0; font-size: 20px; }
.stats { color: var(--muted); font-size: 14px; }

.card {
  background: rgba(23,26,43,0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.hidden { display: none !important; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

label { color: var(--muted); }

select {
  min-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #0f1220;
  border: 1px solid var(--border);
  color: var(--text);
}

.hint { color: var(--muted); }
.set-description {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.question {
  display: grid;
  gap: 10px;
}

.question .media {
  order: 1;
  display: flex;
  justify-content: center;
}

.question .q-text {
  order: 2;
  font-size: 18px;
  line-height: 1.35;
  text-align: center;
}

.q-text {
  font-size: 18px;
  line-height: 1.35;
}

.media {
  max-width: 100%;
  display: flex;
  justify-content: center;
}

.media img {
  max-width: 340px;
  max-height: 410px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
}

.answers {
  display: grid;
  gap: 10px;
  margin: 14px 0 8px;
}

.answer {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;

  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15,18,32,0.65);
}


.answer:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.18); }
.answer:active { transform: translateY(0px); }

.answer.disabled {
  opacity: 0.95;
  cursor: default;
  pointer-events: none;
}

.answer.correct {
  border-color: rgba(46, 204, 113, 0.8);
  background: rgba(46, 204, 113, 0.15);
}

.answer.wrong {
  border-color: rgba(255, 92, 92, 0.85);
  background: rgba(255, 92, 92, 0.14);
}

.a-text { font-size: 16px; }
.a-text.muted { color: var(--muted); font-style: italic; }

.thumb {
  width: 123px;
  height: 102px;
  max-width: 160px;
  max-height: 160px;

  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);

  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}


.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--btn);
  color: var(--text);
  cursor: pointer;
}
.btn:hover { background: var(--btn2); }
.btn.primary { background: #3b5bff; border-color: rgba(59,91,255,0.5); }
.btn.primary:hover { background: #2f4cff; }
.btn.warning { background: #ffb020; border-color: rgba(255,176,32,0.5); color: #141414; }
.btn.warning:hover { background: #ffa000; }
.btn.ghost { background: transparent; }

.message {
  margin-top: 8px;
  color: var(--muted);
  min-height: 20px;
}

@media (max-width: 600px) {
  /* Layout stránky */
  .app { margin: 14px auto; padding: 0 10px 22px; }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 12px;
  }
  .title { font-size: 18px; }
  .stats { font-size: 13px; }

  .card {
    padding: 12px;
    border-radius: 14px;
  }

  /* Výběr sady: vše pod sebe */
  .row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  select { min-width: 0; width: 100%; }

  /* Tlačítka: na mobilu přes celou šířku */
  .actions {
    flex-direction: column;
    gap: 10px;
  }
  .btn {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
  }

  /* Otázka: obrázek ne moc vysoký */
  .question { gap: 10px; }
  .question .q-text { font-size: 16px; line-height: 1.35; }

  .media img {
    max-width: 100%;
    max-height: 220px;   /* ⬅ klíčové pro mobil */
    width: auto;
    height: auto;
    object-fit: contain;
  }

  /* Odpovědi: zvětšit klikací plochu, lepší rozložení */
  .answers { gap: 10px; }

  .answer {
    grid-template-columns: 90px 1fr; /* thumb vedle textu */
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
  }

  /* U dlouhých textů zabránit „přetečení“ */
  .a-text {
    font-size: 15px;
    line-height: 1.25;
    word-break: break-word;
  }

  /* Náhledy na mobilu trochu menší a konzistentní */
  .thumb {
    width: 90px;
    height: 72px;
    max-width: 90px;
    max-height: 72px;
    border-radius: 12px;
  }
  .thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

@media (max-width: 380px) {
  .answer {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .thumb {
    margin: 0 auto;
    width: 120px;
    height: 90px;
    max-width: 120px;
    max-height: 90px;
  }
}

.answer > * { min-width: 0; }
