.quiz-wrap { padding: 24px 0 60px; }
.muted { color: var(--muted, #a8c3cf); }

.card{
  position: relative;
  border: 1px solid var(--border, rgba(0,229,255,.18));
  background: linear-gradient(180deg, rgba(10, 20, 40, .85), rgba(10, 20, 40, .65));
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.02);
  overflow: hidden;
  animation: floatUp .45s ease both;
}
.card::before{
  content:"";
  position:absolute; inset:0;
  border-radius:16px;
  padding:1px;
  background: linear-gradient(120deg, rgba(0,229,255,.35), rgba(103,232,249,.08), transparent 55%);
  -webkit-mask: 
    linear-gradient(#000 0 0) content-box, 
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events:none;
}

.quiz-header h1{
  margin:0 0 6px;
  font-size:26px;
  text-shadow:0 0 14px rgba(0,229,255,.15);
}

.row{
  display:grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap:14px;
  align-items:end;
  margin-bottom: 10px;
}

label{ 
  display:flex; 
  flex-direction:column; 
  gap:6px; 
  font-size:14px; 
}

.chk{ 
  flex-direction:row; 
  align-items:center; 
  gap:10px;
}

select, input[type="text"]{
  appearance:none;
  background: rgba(6,14,28,.85);
  color: var(--text, #e6f7ff);
  border:1px solid var(--border, rgba(0,229,255,.18));
  border-radius:12px;
  padding:10px 12px;
  outline:none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .05s ease;
}
select:focus, input[type="text"]:focus{
  border-color: rgba(0,229,255,.5);
  box-shadow: 0 0 0 2px rgba(0,229,255,.25);
  transform: translateY(-1px);
}

input[type="checkbox"]{
  width:16px; 
  height:16px; 
  accent-color: #67e8f9;
  transform: translateY(1px);
}

.primary, .ghost{
  padding:10px 14px;
  border-radius:12px;
  cursor:pointer;
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.primary{
  border:1px solid var(--border, rgba(0,229,255,.22));
  background: radial-gradient(100% 100% at 50% 0%, rgba(0,229,255,.14), rgba(0,229,255,.08));
  color: var(--text, #e6f7ff);
  box-shadow: 0 8px 24px rgba(0,229,255,.12);
}

.primary:hover{ 
  box-shadow: 0 10px 30px rgba(0,229,255,.22); 
  transform: translateY(-1px); 
}
.primary:active{ 
  transform: translateY(0); 
}

.ghost{
  border:1px dashed var(--border, rgba(0,229,255,.25));
  background: transparent;
  color: #67e8f9;
}
.ghost:hover{ background: rgba(0,229,255,.06); }

.quiz-bar{
  display:flex; 
  justify-content:space-between; 
  align-items:center;
  border:1px dashed var(--border, rgba(0,229,255,.22));
  border-radius:12px; 
  padding:8px 12px; 
  margin-bottom:12px;
  color: var(--muted);
}

.question{ 
  text-align:center; 
}

.badge{
  display:inline-block; 
  padding:4px 10px; 
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(0,229,255,.08);
  font-size:12px; 
  color: var(--muted);
}

.question h2{ 
  margin:8px 0 6px; 
  font-size:28px; 
}

.grid{ 
  display:grid; 
  grid-template-columns: 1fr 1fr; 
  gap:12px; 
  margin: 6px 0 10px; 
}

.feedback{ 
  margin-top:10px; 
  text-align:center; 
  min-height: 28px; 
}

.feedback .ok{ 
  color:#10b981;
} 
.feedback .no{ 
  color:#ef4444; 
} 

.table-wrap{ 
  overflow:auto; 
  border:1px solid var(--border); 
  border-radius:12px; 
}
table{ 
  width:100%; 
  border-collapse:collapse; 
}

th, td{ 
  padding:10px; 
  border-bottom:1px dashed rgba(0,229,255,.2); 
  text-align:left; 
}

thead th{ 
  background: rgba(0,229,255,.08); 
}

.result-actions{ 
  display:flex; 
  gap:10px; 
  justify-content:center; 
  margin-top:12px; 
}

@keyframes floatUp {
  from { opacity:0; transform: translateY(8px); }
  to   { opacity:1; transform: none; }
}

.row > * { opacity:0; animation: floatUp .45s ease both; }
.row > *:nth-child(1){ animation-delay:.04s; }
.row > *:nth-child(2){ animation-delay:.08s; }
.row > *:nth-child(3){ animation-delay:.12s; }
.row > *:nth-child(4){ animation-delay:.16s; }
.row > *:nth-child(5){ animation-delay:.20s; }

.actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.actions button {
  min-width: 90px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease, transform .08s ease;
}

.actions .primary {
  border: 1px solid var(--border, rgba(0,229,255,.22));
  background: linear-gradient(180deg, rgba(0,229,255,.14), rgba(0,229,255,.08));
  color: var(--text, #e6f7ff);
  box-shadow: 0 6px 20px rgba(0,229,255,.15);
}
.actions .primary:hover:not(:disabled) {
  box-shadow: 0 10px 28px rgba(0,229,255,.25);
  transform: translateY(-2px);
}
.actions .primary:active:not(:disabled) {
  transform: translateY(0);
}

.actions .ghost {
  border: 1px dashed var(--border, rgba(0,229,255,.25));
  background: transparent;
  color: #67e8f9;
}
.actions .ghost:hover:not(:disabled) {
  background: rgba(0,229,255,.06);
  transform: translateY(-1px);
}
.actions .ghost:active:not(:disabled) {
  transform: translateY(0);
}

.actions button:disabled {
  opacity: .4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

@media (max-width:560px){
  .actions {
    gap: 10px;
  }
  .actions button {
    flex: 1;
    min-width: auto;
  }
}

@media (max-width: 1100px){
  .row{ grid-template-columns: repeat(3, minmax(180px, 1fr)); }
}
@media (max-width: 820px){
  .row{ grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}
@media (max-width: 560px){
  .row{ grid-template-columns: 1fr; }
  .grid{ grid-template-columns: 1fr; }
  .question h2{ font-size:24px; }
}

.chk {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: var(--text, #e6f7ff);
  font-weight: 500;
}

.chk input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(0,229,255,.6);
  background: rgba(6,14,28,.85);
  position: relative;
  cursor: pointer;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.chk input[type="checkbox"]:hover {
  border-color: rgba(0,229,255,.9);
  box-shadow: 0 0 10px rgba(0,229,255,.4);
}

.chk input[type="checkbox"]::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 12px;
  border-right: 2px solid #00e5ff;
  border-bottom: 2px solid #00e5ff;
  transform: scale(0) rotate(45deg);
  opacity: 0;
  transition: transform .25s ease, opacity .2s ease;
  filter: drop-shadow(0 0 6px rgba(0,229,255,.7));
}

.chk input[type="checkbox"]:checked {
  border-color: #00e5ff;
  box-shadow: 0 0 14px rgba(0,229,255,.5);
}

.chk input[type="checkbox"]:checked::before {
  transform: scale(1) rotate(45deg);
  opacity: 1;
}

.quiz-bar{ 
  display:flex; 
  justify-content:space-between; 
  align-items:center;
  border:1px dashed var(--border, rgba(0,229,255,.22)); 
  border-radius:12px;
  padding:8px 12px; 
  margin-bottom:12px; 
  color:var(--muted);
}

.quiz-bar .right{ 
  display:flex; 
  gap:10px; 
  align-items:center; 
}

.timer-badge{
  display:inline-block; 
  min-width:68px; 
  text-align:center;
  border:1px solid var(--border); 
  border-radius:999px; 
  padding:4px 8px;
  background:rgba(239,68,68,.08); 
  color:#fca5a5; 
  font-weight:600;
}

.timer-badge.safe{ 
  background:rgba(0,229,255,.08); 
  color:#67e8f9; 
}

.progress{ 
  height:8px; 
  border:1px solid var(--border); 
  border-radius:999px; 
  overflow:hidden; 
  margin-bottom:10px; 
}

.progress-bar{ 
  height:100%;
  width:0%; 
  background:linear-gradient(90deg, #00e5ff, #67e8f9); 
  transition: width .35s ease; 
}

.grade{ 
  font-weight:700; 
  margin:-4px 0 10px; 
}

.grade.A{ 
  color:#10b981; 
} 

.grade.B{ 
  color:#22c55e; 
}

.grade.C{ 
  color:#f59e0b; 
} 
.grade.D{
  color:#f97316; 
}

.grade.E{ 
  color:#ef4444; 
}

#formInputs.single {
  display: flex;
  justify-content: center;
}

#formInputs.single label {
  flex: 1;
  max-width: 420px;
}


.leaderboard{ margin-top:14px; }
.leaderboard h3{ margin:8px 0; }
.leaderboard ol{ margin:0; padding-left:20px; }
.leaderboard li{ margin:2px 0; color:var(--muted); }

#confetti{ 
  pointer-events:none; 
  position:fixed; 
  inset:0; 
  overflow:hidden; 
  z-index:999; 
}

.confetti{
  position:absolute; 
  width:8px; 
  height:14px; 
  opacity:.9;
  animation: fall linear forwards;
}

@keyframes fall{
  to{ transform: translateY(110vh) rotate(600deg); opacity: .8; }
}
