:root {
  --bg: #120d0a;
  --bg-2: #1b1410;
  --card: #231a14;
  --card-2: #2c211a;
  --line: #3a2c22;
  --text: #f7efe6;
  --muted: #bba795;
  --accent: #ffb547;
  --accent-ink: #2a1a05;
  --teal: #2dd4bf;
  --good: #34d399;
  --bad: #f87171;
  --radius: 18px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .35);
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, #3b2414 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 10%, #0f3a36 0%, transparent 55%), var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
[hidden] { display: none !important; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; max-width: 720px; margin: 0 auto;
}
.brand { font-weight: 700; font-size: 20px; letter-spacing: .2px; display: flex; align-items: center; gap: 8px; }
.brand .dot { color: var(--accent); }
.logo { width: 34px; height: 34px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); border-radius: 10px; font-size: 18px; }
.chip { font-size: 12px; padding: 6px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55vw; }

main { max-width: 720px; margin: 0 auto; padding: 4px 16px 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
h1 { font-size: clamp(26px, 6vw, 38px); line-height: 1.1; margin: 8px 0 8px; }
h2 { font-size: 20px; margin: 0 0 10px; }
h3 { font-size: 16px; margin: 0 0 6px; }
p { line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grad { background: linear-gradient(90deg, var(--accent), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.steps span { font-size: 12px; padding: 6px 10px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 181, 71, .18); }
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin-top: 14px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; border: 0; cursor: pointer; border-radius: 14px;
  padding: 14px 18px; background: var(--accent); color: var(--accent-ink); text-decoration: none;
  transition: transform .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; margin-top: 18px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.teal { background: var(--teal); color: #032824; }
.btn.linkedin { background: #0a66c2; color: #fff; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btn-row .btn { flex: 1 1 140px; }

/* games */
.games { display: grid; gap: 12px; margin-top: 14px; }
.game { position: relative; display: grid; gap: 6px; padding: 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.game.scanned { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 181, 71, .15), var(--shadow); }
.game h3 { padding-right: 90px; }
.game .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.game .meta span { padding: 4px 8px; background: var(--card-2); border-radius: 8px; }
.game .btn { margin-top: 8px; }
.badge { position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.badge.done { background: var(--good); color: #052e1c; }

/* quiz */
.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; padding: 8px 12px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); }
.timer.warn { color: var(--bad); border-color: var(--bad); }
.progress { height: 8px; background: var(--card-2); border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--teal)); transition: width .3s ease; }
.question { font-size: clamp(19px, 4.6vw, 24px); font-weight: 600; line-height: 1.35; margin: 6px 0 16px; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  font: inherit; font-size: 16px; color: var(--text); cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  transition: border-color .15s, background .15s, transform .08s;
}
.option:active { transform: scale(.99); }
.option .k { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--card-2); font-weight: 700; font-size: 14px; }
.option.picked { border-color: var(--accent); background: #3a2814; }
.option.picked .k { background: var(--accent); color: var(--accent-ink); }

/* post step */
.teaser { text-align: center; }
.big { font-size: clamp(44px, 12vw, 72px); font-weight: 800; line-height: 1; margin: 6px 0; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.step + .step { margin-top: 18px; }
.step .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--card-2); border: 1px solid var(--line); }
.final-box { border: 2px dashed var(--accent); background: rgba(255, 181, 71, .05); }
.clock { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 700; }

/* results */
.rank-card { text-align: center; background: linear-gradient(135deg, #3b2414, #0f3a36); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 16px; }
.stat { background: rgba(0, 0, 0, .25); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12px; color: var(--muted); }
.bar { height: 8px; border-radius: 999px; background: var(--card-2); overflow: hidden; margin: 6px 0 12px; }
.bar > i { display: block; height: 100%; background: var(--teal); }
.bar-label { display: flex; justify-content: space-between; font-size: 13px; }
.review-item { padding: 14px 0; border-top: 1px solid var(--line); }
.review-item:first-child { border-top: 0; padding-top: 0; }
.review-item .opt { font-size: 14px; padding: 8px 10px; border-radius: 10px; margin-top: 6px; background: var(--bg-2); }
.review-item .opt.correct { background: rgba(52, 211, 153, .15); color: var(--good); }
.review-item .opt.wrong { background: rgba(248, 113, 113, .15); color: var(--bad); text-decoration: line-through; }
.review-item .why { font-size: 13px; color: var(--muted); margin-top: 8px; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .2); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: #000; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px);
  transition: all .25s ease; pointer-events: none; z-index: 50; box-shadow: var(--shadow);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: #7f1d1d; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall 2.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .7; } }

/* tables (admin + screen) */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.table-wrap { overflow-x: auto; }

/* SaaS branding */
.logo.img { background: #fff; overflow: hidden; padding: 3px; }
.logo.img img { width: 100%; height: 100%; object-fit: contain; }
.logo.dc-mark { background: url(/dc-mark-light.png) center / contain no-repeat; } /* the DataCaffé cup, white for the dark theme */
.test-banner { background: var(--accent); color: var(--accent-ink); text-align: center; font-size: 13px; font-weight: 600; padding: 8px 16px; }

/* "A product of DataCaffé" – the logo is a white-background crop, so it sits on its own white chip on the dark theme */
.made-by { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); text-decoration: none; font-size: 13px; }
.made-by img { display: block; width: 96px; height: auto; background: #fff; border-radius: 8px; padding: 4px; }
.made-by-row { text-align: center; margin: 28px 0 40px; }
