:root {
  --bg: #0f172a;
  --bg2: #1e293b;
  --card: #1e293b;
  --card-border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #6366f1;
  --primary-2: #4f46e5;
  --good: #22c55e;
  --good-bg: #14532d;
  --bad: #ef4444;
  --bad-bg: #4c1d1d;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--card-border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px; }
.brand .logo { font-size: 22px; }
.score-pill {
  background: var(--primary-2); color: white;
  padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px;
}

main { max-width: 720px; margin: 0 auto; padding: 20px 16px 40px; }
.screen { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hidden { display: none !important; }

h1 { font-size: 26px; margin: 8px 0 4px; }
.sub { color: var(--muted); margin: 0 0 18px; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }

.select {
  width: 100%; padding: 12px; border-radius: 10px;
  background: #0b1120; color: var(--text);
  border: 1px solid var(--card-border); font-size: 15px;
}
.check { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin-top: 6px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 14px; border-radius: 999px; cursor: pointer;
  background: #0b1120; border: 1px solid var(--card-border); color: var(--text);
  font-size: 14px; transition: .15s;
}
.chip.active { background: var(--primary-2); border-color: var(--primary); color: #fff; font-weight: 600; }

.pool-info { color: var(--muted); font-size: 14px; margin: 6px 2px 16px; }

.btn {
  border: none; border-radius: 12px; padding: 13px 18px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: .15s; color: var(--text);
}
.btn.primary { background: var(--primary-2); color: #fff; }
.btn.primary:hover { background: var(--primary); }
.btn.primary:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: transparent; border: 1px solid var(--card-border); color: var(--muted); }
.btn.big { width: 100%; padding: 16px; font-size: 17px; }

.progress { height: 6px; background: #0b1120; border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #22d3ee); transition: width .3s; }

.q-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.tag { background: #0b1120; border: 1px solid var(--card-border); padding: 4px 10px; border-radius: 999px; font-size: 12px; }

.jump { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.jump-label { white-space: nowrap; }
.jump input {
  width: 72px; padding: 8px 10px; border-radius: 8px;
  background: #0b1120; color: var(--text); border: 1px solid var(--card-border); font-size: 14px;
}
.jump-total { white-space: nowrap; }
.btn.jump-go { padding: 8px 14px; font-size: 14px; flex: 0 0 auto; }
.question { font-size: 21px; line-height: 1.45; margin: 4px 0 0; }

.qcard .qlabel, .acard .alabel {
  font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 8px;
}
.qcard { border-left: 3px solid var(--primary); }

.acard { position: relative; transition: .15s; }
.acard.covered {
  cursor: pointer; border: 1px dashed var(--card-border); text-align: center;
  background: repeating-linear-gradient(45deg, #16203a, #16203a 12px, #131c33 12px, #131c33 24px);
}
.acard.covered:hover { border-color: var(--primary); }
.acard .alabel { text-align: left; }
.reveal-hint { padding: 22px 8px; font-size: 16px; color: var(--muted); font-weight: 600; }
.answer-body { animation: fade .2s ease; }
.answer-main { font-size: 18px; font-weight: 600; color: #d1fae5; line-height: 1.45; }
.answer-exp { margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.55; }

.nav { display: flex; gap: 12px; margin-top: 20px; }
.nav .btn { flex: 1; }
.btn.wide { width: 100%; margin-top: 12px; }

/* keyboard shortcut badges + hint */
.kbd {
  display: inline-block; min-width: 18px; padding: 1px 6px; margin: 0 2px;
  font-size: 12px; font-weight: 700; line-height: 1.5;
  border: 1px solid var(--card-border); border-bottom-width: 2px;
  border-radius: 6px; background: #0b1120; color: var(--text);
}
.kbd-hint { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 12px; }
.kbd-hint b { color: var(--text); }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }

/* ---------- Mobile-friendly ---------- */
@media (max-width: 560px) {
  main { padding: 14px 12px 32px; }
  .topbar { padding: 12px 14px; }
  .brand { font-size: 15px; }
  h1 { font-size: 22px; }
  .card { padding: 14px; }
  .question { font-size: 19px; }
  .answer-main { font-size: 17px; }
  .row { grid-template-columns: 1fr 1fr; }
  .nav .btn { padding: 15px 12px; font-size: 16px; }
  .reveal-hint { padding: 26px 8px; }
}

@media (hover: none) and (pointer: coarse) {
  /* touch devices: hide the keyboard hint, enlarge tap targets */
  .kbd-hint { display: none; }
  .nav .kbd { display: none; }
  .chip { padding: 12px 16px; }
}

