*{
  box-sizing:border-box;
}
html{
  min-height:100%;
}
body{
  margin:0;
  min-height:100%;
  font-family:Arial,sans-serif;
  color:#172033;
}
.quizBody{
  min-height:100vh;
  background:#eef2f4;
}
.quizGameHeader{
  position:sticky;
  top:0;
  z-index:20;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
  width:min(940px,100%);
  min-height:64px;
  margin:0 auto;
  padding:10px 18px;
  background:#061013;
  color:#fff;
  box-shadow:0 12px 30px rgba(6,16,19,.24);
}
.quizHeaderLeft{
  position:relative;
  display:flex;
  align-items:center;
  gap:8px;
}
.quizGameHeader .quizGameScore{
  grid-column:3;
}
.quizRoundBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:48px;
  height:48px;
  border:1px solid rgba(255,255,255,.22);
  border-radius:50%;
  background:rgba(255,255,255,.14);
  color:#fff;
  text-decoration:none;
  font-size:0;
  font-weight:bold;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 8px 18px rgba(0,0,0,.16);
}
.quizRoundBtn::before{
  content:"↩";
  font-size:28px;
  line-height:1;
  transform:translateX(-1px);
}
.quizRoundBtn:hover,
.quizRoundBtn:focus{
  background:rgba(255,255,255,.22);
  outline:none;
}
.quizLevelMenu{
  position:relative;
}
.quizLevelMenu summary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  border:1px solid rgba(255,255,255,.26);
  border-radius:50%;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-size:17px;
  font-weight:bold;
  cursor:pointer;
  list-style:none;
}
.quizLevelMenu summary::-webkit-details-marker{
  display:none;
}
.quizLevelPanel{
  position:absolute;
  top:50px;
  left:0;
  z-index:40;
  display:grid;
  gap:8px;
  min-width:170px;
  padding:12px;
  border:1px solid rgba(203,213,225,.8);
  border-radius:10px;
  background:rgba(255,255,255,.96);
  box-shadow:0 18px 44px rgba(15,23,42,.22);
}
.quizLevelPanel strong{
  color:#172033;
  font-size:15px;
}
.quizLevelPanel a{
  display:flex;
  align-items:center;
  min-height:36px;
  padding:8px 10px;
  border-radius:8px;
  background:#e8f2f5;
  color:#275f73;
  text-decoration:none;
  font-weight:bold;
}
.quizGameTitle{
  justify-self:center;
  color:#fff;
  font-size:24px;
  font-weight:bold;
  line-height:1.2;
  white-space:nowrap;
}
.quizGameScore{
  color:#fff;
  font-size:23px;
  line-height:1.2;
  white-space:nowrap;
}
.quizGameScore b{
  font-weight:normal;
}
.quizShell{
  width:min(940px,100%);
  margin:0 auto;
  min-height:calc(100vh - 64px);
  padding:16px 16px 90px;
}
.quizStats{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin:0 0 14px;
}
.quizStat{
  min-height:58px;
  padding:9px 10px;
  border:1px solid rgba(203,213,225,.86);
  border-radius:9px;
  background:#fff;
  box-shadow:0 6px 16px rgba(31,41,55,.04);
}
.quizStat small{
  display:block;
  margin-bottom:3px;
  color:#64748b;
  font-size:12px;
  font-weight:bold;
}
.quizStat strong{
  color:#12315f;
  font-size:18px;
  line-height:1.2;
}
.questionCard{
  padding:22px;
  border:1px solid rgba(203,213,225,.86);
  border-radius:14px;
  background:#fff;
  box-shadow:0 18px 44px rgba(31,41,55,.1);
}
.questionNumber{
  display:inline-flex;
  align-items:center;
  min-height:31px;
  padding:5px 11px;
  border-radius:999px;
  background:#e8f2f5;
  color:#275f73;
  font-size:13px;
  font-weight:bold;
  margin-bottom:14px;
}
.questionTimer{
  float:right;
  display:inline-flex;
  align-items:center;
  min-height:31px;
  padding:5px 11px;
  border-radius:999px;
  background:#f8fafc;
  color:#334155;
  border:1px solid #e2e8f0;
  font-size:13px;
  font-weight:bold;
}
.questionTimer.warning{
  background:#fff7ed;
  border-color:#fed7aa;
  color:#9a3412;
}
.questionText{
  clear:both;
  margin:0 0 18px;
  color:#172033;
  font-size:24px;
  line-height:1.36;
  font-weight:bold;
}
.answerGrid{
  display:grid;
  gap:14px;
  margin-top:16px;
}
.answerBtn{
  width:100%;
  min-height:58px;
  padding:14px 16px;
  border:1px solid #cfd8de;
  border-radius:12px;
  background:#ffffff;
  color:#172033;
  font-size:16px;
  line-height:1.35;
  text-align:left;
  cursor:pointer;
  box-shadow:0 4px 12px rgba(31,41,55,.04);
  transition:border-color .15s ease,background-color .15s ease,transform .15s ease;
}
.answerBtn:hover,
.answerBtn:focus{
  border-color:#275f73;
  background:#f2f7f9;
  outline:none;
}
.answerBtn:hover{
  transform:translateY(-1px);
}
.answerBtn.selected{
  border-color:#275f73;
  background:#e8f2f5;
}
.answerBtn.correct{
  border-color:#15803d;
  background:#dcfce7;
}
.answerBtn.wrong{
  border-color:#b91c1c;
  background:#fee2e2;
}
.answerBtn:disabled{
  cursor:default;
  transform:none;
}
.answerFeedback{
  display:none;
  margin-top:14px;
  padding:12px 14px;
  border-radius:10px;
  font-weight:bold;
  line-height:1.45;
}
.answerFeedback.correct,
.answerFeedback.wrong{
  display:block;
}
.answerFeedback.correct{
  background:#dcfce7;
  color:#14532d;
  border:1px solid #86efac;
}
.answerFeedback.wrong{
  background:#fee2e2;
  color:#7f1d1d;
  border:1px solid #fecaca;
}
.quizActions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin:20px 0 0;
  padding:16px 0 4px;
  border-top:1px solid rgba(203,213,225,.72);
}
.quizBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  min-width:170px;
  padding:10px 18px;
  border:1px solid #275f73;
  border-radius:9px;
  background:#275f73;
  color:#fff;
  font-weight:bold;
  text-decoration:none;
  cursor:pointer;
}
.quizBtn.secondary{
  background:#fff;
  color:#275f73;
}
.quizBtn:hover,
.quizBtn:focus{
  outline:none;
  box-shadow:0 0 0 3px rgba(39,95,115,.16);
}
.quizBtn:disabled{
  opacity:.55;
  cursor:default;
  box-shadow:none;
}
.resultPanel{
  display:none;
  margin-top:18px;
  margin-bottom:50px;
  padding:22px;
  border:1px solid rgba(203,213,225,.86);
  border-radius:14px;
  background:#fff;
  box-shadow:0 18px 44px rgba(31,41,55,.09);
}
.resultPanel.active{
  display:block;
}
.resultPanel.pass{
  border-left:6px solid #15803d;
}
.resultPanel.fail{
  border-left:6px solid #b91c1c;
}
.resultPanel h2{
  margin:0 0 8px;
  color:#172033;
}
.resultPanel p{
  margin:6px 0;
  line-height:1.5;
}
.resultActions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
}
.quizRuleInfo{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
  margin:16px 0 0;
  color:#64748b;
  font-size:13px;
}
.quizRuleInfo span{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:5px 10px;
  border:1px solid rgba(203,213,225,.82);
  border-radius:999px;
  background:#fff;
}
.quizRuleInfo b{
  margin-left:4px;
  color:#172033;
}

@media (max-width: 720px){
  .quizGameHeader{
    grid-template-columns:auto minmax(0,1fr) auto;
    gap:10px;
    min-height:58px;
    padding:7px 10px;
  }
  .quizRoundBtn{
    width:44px;
    height:44px;
  }
  .quizLevelMenu summary{
    width:40px;
    height:40px;
  }
  .quizGameTitle{
    font-size:20px;
  }
  .quizGameScore{
    font-size:18px;
  }
  .quizShell{
    padding:12px 10px 72px;
  }
  .quizStats{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:6px;
  }
  .quizStat{
    min-height:52px;
    padding:7px 6px;
  }
  .quizStat small{
    font-size:10px;
  }
  .quizStat strong{
    font-size:15px;
  }
  .questionCard,
  .resultPanel{
    padding:17px;
    border-radius:11px;
  }
  .questionText{
    font-size:20px;
  }
  .quizActions{
    display:block;
    padding-top:14px;
  }
  .quizBtn{
    width:100%;
  }
}

@media (max-width: 480px){
  .quizStats{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .questionText{
    font-size:19px;
  }
}
