* { box-sizing: border-box; }
body {
  margin: 0;
  background: #10151f;
  color: #f3f5fa;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}
.container { width: min(1400px, 96%); margin: 0 auto; padding: 24px 0 40px; }
h1 { line-height: 1.15; margin-bottom: 12px; }
h2 { margin-top: 28px; }
.panel {
  margin: 22px 0;
  padding: 22px;
  background: #1a2230;
  border: 1px solid #2c374a;
  border-radius: 16px;
}
label, select { display: block; }
select {
  width: 100%; max-width: 280px; margin: 8px 0 18px; padding: 12px;
  color: #f3f5fa; background: #10151f; border: 1px solid #47546a; border-radius: 8px;
}
button, .button-link {
  display: inline-block; border: 0; border-radius: 9px; padding: 12px 20px;
  background: #7c5cff; color: white; font-size: 1rem; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
button:disabled { opacity: .45; cursor: not-allowed; }
.error { color: #ff9d9d; }
.hint { color: #c7d0df; }
code, pre { background: #10151f; border-radius: 6px; }
code { padding: 2px 5px; }
pre { padding: 14px; overflow-x: auto; }
.progress { color: #b6a8ff; font-weight: 700; }
.images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 22px 0; }
.image-option, .review-images > div {
  min-width: 0; padding: 12px; border: 2px solid #344157; border-radius: 12px;
  background: #1a2230; cursor: pointer;
}
.image-option:has(input:checked) { border-color: #9b87ff; }
.image-option input { margin: 0 0 10px; }
.option-title { display: block; font-weight: 700; margin-bottom: 10px; }
.images img { display: block; width: 100%; height: min(65vh, 680px); min-height: 380px; object-fit: contain; background: #0a0d13; border-radius: 8px; }
.review-images img { height: min(48vh, 520px); min-height: 260px; }
.result { text-align: center; }
.score { font-size: 2.5rem; font-weight: 800; margin: 0; }
@media (max-width: 650px) {
  .images { grid-template-columns: 1fr; }
  .images img { height: 52vh; min-height: 300px; }
  .review-images img { height: 38vh; min-height: 240px; }
  .panel { padding: 16px; }
}

/* Всплывающее предисловие на главной странице */
.intro-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center;
  justify-content: center; padding: 20px; background: rgba(3, 7, 14, .82);
}
.intro-modal {
  position: relative; width: min(620px, 100%); padding: 30px; background: #1a2230;
  border: 1px solid #47546a; border-radius: 18px; box-shadow: 0 20px 70px rgba(0,0,0,.45);
}
.intro-modal h2 { margin: 0 38px 16px 0; font-size: 1.7rem; }
.intro-modal p { color: #e0e6f0; }
.intro-modal .intro-note { color: #b6a8ff; }
.intro-close {
  position: absolute; top: 12px; right: 14px; padding: 2px 10px;
  background: transparent; color: #c7d0df; font-size: 1.8rem;
}
.intro-start { margin-top: 8px; }
.intro-hidden { display: none; }
@media (max-width: 650px) { .intro-modal { padding: 24px 20px; } }

/* Памятка по распознаванию изображений */
.tips-panel h2 { margin-top: 0; }
.tips-panel > p { color: #c7d0df; }
.tips-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px;
}
.tip-card {
  padding: 16px; border: 1px solid #344157; border-radius: 12px; background: #141c29;
}
.tip-card h3 { margin: 0 0 8px; color: #c6baff; font-size: 1.05rem; }
.tip-card p { margin: 0; color: #e0e6f0; }
.tips-panel .tips-warning {
  margin: 18px 0 0; padding: 13px 15px; border-left: 3px solid #9b87ff;
  border-radius: 6px; background: #141c29; color: #e0e6f0;
}
@media (max-width: 650px) {
  .tips-grid { grid-template-columns: 1fr; }
}

/* Разбор каждой пары на странице результата */
.pair-review-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pair-review-heading h3 { margin: 0; }
.answer-status { display: inline-block; padding: 6px 10px; border-radius: 999px; font-size: .9rem; font-weight: 700; }
.answer-correct { background: #173d2d; color: #9ae6b4; }
.answer-wrong { background: #4a2429; color: #feb2b2; }
.explanation-box { margin-top: 18px; padding: 15px 17px; border-left: 3px solid #9b87ff; border-radius: 8px; background: #141c29; }
.explanation-box h4 { margin: 0 0 7px; color: #c6baff; }
.explanation-box p { margin: 0; line-height: 1.55; }
