/* LAB Group brand (labgroup.com.au): navy, blue, gold; General Sans. */
@font-face {
  font-family: "General Sans";
  src: url("fonts/GeneralSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("fonts/GeneralSans-Medium.woff2") format("woff2");
  font-weight: 500 600;
  font-display: swap;
}

:root {
  --navy: #002b40;
  --blue-dark: #00506e;
  --blue: #0089d9;
  --blue-light: #98cef2;
  --blue-wash: #ecf3fb;
  --gold: #f1b828;
  --text: #002b40;
  --muted: #5b6770;
  --line: #e1e4e5;
  --line-strong: #b5b8ba;
  --surface: #ffffff;
  --page: #f4f8fc;
  --danger: #b42318;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0, 43, 64, 0.06), 0 8px 24px rgba(0, 43, 64, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "General Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); margin: 0.25rem 0 1rem; }
h2 { font-size: 1.35rem; margin: 0 0 0.5rem; }
p { margin: 0 0 1rem; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- top bar ---- */
.topbar { background: var(--navy); color: #fff; }
.topbar-inner {
  max-width: 880px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 16px;
}
.logo { height: 34px; width: auto; display: block; }
.topbar-title {
  padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 500; letter-spacing: 0.02em;
}

main { max-width: 880px; margin: 0 auto; padding: 32px 20px 80px; }

/* ---- cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.card + .card, .status + .card { margin-top: 16px; }

.hero { border-top: 4px solid var(--gold); }
.eyebrow {
  margin: 0; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue-dark);
}
.lead { font-size: 1.1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
#instructions { white-space: pre-line; margin-bottom: 1rem; }

.facts { list-style: none; padding: 0; margin: 0 0 1.25rem; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li {
  background: var(--blue-wash); color: var(--blue-dark);
  border-radius: 999px; padding: 4px 12px; font-size: 0.875rem; font-weight: 500;
}

/* ---- buttons ---- */
button { font: inherit; cursor: pointer; }
.primary {
  background: var(--blue-dark); color: #fff; border: 0; border-radius: 4px;
  padding: 12px 24px; font-weight: 500; transition: background 0.15s;
}
.primary:hover { background: var(--navy); }
.primary:disabled { opacity: 0.6; cursor: wait; }
.secondary {
  background: #fff; color: var(--blue-dark); border: 1px solid var(--line-strong);
  border-radius: 4px; padding: 10px 18px; font-weight: 500; margin-left: 8px;
}
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---- status strip ---- */
.status { padding: 0 2px; }
.status-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.timer {
  margin: 0; font-variant-numeric: tabular-nums; font-weight: 600;
  background: var(--navy); color: #fff; border-radius: 999px; padding: 4px 14px; font-size: 0.95rem;
}
.timer.low { background: var(--danger); }
.progress { height: 6px; background: var(--line); border-radius: 999px; margin: 12px 0 6px; overflow: hidden; }
#progress-bar { height: 100%; width: 0; background: var(--gold); transition: width 0.3s; }
.part-intro {
  background: var(--blue-wash); border-left: 3px solid var(--blue);
  border-radius: 4px; padding: 12px 16px; margin: 12px 0 0;
}
.part-intro:empty { display: none; }

/* ---- notices ---- */
.notice { padding: 20px 24px; }
.notice.error { border-left: 4px solid var(--danger); }

/* ---- question ---- */
.question h2 { margin-bottom: 0.5rem; }
.question .description { color: var(--muted); white-space: pre-line; }
.question fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.question legend { padding: 0; }
.actions { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 24px; }
.field-error { color: var(--danger); margin: 0; font-size: 0.9rem; }

/* single and multiple choice */
.choices { display: grid; gap: 10px; margin-top: 16px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.choice:hover { border-color: var(--blue-light); }
.choice input { margin: 4px 0 0; accent-color: var(--blue-dark); width: 18px; height: 18px; flex: none; }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-wash); }

/* ranking */
.ranking { display: grid; gap: 20px; margin-top: 20px; }
.area-title { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 8px; }
.pool, .ranked {
  list-style: none; margin: 0; padding: 10px; min-height: 64px;
  border-radius: var(--radius); display: grid; gap: 8px; align-content: start;
}
.pool { background: var(--page); border: 1px dashed var(--line-strong); }
.ranked { background: var(--blue-wash); border: 1px solid var(--blue-light); }
.pool.over, .ranked.over { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.end-label { font-size: 0.8rem; color: var(--blue-dark); font-weight: 500; margin: 4px 2px; }
.pool-empty { color: var(--muted); font-size: 0.9rem; padding: 8px; text-align: center; }

.slot { display: flex; align-items: stretch; gap: 8px; }
.slot-no { width: 1.25rem; flex: none; padding-top: 13px; text-align: right; color: var(--blue-dark); font-size: 0.85rem; font-weight: 600; }
.slot-empty {
  flex: 1; min-height: 48px; border: 1px dashed var(--blue-light); border-radius: 6px;
}
.slot.drop-here .slot-empty, .slot.drop-here .item { box-shadow: 0 -3px 0 var(--blue); }
.ranked.drop-end { box-shadow: inset 0 -3px 0 var(--blue); }

.item {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 10px 10px 12px; cursor: grab; touch-action: none; user-select: none;
  box-shadow: 0 1px 2px rgba(0, 43, 64, 0.06); transition: border-color 0.15s, box-shadow 0.15s;
}
.item:hover { border-color: var(--blue-light); box-shadow: 0 2px 8px rgba(0, 43, 64, 0.1); }
.item-text { flex: 1; }
.grip { color: var(--line-strong); flex: none; font-size: 0.9rem; letter-spacing: -2px; }
.item.dragging { opacity: 0.35; }
.ghost {
  position: fixed; z-index: 10; pointer-events: none; margin: 0;
  box-shadow: 0 12px 28px rgba(0, 43, 64, 0.25); border-color: var(--blue); cursor: grabbing;
}
.item-tools { display: flex; gap: 2px; flex: none; }
.icon-btn {
  border: 0; background: transparent; color: var(--blue-dark); border-radius: 4px;
  width: 30px; height: 30px; display: grid; place-items: center; font-size: 1rem; line-height: 1;
}
.icon-btn:hover { background: var(--blue-wash); }
.icon-btn:disabled { color: var(--line-strong); background: transparent; cursor: default; }
