/* NISWARC FoxHunt. Colors come from the radio fox artwork. System fonts only,
   so pages stay quick on one bar of signal out in the park. */

:root {
    --bg: #f7f1e6;
    --surface: #fffdf8;
    --ink: #1f2b36;
    --muted: #55616c;
    --line: #e2d8c6;
    --fox: #b9481a;
    --fox-hover: #9c3b13;
    --on-fox: #ffffff;
    --slate: #2f4a60;
    --slate-art: #506c81;
    --quiet: #e9e1d2;
    --quiet-hover: #dfd4c1;
    --ok-bg: #dff1e5;
    --ok-ink: #14572f;
    --bad-bg: #fbe3e0;
    --bad-ink: #8f1d15;
    --mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #141c24;
        --surface: #1d2833;
        --ink: #f2ece0;
        --muted: #aab5bf;
        --line: #33424f;
        --fox: #f08a4b;
        --fox-hover: #f6a26d;
        --on-fox: #1f1208;
        --quiet: #2b3844;
        --quiet-hover: #364654;
        --ok-bg: #173526;
        --ok-ink: #a6e3bf;
        --bad-bg: #40201d;
        --bad-ink: #f6b8b1;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 17px/1.6 var(--sans);
    -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 800; }
h2 { font-size: 1.4rem; font-weight: 750; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--fox); text-underline-offset: 2px; }
a:hover { color: var(--fox-hover); }
ul { margin: 0; padding-left: 1.2em; }
li { margin-bottom: 0.4em; }
:focus-visible { outline: 3px solid var(--fox); outline-offset: 2px; }

.wrap { width: min(1000px, 100%); margin: 0 auto; padding: 0 16px; }
.page { padding-top: 28px; padding-bottom: 40px; }
.narrow { width: min(540px, 100%); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

.eyebrow {
    margin: 0 0 0.4em;
    font: 700 0.8rem/1.3 var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fox);
}

/* Header */
.site-header { background: var(--slate); color: #fff; }
.site-header .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 20px;
    padding-top: 8px;
    padding-bottom: 8px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}
.brand:hover { color: #fff; }
.brand span { font-weight: 500; opacity: 0.85; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 -10px; }
.site-header nav a {
    padding: 8px 10px;
    color: #fff;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: 6px;
}
.site-header nav a:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.site-header nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 #f08a4b; }

/* Hero: rings spread out from the fox's antenna, like the arcs in the artwork */
.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        repeating-radial-gradient(circle at 62% 30%, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 46px),
        linear-gradient(100deg, var(--slate) 35%, var(--slate-art) 75%);
}
.hero .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: end;
    gap: 16px;
}
.hero-text { padding: 44px 0; align-self: center; }
.hero h1 { color: #fff; margin-bottom: 0.3em; }
.hero .eyebrow { color: #ffc7a3; }
.hero-art { display: block; width: 100%; max-width: 440px; justify-self: end; }
.hero-art img {
    display: block;
    width: 100%;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%);
    mask-image: linear-gradient(90deg, transparent, #000 14%);
}

.next-hunt {
    margin: 20px 0;
    padding: 16px 18px;
    border-left: 4px solid #f08a4b;
    background: rgba(13, 25, 36, 0.42);
    border-radius: 0 10px 10px 0;
}
.next-hunt .eyebrow { margin-bottom: 0.25em; }
.next-hunt strong { display: block; font-size: 1.2rem; line-height: 1.3; }
.countdown { display: block; margin-top: 8px; font: 700 1.05rem/1.3 var(--mono); color: #ffc7a3; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 20px;
    border: 0;
    border-radius: 10px;
    background: var(--fox);
    color: var(--on-fox);
    font: 700 1rem/1.2 var(--sans);
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: var(--fox-hover); color: var(--on-fox); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-quiet { background: var(--quiet); color: var(--ink); }
.btn-quiet:hover { background: var(--quiet-hover); color: var(--ink); }
.btn-on-dark { background: rgba(255, 255, 255, 0.16); color: #fff; }
.btn-on-dark:hover { background: rgba(255, 255, 255, 0.26); color: #fff; }
.btn-block { width: 100%; }
.hero .btn:not(.btn-on-dark) { background: #f08a4b; color: #1f1208; }
.hero .btn:not(.btn-on-dark):hover { background: #f6a26d; }

/* Cards */
.card {
    margin-bottom: 18px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.card-fox { border-top: 4px solid var(--fox); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-2 .card { margin-bottom: 0; }
.stack > * + * { margin-top: 18px; }
.stack > .card { margin-bottom: 0; }

.found-fox { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; align-items: start; }

.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: 10px 0; border-top: 1px solid var(--line); margin: 0; }
.link-list li:first-child { border-top: 0; padding-top: 0; }
.link-list li:last-child { padding-bottom: 0; }

/* Forms */
label { display: block; margin: 16px 0 6px; font-weight: 700; }
input[type=text], input[type=password], input[type=url], input[type=date], input[type=time], textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font: 1.05rem/1.3 var(--sans);
}
input:focus, textarea:focus { outline: none; border-color: var(--fox); }
#foxcode { font-family: var(--mono); letter-spacing: 0.04em; }
.bot-trap { position: absolute; left: -9999px; height: 1px; overflow: hidden; }

.message { display: none; margin: 14px 0 0; padding: 12px; border-radius: 10px; font-weight: 600; text-align: center; }
.message.show { display: block; }
.message.success { background: var(--ok-bg); color: var(--ok-ink); }
.message.error { background: var(--bad-bg); color: var(--bad-ink); }

#qr-reader { margin-top: 14px; border-radius: 10px; overflow: hidden; background: #000; }

/* Events */
.event-when { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 1.1rem; }
.event-text { white-space: pre-line; }
.event-map { margin: 20px 0 0; }
.event-map img { display: block; width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.event-map figcaption { margin-top: 6px; font-size: 0.9rem; color: var(--muted); }
.past { margin-top: 24px; color: var(--muted); }
.past summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.past-event { display: flex; flex-wrap: wrap; gap: 0 12px; padding: 8px 0; border-top: 1px solid var(--line); }

/* How it works */
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.split img { border-radius: 8px; }
.rules li { margin-bottom: 0.9em; }

/* Reported */
.done { text-align: center; }
.done .big-count { display: block; font: 800 3.4rem/1.1 var(--mono); color: var(--fox); }
.done .actions { justify-content: center; }

/* Footer */
.site-footer { padding: 18px 0 28px; color: var(--muted); font-size: 0.9rem; text-align: center; }
.site-footer a { margin-left: 8px; color: var(--muted); }

/* Leaderboard: a dark display board, big enough to read on a screen at base */
.board-page { --bg: #101820; --surface: #182430; --ink: #f4efe6; --muted: #a9b4be; --line: #2e3d4b; --fox: #f08a4b; color-scheme: dark; }
.board-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 16px; }
.board-head h1 { margin: 0; }
.board-status { font: 0.9rem/1.3 var(--mono); color: var(--muted); }
.board-status.live::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 7px;
    border-radius: 50%;
    background: #57d38c;
}
.board-status.lost { color: #ffb4a8; }
.board-rows { list-style: none; margin: 0; padding: 0; }
.board-row {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.board-row.top { border-color: var(--fox); }
.board-rank { font: 800 1.5rem/1 var(--mono); color: var(--muted); }
.board-row.top .board-rank { color: var(--fox); }
.board-name { font-size: 1.25rem; font-weight: 750; overflow-wrap: anywhere; }
.board-found { font: 800 1.7rem/1 var(--mono); text-align: right; }
.board-time { grid-column: 2; font: 0.9rem/1.3 var(--mono); color: var(--muted); }
.board-pips { grid-column: 3; display: flex; justify-content: flex-end; gap: 3px; }
.board-pips i { width: 8px; height: 8px; border-radius: 50%; background: var(--fox); }
.board-empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.board-note { margin-top: 16px; font-size: 0.9rem; color: var(--muted); }

/* Admin */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; border-bottom: 2px solid var(--line); }
.tab-btn {
    padding: 10px 14px;
    border: 0;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: var(--ink);
    font: 600 1rem/1.2 var(--sans);
    cursor: pointer;
}
.tab-btn:hover { background: var(--quiet); }
.tab-btn.active { background: var(--slate); color: #fff; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-size: 0.82rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); }
.btn-small { min-height: 34px; padding: 5px 10px; border-radius: 7px; font-size: 0.85rem; }
.btn-danger { background: #b3261e; color: #fff; }
.btn-danger:hover { background: #8f1d15; color: #fff; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--quiet); font: 600 0.85rem/1.6 var(--mono); }
.tag-warn { margin-left: 6px; background: var(--bad-bg); color: var(--bad-ink); font-family: var(--sans); }
.fox-tally { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.event-row { padding: 12px 0; border-top: 1px solid var(--line); }
.event-row:first-child { border-top: 0; }
.modal { position: fixed; inset: 0; z-index: 999; display: flex; justify-content: center; align-items: center; padding: 16px; background: rgba(0, 0, 0, 0.55); }
.modal-box { width: 100%; max-width: 500px; max-height: 100%; overflow-y: auto; padding: 22px; background: var(--surface); border-radius: 12px; }
.modal-box textarea { height: 140px; }
#qr-container { margin-top: 18px; text-align: center; }
#qr-container img { display: block; margin: 0 auto; width: 300px; max-width: 100%; border: 1px solid var(--line); background: #fff; }
.qr-foxid { margin-top: 12px; font: 800 2.2rem/1.2 var(--mono); }
#printable-foxlist { display: none; }

.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login .card { width: min(360px, 100%); margin: 0; }

/* Printing from Admin: results.php sets one of these classes just before printing */
@media print {
    body { background: #fff; color: #000; }
    body.print-qr * { visibility: hidden; }
    body.print-qr #printable-qr, body.print-qr #printable-qr * { visibility: visible; }
    body.print-qr #printable-qr { position: fixed; top: 1.5in; left: 0; right: 0; text-align: center; }
    body.print-foxlist > *:not(#printable-foxlist) { display: none; }
    body.print-foxlist #printable-foxlist { display: block; }
    #printable-foxlist table { width: 100%; border-collapse: collapse; }
    #printable-foxlist th, #printable-foxlist td { border: 1px solid #000; padding: 8px; text-align: left; }
}

@media (max-width: 720px) {
    .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .hero-text { padding: 28px 0 8px; }
    .hero-art { max-width: 320px; margin: 0 auto; justify-self: center; }
    .hero-art img {
        -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 56%, transparent 71%);
        mask-image: radial-gradient(circle at 50% 50%, #000 56%, transparent 71%);
    }
    .site-header nav { margin: 0 -7px; }
    .site-header nav a { padding: 7px; font-size: 0.875rem; white-space: nowrap; }
    .site-header nav a[href^="mailto"] { display: none; }   /* it's in the footer */
    .grid-2, .split { grid-template-columns: minmax(0, 1fr); }
    .found-fox { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; }
    .card { padding: 18px; }
    .btn-block-sm { width: 100%; }
}

/* Fox List frequency tools */
.section-gap { margin-top: 28px; }
select { width: 100%; padding: 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: 1.05rem/1.3 var(--sans); }
#fox_freq_check .message, #freq-check-result .message { margin: 8px 0 0; font-weight: 500; text-align: left; }

/* Events */
.event-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 16px; }
.event-picker label { margin: 0; }
.event-picker select { flex: 1; min-width: 220px; width: auto; }
#no-active { margin: 0 0 16px; }
.tag-live { background: var(--ok-bg); color: var(--ok-ink); font-family: var(--sans); }
.board + .board { margin-top: 28px; }
.board-title { font-size: 1.25rem; margin: 0 0 10px; }
.past-event a { margin-left: auto; }

/* NISWARC: black, orange and green from the club banner */
:root { --slate: #0b0f11; --fox: #bf4f0d; --fox-hover: #a14209; --club-green: #6cc04a; }
@media (prefers-color-scheme: dark) {
    :root { --bg: #0f1417; --surface: #171e22; --line: #2b363c; --fox: #f47b20; --fox-hover: #f79a55; --on-fox: #1a0e05; }
}
.board-page { --bg: #0b0f11; --surface: #151c20; --line: #2b363c; --fox: #f47b20; }
.site-header nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 #f47b20; }
.brand img { border-radius: 6px; }
.hero { background: #0b0f11; }
.hero-banner { display: block; width: 100%; max-width: 1983px; margin: 0 auto; }
.hero .wrap { display: block; }
.hero-text { padding: 24px 0 32px; }
.hero h1 { margin-bottom: 0.2em; }
.hero .eyebrow { color: #8fd46b; }
.next-hunt { border-left-color: var(--club-green); background: #151c20; }
.countdown { color: #8fd46b; }
.hero .btn:not(.btn-on-dark) { background: #f47b20; color: #1a0e05; }
.hero .btn:not(.btn-on-dark):hover { background: #f79a55; }
.board-status.live::before { background: var(--club-green); }
