/* Lorbrek — feuille de style principale (étapes 2 et 5 complèteront l'habillage) */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0d1117;
  --bg-surface: #161b22;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --danger: #f85149;
  --success: #3fb950;
  --warning: #d29922;
  --border: #30363d;
  --font-mono: "Courier New", Courier, monospace;
  --font-sans: system-ui, -apple-system, sans-serif;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

body {
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Error pages */
.error-page main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
}

.error-page h1 {
  font-size: 4rem;
  font-family: var(--font-mono);
  color: var(--accent);
}

/* Placeholder */
.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* ── Shared team UI ───────────────────────────────────────────────────────── */

.site-banner {
  display: block;
  background: #0a0f14;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 0.3rem 1rem;
  text-align: center;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.team-info { display: flex; flex-direction: column; gap: 0.1rem; }
.team-name { font-weight: 700; font-family: var(--font-mono); }
.team-score { font-size: 0.85rem; color: var(--text-muted); }
.team-score strong { color: var(--accent); }

.page-header-actions { display: flex; gap: 0.75rem; align-items: center; }

.logout-form { display: inline; }
.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  padding: 0;
  text-decoration: none;
}
.btn-link:hover { text-decoration: underline; }

/* Banners */
.banner-info {
  background: #1c2d3a;
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}
.banner-warn {
  background: #2d1f00;
  border-left: 3px solid var(--warning);
  color: var(--warning);
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

/* Flash messages */
.msg-error  { color: var(--danger);  font-size: 0.9rem; margin: 0.5rem 0; }
.msg-success{ color: var(--success); font-size: 0.9rem; margin: 0.5rem 0; }

/* Status badges */
.status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}
.status-none      { background: #1f2937; color: var(--text-muted); }
.status-pending   { background: #2d2200; color: var(--warning); }
.status-validated { background: #0d2818; color: var(--success); }
.status-rejected  { background: #2d0d0d; color: var(--danger); }

/* Buttons */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #0d1117;
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1.2rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.5rem;
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-primary:hover:not(:disabled) { opacity: 0.85; }

/* ── Login page ───────────────────────────────────────────────────────────── */

.login-wrap { display: flex; flex-direction: column; min-height: 100vh; }

.login-box {
  flex: 1;
  max-width: 420px;
  margin: 2rem auto;
  padding: 2rem 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.login-box h1 { font-family: var(--font-mono); margin-bottom: 0.5rem; }
.login-hint { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.login-link { margin-top: 1rem; font-size: 0.85rem; text-align: center; }

label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.3rem; }

.code-input, textarea, input[type="text"] {
  display: block;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
}
.code-input:focus, textarea:focus, input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ── Mission list ─────────────────────────────────────────────────────────── */

.mission-list { list-style: none; padding: 0; margin: 0; }

.mission-item { border-bottom: 1px solid var(--border); }
.mission-item:last-child { border-bottom: none; }

.mission-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  color: var(--text);
  text-decoration: none;
}
.mission-link:hover { background: var(--bg-surface); }

.mission-meta { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }

.mission-pos {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 1.5rem;
  text-align: right;
  flex-shrink: 0;
}
.bonus-pos { color: var(--warning); }

.mission-text { min-width: 0; }
.mission-title  { display: block; font-weight: 600; }
.mission-location { display: block; font-size: 0.8rem; color: var(--text-muted); }

.mission-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.mission-points { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ── Mission detail ───────────────────────────────────────────────────────── */

.mission-detail { padding: 1rem; max-width: 680px; margin: 0 auto; }

.mission-header { margin-bottom: 1rem; }
.mission-header h1 { font-size: 1.3rem; margin-bottom: 0.25rem; }
.mission-location-detail { font-size: 0.85rem; color: var(--text-muted); }

.briefing {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}
.briefing p  { margin-bottom: 0.75rem; }
.briefing p:last-child { margin-bottom: 0; }
.briefing strong { color: var(--accent); }
.briefing code   { font-family: var(--font-mono); background: var(--bg); padding: 0.1rem 0.3rem; border-radius: 3px; }

.submission-area { margin-top: 1rem; }
.current-status  { margin-bottom: 0.75rem; }
.feedback { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; font-style: italic; }

.answer-form textarea {
  resize: vertical;
  min-height: 80px;
}

.history { margin-top: 1.5rem; }
.history summary { cursor: pointer; color: var(--text-muted); font-size: 0.85rem; }
.history ul { list-style: none; padding: 0; margin-top: 0.5rem; }
.history-item {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}
.history-answer { display: block; margin-top: 0.25rem; font-family: var(--font-mono); white-space: pre-wrap; }

/* ── Admin layout ─────────────────────────────────────────────────────────── */

.admin-body {
  background: #0d1117;
  color: var(--text);
  font-family: var(--font-sans);
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
  height: 48px;
  background: #161b22;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.admin-nav-brand {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
}

.admin-nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex: 1;
}

.admin-nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.admin-nav-links a:hover, .admin-nav-links a.active {
  color: var(--text);
  text-decoration: none;
}
.admin-nav-links a.active { font-weight: 600; }

.nav-badge {
  background: var(--warning);
  color: #0d1117;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 700;
  border-radius: 10px;
  padding: 0 0.4rem;
  line-height: 1.4;
}

.admin-logout-form { margin-left: auto; }

.admin-main {
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.admin-page-header {
  margin-bottom: 1.25rem;
}
.admin-page-header h1 {
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
}
.admin-subheader { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; }

.admin-flash {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}
.admin-flash-success { background: #0d2818; color: var(--success); border-left: 3px solid var(--success); }
.admin-flash-error   { background: #2d0d0d; color: var(--danger);  border-left: 3px solid var(--danger); }

.admin-empty { color: var(--text-muted); font-size: 0.9rem; padding: 1rem 0; }

/* ── Admin login ──────────────────────────────────────────────────────────── */

.admin-login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.admin-login-box {
  width: 100%;
  max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem 1.5rem;
}
.admin-login-box h1 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.admin-login-hint { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.25rem; }

.btn-block { width: 100%; display: block; text-align: center; }

/* ── Queue (validation file) ─────────────────────────────────────────────── */

.queue-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.queue-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.queue-team   { font-weight: 700; font-family: var(--font-mono); color: var(--accent); }
.queue-sep    { color: var(--text-muted); }
.queue-mission{ font-weight: 600; }
.queue-time   { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.8rem; }
.queue-mode   {
  background: #1c2d3a; color: var(--accent);
  font-size: 0.7rem; font-family: var(--font-mono);
  border-radius: 3px; padding: 0.1rem 0.4rem;
}

.queue-answer {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.queue-expected {
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.queue-expected summary { cursor: pointer; }
.queue-expected pre {
  margin-top: 0.3rem;
  padding: 0.4rem;
  background: var(--bg);
  border-radius: 3px;
  font-family: var(--font-mono);
  white-space: pre-wrap;
}

.decision-form { display: flex; flex-direction: column; gap: 0.5rem; }

.decision-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn-validate {
  flex: 1;
  min-height: 48px;
  background: var(--success);
  color: #0d1117;
  border: none;
  border-radius: 4px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.btn-validate:hover { opacity: 0.85; }

.btn-reject {
  flex: 1;
  min-height: 48px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 4px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.btn-reject:hover { opacity: 0.85; }

.btn-cancel {
  background: #2d2200;
  color: var(--warning);
  border: 1px solid var(--warning);
  border-radius: 4px;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}
.btn-cancel:hover { background: #3d2e00; }

.btn-directvalidate {
  background: var(--accent);
  color: #0d1117;
  border: none;
  border-radius: 4px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
}
.btn-directvalidate:hover { opacity: 0.85; }

.comment-input {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
}
.comment-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.queue-empty {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 2rem 0;
  text-align: center;
}

/* ── Teams grid ──────────────────────────────────────────────────────────── */

.grid-wrap { overflow-x: auto; }

.grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  white-space: nowrap;
}

.grid-table th, .grid-table td {
  border: 1px solid var(--border);
  padding: 0.3rem 0.5rem;
  text-align: center;
  vertical-align: middle;
}

.grid-th-team, .grid-td-team { text-align: left; min-width: 120px; }
.grid-th-score, .grid-td-score { min-width: 50px; font-family: var(--font-mono); }
.grid-th-activity, .grid-td-activity { font-size: 0.78rem; color: var(--text-muted); min-width: 110px; }
.grid-th-mission { min-width: 36px; }

.grid-cell { padding: 0 !important; }
.grid-cell-link {
  display: block;
  padding: 0.3rem 0.5rem;
  color: inherit;
  text-decoration: none;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.grid-none     { background: #1f2937; color: var(--text-muted); }
.grid-pending  { background: #2d2200; color: var(--warning); }
.grid-validated{ background: #0d2818; color: var(--success); }
.grid-rejected { background: #2d0d0d; color: var(--danger);  }

.grid-tfoot td { background: #0d1117; color: var(--text-muted); font-weight: 600; }
.grid-tfoot-count { font-family: var(--font-mono); }
.grid-td-label { text-align: left; font-size: 0.78rem; }

/* ── Team detail ─────────────────────────────────────────────────────────── */

.detail-section { margin-bottom: 2rem; }
.detail-section h2 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--text-muted); }

.dv-list { display: flex; flex-direction: column; gap: 0.5rem; }

.dv-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.dv-mission-name { flex: 1; font-size: 0.9rem; min-width: 120px; }

.inline-form { display: inline; }

.history-admin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.history-admin-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
}
.history-admin-mission { font-weight: 600; }
.history-admin-time    { color: var(--text-muted); font-family: var(--font-mono); }

.by-admin-badge {
  background: #1a1a2e;
  color: #8888ff;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
}

.history-admin-answer {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.4rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.history-admin-feedback {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.4rem;
}

.cancel-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.team-code-mono { font-family: var(--font-mono); }

/* ── Ranking table ───────────────────────────────────────────────────────── */

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ranking-table th, .ranking-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
}
.ranking-table th { background: var(--bg-surface); font-size: 0.82rem; color: var(--text-muted); text-align: left; }

.rank-pos      { font-family: var(--font-mono); font-weight: 700; text-align: center; width: 40px; }
.rank-score    { font-family: var(--font-mono); font-weight: 700; color: var(--accent); text-align: right; width: 70px; }
.rank-tiebreak { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted); }

/* ── Waiting / reglement ──────────────────────────────────────────────────── */

.waiting-box, .reglement-page {
  max-width: 640px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.waiting-box h1 { font-size: 1.4rem; margin-bottom: 0.5rem; font-family: var(--font-mono); }
.waiting-status { color: var(--warning); margin-bottom: 1.5rem; }
.reglement-inline h2, .reglement-page h1 { margin-bottom: 0.75rem; }
.reglement-inline ul, .reglement-page ul {
  padding-left: 1.25rem;
  line-height: 1.9;
  color: var(--text-muted);
}
.reglement-inline li, .reglement-page li { margin-bottom: 0.4rem; }
.reglement-page li strong { color: var(--text); }

/* ── Step 4: common admin utilities ──────────────────────────────────────── */
.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.admin-section-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.admin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.admin-card h2 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--text-muted); }
.admin-card-danger { border-color: var(--danger); }
.admin-info { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.collapsible { margin-top: 0.75rem; }
.collapsible summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; margin-bottom: 0.5rem; }
.inline-form { display: inline; }
.action-cell { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.import-form { margin-bottom: 1rem; }
.file-input-hidden { display: none; }
.code-cell { font-family: var(--font-mono); letter-spacing: 0.05em; }
.row-inactive { opacity: 0.55; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 120px; }
.form-actions { margin-top: 1.25rem; display: flex; gap: 0.5rem; }
.form-actions-inline { display: flex; align-items: flex-end; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); display: block; margin-top: 0.3rem; }
.form-checkbox label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.rename-input { width: 10rem; padding: 0.3rem 0.5rem; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-size: 0.85rem; }
.btn { display: inline-block; padding: 0.5rem 1rem; border-radius: 4px; border: 1px solid var(--border); cursor: pointer; font-size: 0.9rem; font-family: inherit; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--accent); color: #000; border-color: var(--accent); }
.btn-secondary { background: var(--bg-surface); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-small { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-large { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn:hover { opacity: 0.85; text-decoration: none; }
.control-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin-top: 0.75rem; }
.screen-url-line { font-size: 0.9rem; margin-bottom: 0.25rem; word-break: break-all; }
.reset-form .form-group { max-width: 20rem; }
.audit-table { font-size: 0.8rem; }
.audit-time { white-space: nowrap; color: var(--text-muted); }
.audit-detail { word-break: break-word; max-width: 25rem; }
.admin-form .form-group { margin-bottom: 1rem; }
.admin-form label { display: block; font-size: 0.9rem; margin-bottom: 0.4rem; color: var(--text-muted); }
.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form select,
.admin-form textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 0.4rem 0.6rem;
  font-size: 0.95rem;
  font-family: inherit;
}
.admin-form textarea { font-family: var(--font-mono); font-size: 0.85rem; }
.admin-form select { background: var(--bg-surface); }

/* ── Missions table ──────────────────────────────────────────────────────── */
.empty-row { text-align: center; color: var(--text-muted); padding: 1.5rem 0; }

/* ── Screen scoreboard ───────────────────────────────────────────────────── */
.screen-body {
  background: #0a0a0f;
  color: #e8e8ff;
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.screen-header {
  padding: 1.5rem 2rem 1rem;
  border-bottom: 2px solid #2a2a4a;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.screen-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #a0a8ff;
}
.screen-frozen-badge {
  background: #3d2200;
  border: 1px solid #c05000;
  color: #ff9040;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.screen-main {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
}
.screen-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.5rem;
}
.screen-table th {
  text-align: left;
  color: #6060a0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #2a2a4a;
}
.screen-col-rank { width: 4rem; text-align: center; }
.screen-col-score { width: 8rem; text-align: right; }
.screen-row td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #1a1a2e;
  vertical-align: middle;
}
.screen-row td.screen-col-rank { text-align: center; color: #6060a0; }
.screen-row td.screen-col-score { text-align: right; font-family: var(--font-mono); font-weight: 700; color: #a0d0ff; }
.screen-row-top1 td.screen-col-name { color: #ffd700; font-weight: 700; }
.screen-row-top2 td.screen-col-name { color: #c0c8d0; font-weight: 600; }
.screen-row-top3 td.screen-col-name { color: #cd7f32; }
.screen-empty { text-align: center; color: #3a3a5a; padding: 2rem; font-size: 1rem; }
.screen-footer {
  padding: 0.75rem 2rem;
  border-top: 1px solid #2a2a4a;
  font-size: 0.75rem;
  color: #3a3a5a;
  text-align: center;
}

/* ── Print: team sheets ──────────────────────────────────────────────────── */
@media print {
  body { background: #fff; color: #000; }
  .admin-nav, .admin-flash, .no-print { display: none !important; }
  .sheet {
    page-break-after: always;
    break-after: page;
    width: 148mm;
    min-height: 100mm;
    padding: 10mm;
    border: 2px solid #000;
    margin: 5mm auto;
    font-family: var(--font-sans);
  }
  .sheet:last-child { page-break-after: auto; break-after: auto; }
  .sheet-header { text-align: center; border-bottom: 1px solid #000; padding-bottom: 4mm; margin-bottom: 5mm; }
  .sheet-org { font-size: 7pt; color: #333; letter-spacing: 0.1em; text-transform: uppercase; }
  .sheet-title { font-size: 14pt; font-weight: bold; margin: 2mm 0; }
  .sheet-restricted { font-size: 8pt; color: #c00; letter-spacing: 0.1em; }
  .sheet-team-name { font-size: 18pt; font-weight: bold; margin: 4mm 0 2mm; }
  .sheet-code-label, .sheet-url-label { font-size: 8pt; color: #555; margin-top: 3mm; }
  .sheet-code { font-family: var(--font-mono); font-size: 24pt; font-weight: bold; letter-spacing: 0.15em; margin: 1mm 0 3mm; }
  .sheet-url { font-family: var(--font-mono); font-size: 11pt; }
  .sheet-footer { font-size: 7pt; color: #555; border-top: 1px solid #ccc; padding-top: 3mm; margin-top: 5mm; text-align: center; }
  .admin-main { padding: 0; }
}
@media screen {
  .sheet {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    max-width: 400px;
  }
  .sheet-header { border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 0.75rem; text-align: center; }
  .sheet-org { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
  .sheet-title { font-size: 1.1rem; font-weight: 600; }
  .sheet-restricted { font-size: 0.75rem; color: var(--danger); }
  .sheet-team-name { font-size: 1.3rem; font-weight: 700; margin: 0.5rem 0 0.25rem; }
  .sheet-code-label, .sheet-url-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.4rem; }
  .sheet-code { font-family: var(--font-mono); font-size: 1.5rem; font-weight: bold; letter-spacing: 0.15em; }
  .sheet-url { font-family: var(--font-mono); font-size: 0.9rem; color: var(--accent); }
  .sheet-footer { font-size: 0.75rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 0.5rem; margin-top: 0.75rem; text-align: center; }
}

/* ── Step 5: login emblem ────────────────────────────────────────────────── */
.login-emblem {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.login-emblem img { display: block; }

/* ── Archives page ───────────────────────────────────────────────────────── */
.archives-body {
  background: #f5f0e8;
  color: #1a1510;
  font-family: var(--font-sans);
  min-height: 100vh;
  padding: 2rem 1rem 4rem;
}
.archives-wrapper {
  max-width: 760px;
  margin: 0 auto;
  background: #faf8f2;
  border: 1px solid #c8b89a;
  border-top: 4px solid #8a1a1a;
  padding: 2.5rem 2.5rem 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.archives-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  border-bottom: 2px solid #c8b89a;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}
.archives-seal { flex-shrink: 0; }
/* Recolour SVG for the light archives page */
.archives-seal img { filter: invert(1) sepia(0.3) hue-rotate(170deg) saturate(0.6) brightness(0.3); }
.archives-titles { flex: 1; }
.archives-org {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  color: #5a4a3a;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.archives-doc-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1510;
  letter-spacing: 0.05em;
}
.archives-stamp {
  flex-shrink: 0;
  border: 2px solid #8a1a1a;
  color: #8a1a1a;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 0.3rem 0.6rem;
  transform: rotate(5deg);
  align-self: center;
}
.archives-meta {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-bottom: 1.5rem;
  color: #3a2e22;
}
.archives-meta td {
  padding: 0.25rem 0.5rem;
  border: 1px solid #d8c8a8;
}
.archives-meta td:first-child {
  font-weight: 600;
  background: #ede8dc;
  width: 40%;
  white-space: nowrap;
}
.archives-subject {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1510;
  border-left: 3px solid #8a1a1a;
  padding-left: 0.75rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.archives-body-text h3 {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  color: #5a4a3a;
  text-transform: uppercase;
  margin: 1.25rem 0 0.5rem;
  border-bottom: 1px solid #d8c8a8;
  padding-bottom: 0.25rem;
}
.archives-body-text p {
  font-size: 0.92rem;
  line-height: 1.75;
  color: #2a2016;
  text-align: justify;
  margin-bottom: 0.5rem;
}
.archives-body-text code {
  font-family: var(--font-mono);
  background: #ede8dc;
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
  font-size: 0.88rem;
}
.archives-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
  padding-top: 0.75rem;
  border-top: 1px solid #c8b89a;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  color: #7a6a5a;
}

.archives-code-label {
  margin-top: 1.25rem;
  font-weight: 600;
  color: #3a2a1a;
}
.archives-code {
  margin-top: 0.4rem;
  padding: 0.6rem 1rem;
  background: #e8e0d0;
  border: 1px solid #b8a888;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: #1a0a00;
  word-break: break-all;
}

/* Mobile adjustments for archives */
@media (max-width: 600px) {
  .archives-wrapper { padding: 1.25rem 1rem 1.5rem; }
  .archives-header { flex-wrap: wrap; }
  .archives-stamp { transform: none; }
  .archives-footer { flex-direction: column; gap: 0.25rem; }
  .archives-meta td:first-child { width: auto; }
}
