/* Pike Match Scoring
 * Mobile-first. High contrast, large targets - this gets used outdoors in
 * poor light with cold hands. Respects the phone's light/dark setting.
 *
 * Look: lakeside scoreboard. Deep water header, condensed scoreboard type
 * for names and weights, medal colours for the podium.
 *
 * CSP note: style-src and font-src are 'self', so fonts are self-hosted and
 * nothing here may reference another origin. data: URIs are allowed for
 * images/masks (img-src includes data:).
 */

@font-face {
  font-family: "Barlow Condensed";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-600.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-700.woff2") format("woff2");
}

:root {
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;

  --bg: #eef1f7;
  --bg-2: #e2e7f1;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --ink: #0f1a33;
  --ink-soft: #56607a;
  --line: #d6dcea;

  --accent: #012169;          /* Union flag navy */
  --accent-2: #1f4fbf;        /* royal blue */
  --accent-ink: #ffffff;
  --accent-tint: rgba(1, 33, 105, 0.08);
  --red: #c8102e;             /* Union flag red */
  --red-ink: #ffffff;

  --deep-1: #000d2e;          /* header gradient: midnight -> flag navy -> royal */
  --deep-2: #012169;
  --deep-3: #1f4fbf;

  --water-1: #9dbcf5;         /* back wave, shallow */
  --water-2: #3b67c9;         /* middle wave */
  --water-deep: #0c2a73;      /* front wave + footer fill */

  --ok: #1a7f4b;
  --warn: #9a6400;
  --error: #b02525;
  --pending: #8a6400;

  --gold: #c8962a;   --gold-tint: rgba(200, 150, 42, 0.13);
  --silver: #8e9aa5; --silver-tint: rgba(142, 154, 165, 0.14);
  --bronze: #ad6a3b; --bronze-tint: rgba(173, 106, 59, 0.12);

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(8, 20, 55, 0.06), 0 8px 24px -8px rgba(8, 20, 55, 0.16);
  --shadow-lift: 0 2px 4px rgba(8, 20, 55, 0.08), 0 14px 32px -10px rgba(8, 20, 55, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090e1b;
    --bg-2: #0c1325;
    --surface: #121a2e;
    --surface-2: #172139;
    --ink: #e8ecf6;
    --ink-soft: #9ba6c0;
    --line: #26314e;

    --accent: #7d9df2;
    --accent-2: #5b80e6;
    --accent-ink: #050b1a;
    --accent-tint: rgba(125, 157, 242, 0.12);
    --red: #e8384f;
    --red-ink: #ffffff;

    --deep-1: #000818;
    --deep-2: #0a1f5c;
    --deep-3: #183a8c;

    --water-1: #22428f;
    --water-2: #163070;
    --water-deep: #0a1a45;

    --ok: #46c489;
    --warn: #e0ad4a;
    --error: #f07a7a;
    --pending: #e0ad4a;

    --gold: #e2b54a;   --gold-tint: rgba(226, 181, 74, 0.14);
    --silver: #b4bfc8; --silver-tint: rgba(180, 191, 200, 0.12);
    --bronze: #d08a58; --bronze-tint: rgba(208, 138, 88, 0.13);

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.5), 0 14px 32px -10px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  /* Column layout pins the water footer to the bottom on short pages. */
  display: flex; flex-direction: column;
  color: var(--ink);
  font: 16px/1.5 var(--font-body);
  -webkit-text-size-adjust: 100%;
  background:
    radial-gradient(1200px 500px at 85% -10%, var(--accent-tint), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
}

a { color: var(--accent); }

/* --- Header ------------------------------------------------------------ */

.topbar {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  padding: 14px 16px 32px;
  padding-top: max(19px, calc(env(safe-area-inset-top) + 8px));
  color: #fff;
  background:
    radial-gradient(600px 160px at 15% 0%, rgba(255, 255, 255, 0.10), transparent 70%),
    radial-gradient(500px 200px at 95% 120%, rgba(120, 220, 210, 0.18), transparent 70%),
    linear-gradient(120deg, var(--deep-1) 0%, var(--deep-2) 55%, var(--deep-3) 100%);
}
/* Wave edge: a mask cut from the page background colour, so it follows the
 * light/dark theme without a second SVG. */
/* Red-white-blue ribbon across the very top, a nod to the flag. */
.topbar::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px;
  background: linear-gradient(90deg, var(--red) 0 33.33%, #fff 33.33% 66.66%, #3b67c9 66.66% 100%);
}
.topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 18px;
  background: var(--bg);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 18' preserveAspectRatio='none'%3E%3Cpath d='M0 18V9c100 0 100-8 200-8s100 8 200 8 100-8 200-8 100 8 200 8 100-8 200-8 100 8 200 8v9z'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 18' preserveAspectRatio='none'%3E%3Cpath d='M0 18V9c100 0 100-8 200-8s100 8 200 8 100-8 200-8 100 8 200 8 100-8 200-8 100 8 200 8v9z'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}

/* British Pike Squad banner (728x173 source, ~4.2:1), full width of the
 * content column - edge to edge on a phone. */
.brand { display: block; width: 100%; max-width: 748px; color: inherit; text-decoration: none; }
.brand-banner {
  display: block; width: 100%; height: auto; aspect-ratio: 728 / 173;
  border-radius: 12px;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.28), 0 10px 24px -8px rgba(0, 0, 0, 0.6);
}

.nav { display: flex; gap: 4px; align-items: center; justify-content: center; flex-wrap: wrap; }
.nav a {
  color: inherit; text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 7px 12px; border-radius: 999px;
  transition: background-color 0.15s ease;
}
.nav a:hover { background: rgba(255, 255, 255, 0.12); }
.nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.95); color: var(--deep-2); font-weight: 700;
}
.nav .muted { opacity: 0.75; }

.badge {
  display: inline-block; min-width: 19px; margin-left: 6px; padding: 1px 6px;
  background: var(--red); color: var(--red-ink);
  border-radius: 9px; font-size: 12px; font-weight: 800; text-align: center;
  line-height: 17px; vertical-align: 1px;
}

.wrap { max-width: 780px; width: 100%; margin: 0 auto; padding: 18px 16px; flex: 1 0 auto; }

/* --- Water footer -------------------------------------------------------
 * Three wave layers drift at different speeds and directions (parallax),
 * and the footer text sits in the deep water below them. Each wave is a
 * seamless 1-period-repeating mask tile; the element is one tile wider than
 * the screen and slides exactly one tile, so the loop never jumps.
 * Only transform is animated, so it stays on the GPU and cheap on phones.
 */
.foot {
  position: relative; overflow: hidden;
  width: 100%; margin: 40px 0 0;
  padding: 128px 16px max(30px, env(safe-area-inset-bottom));
  color: rgba(255, 255, 255, 0.85); font-size: 13px; text-align: center;
  background: linear-gradient(180deg,
    transparent 0, transparent 119px,
    var(--water-deep) 119px, var(--deep-1) 100%);
}
.foot p { position: relative; margin: 0; }
.foot p::before {
  content: ""; display: block; width: 46px; height: 3px; margin: 0 auto 12px;
  border-radius: 3px; background: var(--red);
}

.water { position: absolute; left: 0; right: 0; top: 0; height: 120px; pointer-events: none; }
.wave {
  --tile: 1200px;
  position: absolute; left: 0; bottom: 0;
  width: calc(100% + var(--tile));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0 40Q150 10 300 40T600 40T900 40T1200 40V100H0z'/%3E%3C/svg%3E") 0 0 / var(--tile) 100% repeat-x;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0 40Q150 10 300 40T600 40T900 40T1200 40V100H0z'/%3E%3C/svg%3E") 0 0 / var(--tile) 100% repeat-x;
  will-change: transform;
  animation: flow 20s linear infinite;
}
.wave-back  { --tile: 1400px; height: 120px; background: var(--water-1); opacity: 0.55; animation-duration: 28s; animation-direction: reverse; }
.wave-mid   { --tile: 1000px; height: 92px;  background: var(--water-2); opacity: 0.8;  animation-duration: 19s; }
.wave-front { --tile: 1200px; height: 64px;  background: var(--water-deep); animation-duration: 13s; }

@keyframes flow {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(calc(-1 * var(--tile)), 0, 0); }
}

/* --- Type -------------------------------------------------------------- */

h1, h2 {
  font-family: var(--font-display); font-weight: 700;
  letter-spacing: 0.01em; line-height: 1.1;
}
h1 { font-size: 30px; margin: 0 0 6px; }
h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: 21px; margin: 0 0 14px; text-transform: uppercase; letter-spacing: 0.04em;
}
h2::before {
  content: ""; width: 4px; height: 18px; border-radius: 2px; flex-shrink: 0;
  background: var(--red);
}
.sub { color: var(--ink-soft); margin: 0 0 12px; font-size: 14px; }
.hint { color: var(--ink-soft); font-size: 13px; margin: 6px 0 0; }

/* --- Cards ------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.card-narrow { max-width: 440px; margin-left: auto; margin-right: auto; }

/* Match banner: the hero at the top of Submit and Leaderboard. */
.match-head {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  color: #fff; border: 0;
  background:
    radial-gradient(400px 180px at 100% 0%, rgba(255, 255, 255, 0.14), transparent 70%),
    linear-gradient(135deg, var(--deep-2) 0%, var(--deep-3) 100%);
  box-shadow: var(--shadow-lift), inset 0 -5px 0 var(--red), inset 0 -7px 0 #fff;
}
/* Faint pike silhouette watermark */
.match-head::after {
  content: ""; position: absolute; right: -30px; bottom: -36px;
  width: 260px; height: 130px; opacity: 0.10; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 32'%3E%3Cpath d='M2 16C12 6 28 4 40 10l9-7 2 13-2 13-9-7C28 28 12 26 2 16z' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat;
}
.match-head > * { position: relative; z-index: 1; }
.match-head h1 { color: #fff; font-size: 32px; }
.match-head .sub { color: rgba(255, 255, 255, 0.82); margin-bottom: 0; }
.match-head .sub:empty { display: none; }

.running { text-align: right; flex-shrink: 0; }
.running-label {
  display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.78);
}
.running-value {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums;
}

.live-dot {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.12em;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.16); color: rgba(255, 255, 255, 0.85);
}
.live-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor;
}
.live-dot.is-live { background: #fff; color: #c42b2b; }
.live-dot.is-live::before { animation: pulse 1.6s ease-out infinite; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(196, 43, 43, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(196, 43, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(196, 43, 43, 0); }
}

/* --- Forms ------------------------------------------------------------- */

label {
  display: block; margin: 16px 0 6px;
  font-size: 14px; font-weight: 650;
}
.req {
  margin-left: 4px; padding: 1px 7px; border-radius: 999px;
  background: rgba(176, 37, 37, 0.10); color: var(--error);
  font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
}
.opt { margin-left: 4px; color: var(--ink-soft); font-weight: 400; font-size: 12px; }

input[type="text"], input[type="password"], input[type="number"],
input[type="datetime-local"], input[type="file"], textarea {
  width: 100%; padding: 13px 14px;
  font: inherit; color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
input:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
input:focus, textarea:focus {
  outline: none; background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-tint);
}
button:focus-visible, a:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
/* 16px minimum stops iOS zooming the viewport on focus. */
input, textarea, button, select { font-size: 16px; }

/* Big, friendly weight boxes on the submit form */
#weight_lb, #weight_oz {
  font-family: var(--font-display); font-weight: 700; font-size: 30px;
  text-align: center; padding: 10px; font-variant-numeric: tabular-nums;
}

input[type="file"] { padding: 10px; cursor: pointer; }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 9px 14px;
  font: inherit; font-weight: 650; font-size: 14px;
  color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: 8px; cursor: pointer;
}

.weight-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
/* Date pickers have a large intrinsic min-width; without this they spill out of the card on phones. */
.weight-row > div, .weight-row input { min-width: 0; }
input[type="datetime-local"] { -webkit-appearance: none; appearance: none; min-height: 50px; font-size: 15px; }
.weight-row label { margin-top: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 18px;
  font-weight: 700; border: 1.5px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; text-align: center; text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.15s ease, filter 0.15s ease, background-color 0.15s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-block { width: 100%; margin-top: 20px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--deep-2), var(--accent-2));
  box-shadow: 0 6px 16px -6px rgba(1, 33, 105, 0.55);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-family: var(--font-display); font-size: 19px;
}
.btn-primary.btn-sm { font-family: var(--font-body); font-size: 13px; text-transform: none; letter-spacing: 0; box-shadow: none; }
.btn-approve { background: var(--ok); color: #fff; flex: 1; }
.btn-reject { background: var(--error); color: #fff; flex: 1; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); filter: none; }

/* --- Flashes and status ------------------------------------------------ */

.flash {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px;
  font-size: 14px; font-weight: 500; border: 1px solid; border-left-width: 5px;
  background: var(--surface); box-shadow: var(--shadow);
}
.flash-ok    { border-color: var(--ok);    color: var(--ok); }
.flash-error { border-color: var(--error); color: var(--error); }

.submit-status { margin-top: 12px; font-size: 14px; min-height: 1.4em; text-align: center; }
.submit-status.is-working { color: var(--ink-soft); }
.submit-status.is-ok      { color: var(--ok); font-weight: 700; }
.submit-status.is-error   { color: var(--error); font-weight: 700; }

/* --- Catch list -------------------------------------------------------- */

.catch-list { list-style: none; margin: 0; padding: 0; }
.catch-item {
  display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.catch-item:last-child { border-bottom: 0; }
.ci-weight {
  font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.1;
  font-variant-numeric: tabular-nums; min-width: 95px;
}
.ci-time { color: var(--ink-soft); font-size: 13px; }
.ci-status {
  margin-left: auto; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--surface-2); color: var(--ink-soft);
}
.ci-note {
  flex-basis: 100%; font-size: 13px; color: var(--ink-soft);
  padding: 8px 12px; border-radius: 8px; background: var(--surface-2);
}

.status-pending  .ci-status { color: var(--pending); background: rgba(224, 173, 74, 0.16); }
.status-approved .ci-status { color: var(--ok);      background: rgba(26, 127, 75, 0.12); }
.status-rejected .ci-status { color: var(--error);   background: rgba(176, 37, 37, 0.10); }
.status-rejected .ci-note   { color: var(--error); }

/* --- Leaderboard ------------------------------------------------------- */

.board { width: 100%; border-collapse: separate; border-spacing: 0 6px; margin-top: -6px; }
.board th {
  padding: 4px 10px; text-align: left;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-soft);
}
.board td {
  padding: 12px 10px; text-align: left; vertical-align: middle;
  background: var(--surface-2);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.board td:first-child  { border-left: 1px solid var(--line); border-radius: 12px 0 0 12px; }
.board td:last-child   { border-right: 1px solid var(--line); border-radius: 0 12px 12px 0; }

.board .c-pos { width: 52px; }
.board .c-fish { width: 56px; text-align: center; font-variant-numeric: tabular-nums; color: var(--ink-soft); font-weight: 600; }
.board th.c-fish { text-align: center; }
.board .c-weight {
  width: 120px; text-align: right; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.board th.c-weight { text-align: right; font-family: var(--font-body); font-size: 11px; }

.pos-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  color: var(--ink-soft); background: var(--surface); border: 1.5px solid var(--line);
}
.angler-name { font-weight: 650; }
.angler-no {
  display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--ink-soft); border: 1px solid var(--line); vertical-align: 1px;
}

/* Podium */
.board .pos-1 td { background: var(--gold-tint);   border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.board .pos-2 td { background: var(--silver-tint); border-color: color-mix(in srgb, var(--silver) 45%, transparent); }
.board .pos-3 td { background: var(--bronze-tint); border-color: color-mix(in srgb, var(--bronze) 45%, transparent); }
.board .pos-1 .pos-badge { color: #3a2800; border: 0; background: linear-gradient(145deg, #f7dc8a, var(--gold)); box-shadow: 0 3px 8px -2px rgba(200, 150, 42, 0.7); }
.board .pos-2 .pos-badge { color: #1f262c; border: 0; background: linear-gradient(145deg, #eef2f5, var(--silver)); box-shadow: 0 3px 8px -2px rgba(142, 154, 165, 0.7); }
.board .pos-3 .pos-badge { color: #2d1505; border: 0; background: linear-gradient(145deg, #f0c09a, var(--bronze)); box-shadow: 0 3px 8px -2px rgba(173, 106, 59, 0.7); }
.board .pos-1 .c-weight { color: var(--gold); font-size: 28px; }
.board .pos-1 .angler-name { font-size: 17px; }
@media (prefers-color-scheme: light) {
  .board .pos-1 .c-weight { color: #9a6f12; }
}
.board .is-blank td { opacity: 0.6; }

.board .loading { color: var(--ink-soft); text-align: center; padding: 26px 0; background: transparent; border: 0; }

.chip {
  display: inline-block; margin-left: 8px; padding: 1px 8px;
  background: rgba(224, 173, 74, 0.18); color: var(--pending);
  border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap;
  vertical-align: 1px;
}
.board-meta {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 10px 2px 0; font-size: 12px; color: var(--ink-soft);
}

/* --- Review ------------------------------------------------------------ */

.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 8px 16px; border-radius: 999px; text-decoration: none;
  background: var(--surface); color: var(--ink-soft);
  border: 1.5px solid var(--line); font-size: 14px; font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.tab:hover { border-color: var(--accent); color: var(--accent); }
.tab.is-active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--deep-2), var(--accent-2));
}

.review-card { transition: opacity 0.3s ease; border-top: 4px solid var(--pending); }
.rc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rc-angler { font-weight: 700; font-size: 18px; }
.rc-number {
  margin-left: 8px; padding: 0 6px; border-radius: 5px;
  font-size: 11px; font-weight: 700; color: var(--ink-soft); border: 1px solid var(--line);
}
.rc-weight {
  font-family: var(--font-display); font-size: 32px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--accent);
}

.rc-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.rc-photos figure { margin: 0; }
.rc-photos a { display: block; border-radius: var(--radius-sm); overflow: hidden; }
.rc-photos img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg);
  transition: transform 0.25s ease;
}
.rc-photos a:hover img { transform: scale(1.03); }
.rc-photos figcaption {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-soft); margin-top: 6px;
}

.rc-meta {
  margin: 16px 0 0; padding: 10px 14px; font-size: 14px;
  background: var(--surface-2); border-radius: var(--radius-sm);
}
.rc-meta > div { display: flex; gap: 8px; padding: 4px 0; flex-wrap: wrap; }
.rc-meta > div + div { border-top: 1px dashed var(--line); }
.rc-meta dt { color: var(--ink-soft); min-width: 130px; }
.rc-meta dd { margin: 0; font-weight: 500; }
.rc-flags dd { color: var(--warn); font-weight: 700; }

.rc-actions { margin-top: 16px; }
.rc-buttons { display: flex; gap: 10px; margin-top: 10px; }

/* --- Sign in / sign up -------------------------------------------------- */

.page-login .wrap { padding-top: 26px; }
.page-login .card-narrow { border-top: 4px solid var(--red); }
.page-login h1 { text-align: center; }
.page-login .card-narrow > .sub { text-align: center; }

/* --- Admin utilities ---------------------------------------------------
 * These exist as classes rather than style="" attributes because the CSP
 * sets style-src 'self' - inline style attributes are blocked outright.
 */

.row-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.mt-lg { margin-top: 26px; }
.ci-label { font-family: var(--font-body); font-size: 16px; font-weight: 700; min-width: auto; }

.check-row {
  display: flex; gap: 12px; align-items: center;
  font-weight: 500; margin: 0; padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease;
}
.check-row:hover { background: var(--surface-2); }
.check-row input[type="checkbox"] {
  width: auto; margin: 0; flex-shrink: 0;
  /* Comfortable target for a gloved finger */
  min-width: 22px; min-height: 22px;
  accent-color: var(--accent);
}

select.field {
  width: 100%; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink); font: inherit;
}

/* Compact role picker in the admin user list. 16px font stops iOS zooming on focus. */
.select-sm {
  padding: 5px 8px; font: inherit; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--ink);
  accent-color: var(--accent);
}
.role-label { margin: 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }

/* Honeypot on the sign-up form: off-screen for people, still "visible" to bots. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* --- Small screens ----------------------------------------------------- */

@media (max-width: 520px) {
  .topbar { padding: 12px 12px 30px; gap: 10px; }
  .brand-banner { border-radius: 10px; }
  .nav { gap: 2px; }
  .nav a { padding: 6px 10px; font-size: 14px; }
  .card { padding: 16px; }
  h1 { font-size: 27px; }
  .match-head h1 { font-size: 28px; }
  .board td { padding: 10px 7px; }
  .board .c-pos { width: 44px; }
  .board .c-fish { width: 40px; }
  .board .c-weight { width: auto; font-size: 21px; }
  .board .pos-1 .c-weight { font-size: 24px; }
  .angler-no { display: none; }
}

@media (max-width: 420px) {
  .match-head { flex-direction: column; }
  .running { text-align: left; }
  .row-actions { margin-left: 0; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Review card for the reviewer's own catch: no buttons, just this. */
.rc-own {
  margin: 16px 0 0; padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  background: var(--surface-2); border: 1.5px dashed var(--line);
}

/* --- Witnesses --------------------------------------------------------- */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hint-warn { color: var(--warn); font-weight: 600; }

/* Line under each of "Your catches today" */
.ci-witness {
  flex-basis: 100%; font-size: 13px; font-weight: 600;
  padding-left: 12px; border-left: 3px solid var(--line); color: var(--ink-soft);
}
.ci-witness.witness-pending   { border-left-color: var(--pending); color: var(--pending); }
.ci-witness.witness-confirmed { border-left-color: var(--ok);      color: var(--ok); }
.ci-witness.witness-declined  { border-left-color: var(--error);   color: var(--error); }
.ci-rewitness { flex-basis: 100%; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ci-rewitness .select-sm { flex: 1 1 180px; min-width: 0; }

/* Witness row on the committee review card */
.rc-witness.witness-pending   dd { color: var(--pending); font-weight: 700; }
.rc-witness.witness-confirmed dd { color: var(--ok); font-weight: 700; }
.rc-witness.witness-declined  dd { color: var(--error); font-weight: 800; }
.rc-witness.witness-overridden dd { color: var(--warn); font-weight: 700; }

/* Witness request cards: top edge shows where it stands */
.witness-card.witness-confirmed  { border-top-color: var(--ok); }
.witness-card.witness-declined   { border-top-color: var(--error); }
.witness-card.witness-overridden { border-top-color: var(--line); }

/* Admin override tucked away so it isn't the obvious button */
.rc-override { margin-top: 14px; font-size: 14px; }
.rc-override summary { cursor: pointer; color: var(--ink-soft); font-weight: 600; padding: 6px 0; }
.rc-override form { display: grid; gap: 8px; padding-top: 4px; }
.rc-override label { margin: 0; }
.rc-override .btn { justify-self: start; }

/* --- Photo capture-time checks on the review card ---------------------- */

.review-card.has-time-alert { border-top-color: var(--error); }
.time-alert {
  margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 14px; border: 1.5px solid; border-left-width: 6px;
}
.time-alert strong { display: block; margin-bottom: 4px; }
.time-alert ul { margin: 0; padding-left: 18px; }
.time-alert li { margin: 2px 0; }
.time-alert-window { display: block; margin-top: 6px; font-size: 12px; opacity: 0.85; }
.time-alert-bad {
  color: var(--error); border-color: var(--error);
  background: color-mix(in srgb, var(--error) 9%, var(--surface));
}
.time-alert-bad strong { text-transform: uppercase; letter-spacing: 0.04em; }
.time-alert-warn {
  color: var(--warn); border-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 9%, var(--surface));
}
.rc-photos figcaption.photo-time-before,
.rc-photos figcaption.photo-time-after { color: var(--error); font-weight: 800; }
.rc-photos figcaption.photo-time-nodate { color: var(--warn); font-weight: 700; }
.rc-photos figcaption.photo-time-ok { color: var(--ok); }
