/* ============================================================
   THEME — edit these variables to change the whole site's look.
   This is the Persistent Wave palette: near-black background,
   GitHub-dark-style panels, blue accent, green/red for
   success/error. Change the hex values here and everything
   below updates automatically — you shouldn't need to touch
   colors anywhere else in this file.
============================================================= */
/* Larger-text mode (the "Aa" button, see textsize.js). Scales the root
   font-size so every rem-based measurement in this file grows with it -
   nothing below needs its own large-text rule. */
html[data-text-size="large"] { font-size: 118.75%; }

:root {
  --bg: #0d1117;          /* page background */
  --bg-panel: #161b22;    /* cards, header, panels */
  --bg-input: #0d1117;    /* form fields */
  --border: #30363d;      /* all borders/dividers */
  --text: #c9d1d9;        /* main text */
  --text-dim: #8b949e;    /* secondary/muted text */
  --accent: #58a6ff;      /* links, active states, buttons */
  --green: #3fb950;       /* success / "live" badge */
  --red: #f85149;         /* errors / destructive buttons */
  --amber: #d29922;       /* warnings - nothing's broken, but act soon */

  /* Fonts: a system sans for body copy, monospace for anything
     that should feel terminal-ish (brand, headings, badges). */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding-bottom: 34px; /* room for the fixed news ticker so it never covers content */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
}

/* Plain links in body copy (mostly on the static SEO pages - about.html,
   boxes.html, etc). Nav/footer/button-styled links override this with
   their own classes above, so this only affects ordinary text links. */
a { color: var(--accent); }

/* ============================================================
   TOP BAR
============================================================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}

.brand {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0;
}
.brand-mark { height: 1.7em; width: auto; display: block; pointer-events: none; margin-right: -0.12em; }
.brand .accent { color: var(--accent); }

.tabs { display: flex; gap: 0.5rem; }

/* A few of these classes are also used on plain <a> tags (the static SEO
   pages in public/*.html, e.g. about.html, boxes.html) rather than only on
   the SPA's <button>s - strip the default link underline/colour there. */
a.brand, a.tab-btn, a.link-btn, a.contact-btn { text-decoration: none; }

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: var(--font-body);
}
.tab-btn:hover { color: var(--text); background: #1c2128; }
.tab-btn.active { color: var(--accent); border-color: var(--border); background: #1c2128; }

.session-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.contact-btn {
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.contact-btn:hover { color: var(--text); border-color: var(--accent); }

/* font-size set explicitly on all three of these (not left to inherit)
   because a <button> and an <a> don't default to the same size even
   inside the same container - a <button> falls back to the browser's own
   UA stylesheet size unless told otherwise, while an <a> just inherits
   whatever size surrounds it. Without this, the real Log in button here
   quietly rendered smaller than Get in touch right next to it, and the
   static pages' own Log in link (below) rendered bigger than both. */
.session-area button {
  background: var(--accent);
  color: #0d1117;
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.session-area button:hover { opacity: 0.85; }

/* The static pages' own "Log in" link (an <a>, not a <button> - it opens
   the login modal back on the main site via the /#login hash, since these
   pages carry no login form of their own) styled to match the SPA's real
   Log in button above, rather than the plain text-link look it had before
   - the two should look and behave the same wherever they appear. */
.static-login-btn {
  display: inline-block;
  background: var(--accent);
  color: #0d1117;
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-decoration: none;
}
.static-login-btn:hover { opacity: 0.85; color: #0d1117; }

/* Larger-text toggle - a plain outline button, not the accent-filled style
   used for actions like "Log in", since this isn't a primary action. */
#text-size-toggle {
  background: none;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
}
#text-size-toggle:hover, #text-size-toggle[aria-pressed="true"] { color: var(--text); border-color: var(--accent); }

.burger-btn {
  display: none; /* shown only under the 1100px breakpoint below */
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
}
.burger-btn:hover { background: #1c2128; }

/* ============================================================
   LAYOUT / TABS
   Change --page-width below to make the site wider or narrower.
============================================================= */
main {
  --page-width: 960px;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

h1 { font-family: var(--font-mono); font-size: 1.8rem; margin-bottom: 0.5rem; }
h2 { font-family: var(--font-mono); font-size: 1.2rem; margin-top: 1.5rem; }
.lede { color: var(--text-dim); max-width: 640px; }
.muted { color: var(--text-dim); font-size: 0.9rem; }

.trial-warning {
  margin: 8px 0;
  padding: 8px 12px;
  border: 1px solid var(--amber);
  border-radius: 6px;
  background: rgba(210, 153, 34, 0.12);
  color: var(--amber);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Organisations table: flags a soon-to-expire or already-expired licence
   right in the row, for a platform admin scanning several orgs at once. */
.expiry-soon { color: var(--amber); font-weight: 600; }
.expiry-expired { color: var(--red); font-weight: 600; }

/* Homepage "real numbers" strip - computed server-side from the actual
   catalog (see server/publicStats.js / GET /api/public/stats). */
.stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin: 20px 0;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stats-strip .stat { text-align: center; min-width: 110px; }
.stats-strip .stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}
.stats-strip .stat-label { font-size: 0.85rem; color: var(--text-dim); }

/* ============================================================
   HOME TAB — the three cards
============================================================= */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

/* Visually hidden but still read by screen readers - for labels that would
   otherwise be redundant on screen next to an already-obvious placeholder. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Home page "try it first" practice flag - a harmless, no-stakes taste of
   how flag submission works, so a first-timer isn't guessing at the real
   mechanic under a ticking clock. Plain client-side check, no scoring. */
.practice-clue {
  font-family: var(--font-mono);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  word-break: break-all;
}
#practice-flag-form { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
#practice-flag-form input {
  flex: 1 1 160px;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font-mono);
}
#practice-flag-result.correct { color: var(--green); }
#practice-flag-result.incorrect { color: var(--accent); }

.testimonial {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}

.testimonial-stars {
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.15em;
}

.testimonial-text {
  color: var(--text);
  font-size: 1.05rem;
  font-style: italic;
  margin: 0.5rem 0;
}

.testimonial-source {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ============================================================
   BOXES TAB — box cards (generated by app.js), flag form,
   leaderboard. These ids/classes are referenced directly in
   app.js — safe to restyle, risky to rename.
============================================================= */
.box-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.box-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  position: relative;
  display: flex;
  flex-direction: column;
  /* Grid rows already stretch cards to equal height; this keeps the Launch
     button (or the gap where one would be) pinned to the same bottom line
     across a row, whatever the length of the tagline/topic list above it. */
}
.box-card h3 {
  margin: 0 0 0.3rem;
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
}
.box-card p { color: var(--text-dim); font-size: 0.9rem; }
.box-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.6rem 0; }
.box-meta-item {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.box-card ul { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; color: var(--text-dim); }

/* "Built for" audience chips - who a box is pitched at (police/Cyber Prevent,
   schools & universities, business), set per box in server/boxes.js */
.audience-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.6rem; }
.audience-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  background: rgba(88, 166, 255, 0.08);
}

/* status pill next to each box name — "live" vs "coming soon" */
.badge {
  font-family: var(--font-mono);
  background: var(--border);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  margin: 0 1rem;
  white-space: nowrap;
  flex: none;
}
.badge.live { color: var(--green); }
.badge.coming-soon { color: var(--text-dim); }

/* Launch button on a live box's card */
.launch-btn {
  display: block;
  margin-top: auto; /* pushes the button to the bottom of the card, see .box-card */
  background: var(--accent);
  color: #0d1117;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-mono);
}
.launch-btn:hover { opacity: 0.85; }

#flag-section, #leaderboard-section {
  background: var(--bg-panel);
  padding: 1rem;
  border-radius: 6px;
  margin: 1rem 0;
  border: 1px solid var(--border);
}

#flag-form, #feedback-form { display: grid; gap: 0.75rem; max-width: 420px; }
#flag-form label, #feedback-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--text-dim);
  gap: 0.25rem;
}
#flag-form input, #flag-form select,
#feedback-form input, #feedback-form select, #feedback-form textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  resize: vertical;
}
#flag-form button, #feedback-form button {
  background: var(--accent);
  color: #0d1117;
  border: none;
  padding: 0.6rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
#feedback-form .checkbox-row {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
}
#feedback-form .checkbox-row input { width: auto; margin-top: 0.2rem; }

/* feedback line under the flag form — app.js toggles these classes */
#flag-result.success, #feedback-result.success { color: var(--green); font-weight: bold; }
#flag-result.error, #feedback-result.error { color: var(--red); }

#leaderboard-table, #users-table, #orgs-table, #boxes-table, #created-table, #feedback-table, #org-admins-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
}
#leaderboard-table th, #leaderboard-table td, #users-table th, #users-table td,
#orgs-table th, #orgs-table td, #boxes-table th, #boxes-table td, #created-table th, #created-table td,
#feedback-table th, #feedback-table td, #org-admins-table th, #org-admins-table td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
#leaderboard-table th, #users-table th, #orgs-table th, #boxes-table th, #created-table th, #org-admins-table th { color: var(--accent); }

/* Admin-logins modal is wider than the default .modal-content (380px) - a
   login name plus a real email address needs the room, and this modal is
   just a short list + Remove buttons, not a tall form. */
.org-admins-content { width: min(90vw, 480px); }

/* "Skills" toggle on a leaderboard row, and the breakdown it reveals */
.skills-toggle {
  font-family: var(--font-mono);
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.skills-toggle:hover { border-color: var(--accent); }
.skills-detail td { border-bottom: 1px solid var(--border); background: var(--bg-panel); }
.skills-list { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.3rem 0; }
.skills-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}
.skills-chip.full { color: var(--green); border-color: var(--green); }
.left-early-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #c98a1a;
  background: rgba(201, 138, 26, 0.12);
  border: 1px solid #c98a1a;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

/* Analytics (admin tab): each table gets its own card rather than sitting
   bare on the page background, numeric columns are right-aligned, and
   Completion/Reach-rate cells carry a small inline bar alongside the
   number (built by analyticsRateCell() in app.js) so the two tables read
   at a glance instead of as a wall of digits. */
.analytics-block {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem 1.2rem;
  margin: 0.75rem 0 1.25rem;
}
.analytics-block h3 { margin-top: 0; }
.analytics-block > p.muted:last-of-type { margin-bottom: 0.75rem; }

#analytics-boxes-table, #analytics-flags-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
}
#analytics-boxes-table th, #analytics-flags-table th {
  text-align: left;
  padding: 0.45rem 0.7rem;
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
#analytics-boxes-table td, #analytics-flags-table td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
}
#analytics-boxes-table tbody tr:last-child td,
#analytics-flags-table tbody tr:last-child td { border-bottom: none; }
#analytics-boxes-table tbody tr:hover,
#analytics-flags-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

#analytics-boxes-table th.num, #analytics-boxes-table td.num,
#analytics-flags-table th.num, #analytics-flags-table td.num { text-align: right; }
#analytics-boxes-table th:nth-child(2), #analytics-boxes-table td:nth-child(2),
#analytics-boxes-table th:nth-child(3), #analytics-boxes-table td:nth-child(3),
#analytics-boxes-table th:nth-child(4), #analytics-boxes-table td:nth-child(4),
#analytics-flags-table th:nth-child(4), #analytics-flags-table td:nth-child(4) {
  text-align: right;
}

.analytics-rate { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 600; }
.analytics-rate-bar {
  width: 56px;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-input);
  overflow: hidden;
  flex: none;
}
.analytics-rate-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--green); }
.analytics-rate.good { color: var(--green); }
.analytics-rate.low { color: var(--amber); }
.analytics-rate.low .analytics-rate-bar > span { background: var(--amber); }
.analytics-rate.crit { color: var(--red); }
.analytics-rate.crit .analytics-rate-bar > span { background: var(--red); }

/* ============================================================
   ADMIN TAB
============================================================= */
#admin-panel button {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  margin: 0 0.4rem 0.4rem 0;
}
/* the buttons that delete or stop things stay red */
#admin-panel #reset-leaderboard-btn, #admin-panel #event-reset-btn { background: var(--red); color: white; }
#admin-panel #event-start-btn { background: var(--green); }
#admin-panel .form-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.5rem; align-items: center; }
#admin-panel input, #admin-panel select {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font: inherit;
  min-width: 0;
}
#admin-panel #scope-row { margin-bottom: 1rem; }
.admin-howto { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.25rem; margin: 1rem 0 1.5rem; }
.admin-howto ol { margin: 0.5rem 0 0; }
#admin-panel h3 { margin: 1.2rem 0 0.4rem; }
#admin-panel table button { padding: 0.25rem 0.6rem; font-size: 0.85rem; }

/* ============================================================
   LOGIN MODAL
============================================================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hidden { display: none; }
.modal-content {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  width: min(90vw, 380px);
}
.modal-content form { display: grid; gap: 0.75rem; }
.modal-content label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--text-dim);
  gap: 0.25rem;
}
.modal-content input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem;
  border-radius: 6px;
}
.modal-content button {
  background: var(--accent);
  color: #0d1117;
  border: none;
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
#login-cancel { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }

#org-boxes-checklist { display: grid; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.org-box-check {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.5rem; border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
}
.org-box-check:hover { background: #1c2128; }
.org-box-check input { margin-top: 0.2rem; }
.org-box-check .org-box-check-name { font-weight: 600; }
.org-box-check .org-box-check-tagline { display: block; font-size: 0.8rem; color: var(--text-dim); font-weight: 400; }
#org-boxes-cancel { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }

.box-complete-content {
  text-align: center;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 10px 40px rgba(0, 0, 0, 0.5);
}
.box-complete-content h2 { margin-top: 0; font-size: 1.4rem; }
.box-complete-name { font-size: 1.1rem; font-weight: 600; color: var(--accent); margin: 0.5rem 0; }
.box-complete-content button {
  margin-top: 0.75rem;
  width: 100%;
}
.box-complete-content .box-complete-secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  margin-top: 0.5rem;
}

/* ============================================================
   UTILITY — used by app.js to show/hide things
============================================================= */
.error { color: var(--red); font-size: 0.85rem; }
.hidden { display: none !important; }

.center-image {
    display: block;
    margin: 1.25rem auto 0;
    width: 72px;
    max-width: 100%; /* Prevents the image from overflowing on smaller viewports */
    height: auto;
    opacity: 0.85;
  }

/* ============================================================
   HOME TAB — "What's inside" strip of exercise banners
============================================================= */
.promo-video {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-top: 1.5rem;
  background: #000;
}

.hidden {
    display: none !important;
}

/* ============================================================
   EVENT COUNTDOWN
============================================================= */
.event-timer {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  white-space: nowrap;
}
.event-timer.running { color: var(--green); border-color: var(--green); }
.event-timer.warn { color: var(--red); border-color: var(--red); }
.event-timer.ended { color: var(--red); }


/* About tab */
.about-sub{margin:28px 0 8px}
.about-list{margin:0 0 8px;padding-left:22px;line-height:1.7}
.about-text{line-height:1.7;max-width:760px}

/* picture across the top of a box card */
.box-banner{display:block;width:calc(100% + 2.5rem);margin:-1.25rem -1.25rem 1rem;border-radius:8px 8px 0 0;aspect-ratio:3/1;object-fit:cover}

/* small remove button in the users table */
#admin-panel .remove-user-btn{padding:.2rem .6rem;font-size:.8rem;background:transparent;border:1px solid var(--red);color:var(--red)}
#admin-panel .remove-user-btn:hover{background:var(--red);color:#fff}

/* small reset-this-one's-personal-timer button, next to Remove */
#admin-panel .reset-timer-btn{padding:.2rem .6rem;font-size:.8rem;margin-right:.4rem;background:transparent;border:1px solid var(--accent);color:var(--accent)}
#admin-panel .reset-timer-btn:hover{background:var(--accent);color:#fff}

/* footer and the "fill this in" marker */
.site-footer{max-width:960px;margin:2.5rem auto 1.5rem;padding:1rem 1.25rem 2.5rem;border-top:1px solid var(--border);display:flex;gap:1.25rem;align-items:center;color:var(--text-dim);font-size:.85rem}
.site-footer .link-btn{margin:0}
.footer-social{margin-left:auto;display:inline-flex;align-items:center;gap:.4rem;color:var(--text-dim);text-decoration:none;font-size:.85rem}
.footer-social:hover{color:var(--accent)}

/* ============================================================
   NEWS TICKER — thin rolling strip pinned to the bottom of every
   tab. Content comes from NEWS_ITEMS in app.js.
============================================================= */
.news-ticker{position:fixed;left:0;right:0;bottom:0;z-index:40;height:34px;
  background:var(--bg-panel);border-top:1px solid var(--border);overflow:hidden;
  display:flex;align-items:center;}
.news-ticker-track{display:flex;white-space:nowrap;width:max-content;
  font-family:var(--font-mono);font-size:.78rem;color:var(--text-dim);
  animation:news-ticker-scroll 45s linear infinite;}
.news-ticker-track:hover{animation-play-state:paused;}
.news-ticker-track .news-item{display:inline-flex;align-items:center;gap:.5rem;padding:0 2.25rem;}
.news-ticker-track .news-dot{width:6px;height:6px;border-radius:50%;background:var(--green);flex:none;}
@keyframes news-ticker-scroll{from{transform:translateX(0);}to{transform:translateX(-50%);}}
@media (prefers-reduced-motion: reduce){.news-ticker-track{animation:none;overflow-x:auto;}}
.todo{background:#ffd54a;color:#111;padding:0 .35rem;border-radius:3px;font-weight:700}

/* Lab session panel on the Boxes tab (shown after Launch). Colours as originally designed: pink heading, green address, amber note. */
.lab-session{margin-top:2.5rem;border-top:2px solid #222;padding-top:1.9rem}
.lab-session h2{color:#ff007f;margin:0 0 .5rem}
.lab-address{position:relative;background:#111;border:1px solid #333;border-radius:6px;padding:1.25rem;margin:1.25rem 0 1rem;font-family:"Courier New",Courier,monospace}
.lab-label{display:block;color:#666;font-size:.75rem;margin-bottom:.5rem;text-transform:uppercase;letter-spacing:.06em}
.lab-address code{color:#00ff00;font-size:1rem;word-break:break-all}
.lab-copy{position:absolute;right:15px;top:15px;padding:5px 10px;font-size:.8rem;background:#222;border:1px solid #444;color:#fff;border-radius:4px;cursor:pointer}
.lab-copy:hover{border-color:#ff007f}
.lab-note{background:#1a1505;border-left:4px solid #ffaa00;padding:.75rem 1rem;border-radius:0 4px 4px 0;color:#ffaa00;font-size:.9rem}
.lab-note code{color:#ffaa00;background:#000;padding:.1rem .35rem;border-radius:3px}
.lab-help{margin-top:1rem;background:#0d0d0d;border:1px solid #333;border-radius:6px;padding:.9rem 1.1rem;color:#ccc;font-size:.9rem}
.lab-help summary{cursor:pointer;color:#00ff00;font-weight:600}
.lab-help summary:hover{color:#ff007f}
.lab-help p,.lab-help ol{margin:.7rem 0 0}
.lab-help ol{padding-left:1.3rem}
.lab-help li{margin-bottom:.4rem}
.lab-help code{color:#00ff00;background:#000;padding:.1rem .35rem;border-radius:3px}

/* "Open the investigation" / "Begin your shift" button on Matched and
   Nightjar's case-file panel - same spot persistent-wave's connect command
   sits in, but there's nothing to copy here, just one button to press. */
.lab-start{text-align:center;background:#111;border:1px solid #333;border-radius:6px;padding:1.25rem;margin:1.25rem 0 1rem}
.lab-start .enter-box-btn{background:#00ff00;color:#0d1117;border:none;padding:.75rem 1.75rem;border-radius:6px;font-weight:700;font-family:"Courier New",Courier,monospace;font-size:1rem;cursor:pointer}
.lab-start .enter-box-btn:hover{opacity:.85}

/* Case briefing + task list on the Persistent Wave launch panel - same
   terminal palette as the rest of .lab-session (pink/green/amber on black). */
.case-file,.task-briefing{position:relative;margin:1.25rem 0;background:#0d0d0d;border:1px solid #333;border-radius:6px;padding:1.1rem 1.3rem;color:#ccc}
.case-file summary,.task-briefing summary{cursor:pointer;color:#00ff00;font-weight:700;font-family:"Courier New",Courier,monospace;letter-spacing:.02em}
.case-file summary:hover,.task-briefing summary:hover{color:#ff007f}
.case-file h3{color:#ff007f;font-family:"Courier New",Courier,monospace;font-size:1rem;letter-spacing:.03em;margin:1.3rem 0 .5rem}
.case-file h3:first-of-type{margin-top:1.1rem}
.case-file p,.task-briefing p{font-size:.92rem;line-height:1.6;margin:.5rem 0}
.case-file ul{margin:.5rem 0 0;padding-left:1.2rem;font-size:.92rem;line-height:1.6}

/* Static, not absolute - an absolutely-positioned stamp collides with the
   summary text once it wraps to two lines on a narrow screen (same class of
   bug as the Nightjar photo page). */
.case-stamp{display:inline-block;margin:.6rem 0 0;color:#ff3355;border:2px solid #ff3355;border-radius:4px;padding:.2rem .6rem;font-family:"Courier New",Courier,monospace;font-weight:700;font-size:.72rem;letter-spacing:.15em;transform:rotate(-2deg);opacity:.85}

/* The dt/dd pairs are each wrapped in a <div> so they stay together if this
   ever wraps to one column; display:contents un-boxes the wrapper so dt/dd
   themselves are the grid items, not the div around them. */
.case-suspect{display:grid;grid-template-columns:max-content 1fr;gap:.35rem 1rem;margin:.5rem 0 0;font-size:.9rem}
.case-suspect>div{display:contents}
.case-suspect dt{color:#666;text-transform:uppercase;font-size:.72rem;letter-spacing:.05em}
.case-suspect dd{margin:0 0 .4rem;color:#eee}

.evidence-log{margin:.5rem 0 0;padding-left:1.2rem;font-size:.9rem;line-height:1.6}
.evidence-log li{margin-bottom:.6rem}
.evidence-log strong{color:#00ff00}

.evidence-card{display:inline-block;background:#161b0f;border:1px dashed #4a4;border-radius:6px;padding:.75rem 1.25rem;margin:.75rem 0;font-family:"Courier New",Courier,monospace}
.evidence-card-face{color:#00ff00;font-weight:700;letter-spacing:.08em;font-size:1.05rem}
.evidence-card-note{color:#aaa;font-size:.82rem;margin-top:.3rem;font-style:italic}

.task-list{list-style:none;margin:.75rem 0 0;padding:0;counter-reset:task}
.task-list>li{counter-increment:task;position:relative;padding:.9rem 0 .9rem 2.3rem;border-top:1px solid #222}
.task-list>li:first-child{border-top:none}
.task-list>li::before{content:counter(task);position:absolute;left:0;top:.9rem;width:1.6rem;height:1.6rem;border:1px solid #00ff00;border-radius:50%;color:#00ff00;font-family:"Courier New",Courier,monospace;font-size:.85rem;display:flex;align-items:center;justify-content:center}
.task-list h4{margin:0 0 .4rem;font-size:.95rem;color:#eee;display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}
.flag-tag{font-size:.7rem;color:#000;background:#00ff00;padding:.15rem .5rem;border-radius:3px;font-weight:700;letter-spacing:.02em;white-space:nowrap}
.task-clue{color:#ffaa00;font-size:.85rem}

.inline-link{display:inline;padding:0;margin:0}

/* ============================================================
   NARROWER WINDOWS — below this, the topbar can't fit brand + every
   tab + the login/contact buttons on one row. Raised from 900px to
   1100px once a sixth tab (Trust) was added: 900-1050px (an unmaximised
   laptop window, two windows side by side) was overflowing - "Log in"
   either got pushed off-screen entirely or wrapped onto two lines. An
   iPad in portrait (768-834px) hit the same failure mode earlier, which
   is why this was a breakpoint and not a fixed-width check to begin
   with. Everything past the brand collapses behind the burger button
   instead, as a single full-width dropdown.
============================================================= */
@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; row-gap: 0; padding: 0.6rem 1rem; position: relative; }
  .brand { order: 1; }
  .burger-btn { display: block; order: 2; margin-left: auto; }

  .tabs, .session-area {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .topbar.nav-open .tabs, .topbar.nav-open .session-area { display: flex; }

  .tabs { margin-top: 0.6rem; gap: 0.25rem; }
  .tab-btn { text-align: left; padding: 0.7rem 0.9rem; }

  .session-area {
    margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--border);
    gap: 0.6rem; align-items: stretch; font-size: 1rem;
  }
  .session-area .contact-btn, .session-area button { width: 100%; text-align: center; padding: 0.6rem; }
  .event-timer, #session-status { text-align: center; }

  main { padding: 1.25rem 1rem 2rem; }
  h1 { font-size: 1.4rem; }

  .home-grid, .box-grid { grid-template-columns: 1fr; }

  .case-suspect { grid-template-columns: 1fr; }
  .case-suspect dt { margin-top: .5rem; }
}

/* ============================================================
   TESTIMONIALS (Admin tab, platform admin only) - the best
   "okay to quote" feedback, picked out automatically by app.js's
   renderTestimonials(). Styled like a quote card, not a table row,
   since the point is to make it easy to read and copy, not scan.
============================================================= */
.testimonial-list { display: flex; flex-direction: column; gap: 0.75rem; margin: 0.75rem 0 1.5rem; }
.testimonial-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  background: var(--bg-panel, rgba(255,255,255,0.03));
}
.testimonial-quote { margin: 0 0 0.5rem; font-style: italic; line-height: 1.5; }
.testimonial-meta { margin: 0 0 0.6rem; font-size: 0.82rem; }
.testimonial-card button { width: auto; padding: 0.35rem 0.9rem; font-size: 0.85rem; }

/* ============================================================
   PROJECTOR / BIG-SCREEN LEADERBOARD MODE
   Toggled by #projector-btn (see app.js). Hides everything but the
   standings table, blows up the type and goes full-screen - meant
   to be left running on a room's projector or TV during a session,
   not used as a normal view.
============================================================= */
#hint-btn {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  margin-top: 0.5rem;
}
#hint-result:not(:empty) { margin-top: 0.5rem; }

/* Admin Users table: inline team name + Save button per row. */
.team-cell { display: flex; align-items: center; gap: 0.4rem; }
.team-input { width: 110px; padding: 0.3rem 0.5rem; font-size: 0.85rem; }

.leaderboard-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.leaderboard-head h2 { margin: 0; }
#leaderboard-head #projector-btn,
.leaderboard-head button { width: auto; margin-top: 0; }
#projector-exit-hint { display: none; }

body.projector-mode { background: #000; }
body.projector-mode .topbar,
body.projector-mode .news-ticker,
body.projector-mode .site-footer,
body.projector-mode #leaderboard > h1,
body.projector-mode #flag-section,
body.projector-mode #feedback-section,
body.projector-mode #projector-btn {
  display: none !important;
}
body.projector-mode main {
  max-width: none;
  padding: 2.2vw 3vw;
}
body.projector-mode #leaderboard-section h2 { display: none; }
body.projector-mode #team-leaderboard-section h2 {
  font-size: clamp(0.8rem, 1.2vw, 1.3rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  margin: 0 0 0.8vw;
}
body.projector-mode #leaderboard-table,
body.projector-mode #team-leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(1.1rem, 2.1vw, 2.4rem);
  margin-bottom: 2.5vw;
}
body.projector-mode #leaderboard-table th,
body.projector-mode #leaderboard-table td,
body.projector-mode #team-leaderboard-table th,
body.projector-mode #team-leaderboard-table td {
  padding: 1vw 1.4vw;
  border-bottom: 1px solid #222;
  text-align: left;
}
body.projector-mode #leaderboard-table thead,
body.projector-mode #team-leaderboard-table thead {
  font-size: clamp(0.7rem, 1vw, 1.1rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
}
body.projector-mode #leaderboard-table tbody tr:first-child td,
body.projector-mode #team-leaderboard-table tbody tr:first-child td {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.12em;
}
/* nth-child(6), not :last-child - the "no solves yet" row is a single
   colspan cell that IS last-child, and hiding it would make the whole
   row look blank instead of showing its message. */
body.projector-mode .skills-toggle,
body.projector-mode .skills-detail,
body.projector-mode #leaderboard-table thead th:nth-child(6),
body.projector-mode #leaderboard-table tbody tr td:nth-child(6) {
  display: none !important;
}
body.projector-mode #projector-exit-hint {
  display: block;
  position: fixed;
  bottom: 1rem;
  right: 1.4rem;
  color: #444;
  font-size: 0.85rem;
}

/* ============================================================
   EVENT RECAP SCREEN - full-screen summary a facilitator puts up once
   everyone's done. Deliberately standalone (not a .modal): it's meant to
   fill the whole display, not sit in a centered box.
============================================================= */
.recap-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #06080c;
  color: var(--text);
  overflow-y: auto;
  padding: 3rem 4vw 4rem;
}
.recap-close {
  position: fixed;
  top: 1.2rem;
  right: 1.4rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: auto;
  padding: 0.4rem 0.9rem;
}
.recap-close:hover { color: var(--text); border-color: var(--accent); }
.recap-inner { max-width: 980px; margin: 0 auto; }
.recap-title {
  text-align: center;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  margin: 0 0 2rem;
  letter-spacing: 0.02em;
}
.recap-stats-row {
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 5vw, 5rem);
  margin-bottom: 2.5rem;
}
.recap-stat { text-align: center; }
.recap-stat-num {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: var(--accent);
  font-weight: 700;
}
.recap-stat-label { color: var(--text-dim); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; }
.recap-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}
@media (max-width: 720px) { .recap-columns { grid-template-columns: 1fr; } }
.recap-col h2 { font-size: 1.1rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.9rem; }
.recap-top-list { list-style: none; margin: 0; padding: 0; counter-reset: recap-rank; }
.recap-top-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 1.2rem;
}
.recap-top-list li:first-child { color: var(--accent); font-weight: 700; font-size: 1.4rem; }
.recap-top-name { display: flex; gap: 0.5rem; align-items: baseline; }
.recap-top-team { color: var(--text-dim); font-size: 0.8em; }
.recap-top-points { font-family: var(--font-mono); color: var(--text-dim); }
.recap-category-list { display: grid; gap: 0.7rem; }
.recap-category-row { display: grid; grid-template-columns: 170px 1fr auto; align-items: center; gap: 0.6rem; }
.recap-category-name { text-transform: capitalize; font-size: 0.95rem; }
.recap-category-bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.recap-category-fill { height: 100%; background: var(--accent); }
.recap-category-count { font-family: var(--font-mono); color: var(--text-dim); font-size: 0.85rem; }
.recap-line { text-align: center; font-size: 1.1rem; margin: 1rem 0; }
.recap-quote {
  margin: 2rem auto 0;
  max-width: 640px;
  text-align: center;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text);
  border: none;
  padding: 0;
}
.recap-quote cite { display: block; margin-top: 0.6rem; font-style: normal; color: var(--text-dim); font-size: 0.9rem; }

/* Admin tab sub-navigation (Run event / Review / Business) - splits what
   used to be one long scroll into the three jobs it was actually doing. */
.admin-subtabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin: 1rem 0 1.5rem;
  padding-bottom: 0;
}
.admin-subtab-btn {
  width: auto;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--text-dim);
  padding: 0.5rem 0.2rem;
  margin: 0 0.8rem 0 0;
  font-size: 0.95rem;
}
.admin-subtab-btn:hover { color: var(--text); }
.admin-subtab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-subtab-panel { display: none; }
.admin-subtab-panel.active { display: block; }

