
 :root{
  --bg: #050505;
  --panel: rgba(10,10,10,.92);
  --panel2: #101010;
  --text: #f2f2f2;
  --muted: #b9b9b9;
  --border: #2a2a2a;

  --red: #ff3b3b;
  --red2:#ff0000;

  --good:#21c45a;
  --bad:#ff3b3b;
  --neutral:#6c6c6c;

  --shadow: 0 0 18px rgba(0,0,0,.65);
  --shadowRed: 0 0 18px rgba(255, 0, 0, 0.55);
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display:block;
  /* justify-self:center; */
  padding: 18px;
  background-image: radial-gradient(circle at 1px 1px, #141414 1px, transparent 0);
  background-size: 40px 40px;
}

.app{
  width: 100%;
  margin: 30px auto;
  max-width: 980px;
  display:flex;
  flex-direction:column;
  /* justify-content: center; */
  gap: 14px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.brand__title{
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--red);
  text-shadow: 0 0 12px rgba(255,0,0,.7);
  font-size: 16px;
}
.brand__sub{
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.topbar__right{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.timer{
  display:flex;
  align-items:baseline;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0e0e0e;
}
.timer__label{
  font-size: 12px;
  color: var(--muted);
}
.timer__value{
  font-weight: 800;
  letter-spacing: .06em;
  color: #fff;
}
.timer--warn .timer__value{
  color: #ffd166;
}
.timer--danger .timer__value{
  color: var(--red);
  text-shadow: 0 0 10px rgba(255,0,0,.7);
}

.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px;
  backdrop-filter: blur(6px);
}

.progress{
  display:flex;
  gap: 12px;
  align-items:center;
  justify-content:space-between;
  padding: 6px 4px 12px;
}
.progress__left{
  font-size: 13px;
  color: var(--muted);
}
.progress__bar{
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #141414;
  border: 1px solid var(--border);
  overflow:hidden;
  max-width: 420px;
}
.progress__fill{
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, var(--red), var(--red2));
  box-shadow: var(--shadowRed);
}

.questionArea{
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.qTitle{
  margin: 0 0 12px 0;
  font-size: 18px;
  line-height: 1.25;
}
.qImage{
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 14px;
  margin: 10px 0 12px;
  border: 1px solid #1f1f1f;
  background: #0b0b0b;
}

.answers{
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.answer{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #222;
  background: #141414;
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.answer:hover{
  transform: translateY(-1px);
  border-color: rgba(255,0,0,.45);
  box-shadow: 0 0 12px rgba(255,0,0,.25);
}
.answer__radio{
  margin-top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid #7a7a7a;
  flex: 0 0 auto;
}
.answer--selected{
  background: radial-gradient(circle at top left, rgba(255, 0, 0, 0.35), #171717);
  border-color: rgba(255,0,0,.6);
  box-shadow: 0 0 14px rgba(255,0,0,.35);
}
.answer--selected .answer__radio{
  border-color: var(--red);
  background: radial-gradient(circle, var(--red) 40%, transparent 41%);
}

.answer--locked{
  cursor: default;
  opacity: .98;
}
.answer--correct{
  border-color: rgba(33, 196, 90, .8);
  box-shadow: 0 0 14px rgba(33, 196, 90, .35);
}
.answer--correct .answer__radio{
  border-color: var(--good);
  background: radial-gradient(circle, var(--good) 40%, transparent 41%);
}
.answer--wrong{
  border-color: rgba(255,0,0,.75);
  box-shadow: 0 0 14px rgba(255,0,0,.35);
}

.explain{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed #3a3a3a;
  color: #d6d06a;
  background: #0e0e0e;
}

.nav{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  padding-top: 12px;
  flex-wrap:wrap;
}
.nav__hint{
  color: var(--muted);
  font-size: 12px;
  display:flex;
  align-items:center;
  gap: 6px;
}
.kbd{
  border: 1px solid #2c2c2c;
  background: #101010;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 12px;
  color: #e9e9e9;
}

.btn{
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor:pointer;
  transition: transform .12s ease, filter .12s ease, box-shadow .2s ease, opacity .2s ease;
  color: #fff;
  white-space: nowrap;
}
.btn:active{ transform: translateY(1px); }
.btn[disabled]{ opacity:.55; cursor:not-allowed; }

.btn--primary{
  background: linear-gradient(135deg, var(--red), var(--red2));
  box-shadow: 0 0 18px rgba(255,0,0,.55);
}
.btn--primary:hover{ filter: brightness(1.07); }

.btn--danger{
  background: linear-gradient(135deg, #ff3b3b, #b80000);
  box-shadow: 0 0 18px rgba(255,0,0,.55);
}
.btn--ghost{
  background: #111;
  border: 1px solid #2a2a2a;
  box-shadow: 0 0 10px rgba(0,0,0,.5);
}
.btn--ghost:hover{
  border-color: rgba(255,0,0,.45);
  box-shadow: 0 0 14px rgba(255,0,0,.22);
}

.resultArea{
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0f0f0f;
}
.resultArea__title{
  font-weight: 900;
  color: var(--red);
  text-shadow: 0 0 10px rgba(255,0,0,.6);
}
.resultArea__text{
  margin-top: 6px;
  color: var(--muted);
}
.modal[hidden] {
  display: none !important;
}
.modal{
  position: fixed;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 50;
}
.modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.65);
}
.modal__panel{
  position: relative;
  width: min(720px, 92vw);
  max-height: 86vh;
  overflow:hidden;
  background: rgba(10,10,10,.96);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
}
.modal__header, .modal__footer{
  padding: 12px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  border-bottom: 1px solid #1f1f1f;
}
.modal__footer{
  border-bottom:none;
  border-top: 1px solid #1f1f1f;
}
.modal__title{
  font-weight: 900;
  color: var(--red);
}
.modal__subtitle{
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.overviewGrid{
  padding: 12px;
  overflow:auto;
  display:grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}
.overviewItem{
  border-radius: 14px;
  padding: 10px 0;
  border: 1px solid #2a2a2a;
  background: #121212;
  color: #fff;
  font-weight: 800;
  cursor:pointer;
}
.overviewItem--unanswered{
  background: #141414;
  border-color: #2a2a2a;
  color: #cfcfcf;
}
.overviewItem--answered{
  background: rgba(33,196,90,.18);
  border-color: rgba(33,196,90,.6);
}
.overviewItem--wrong{
  background: rgba(255,0,0,.18);
  border-color: rgba(255,0,0,.6);
}
.overviewItem--correct{
  background: rgba(33,196,90,.22);
  border-color: rgba(33,196,90,.75);
}

.legend{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap:wrap;
  color: var(--muted);
  font-size: 12px;
}
.dot{
  width: 10px; height:10px; border-radius:999px; display:inline-block;
  margin-right: 4px;
  border: 1px solid #333;
}
.dot--answered{ background: rgba(33,196,90,.55); border-color: rgba(33,196,90,.9); }
.dot--unanswered{ background: #2a2a2a; border-color: #3a3a3a; }
.dot--wrong{ background: rgba(255,0,0,.55); border-color: rgba(255,0,0,.9); }
.dot--correct{ background: rgba(33,196,90,.65); border-color: rgba(33,196,90,.95); }

@media (max-width: 640px){
  body{ padding: 10px; }
  .topbar{ align-items:flex-start; }
  .topbar__right{ justify-content:flex-start; }
  .progress{ flex-direction:column; align-items:stretch; gap: 8px; }
  .progress__bar{ max-width: 100%;}
  .progress__fill{height: 2px;}
  .overviewGrid{ grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .btn{ padding: 10px 12px; }
  .qTitle{ font-size: 17px; }
}