/* Palette sampled from the Cork Hellhounds RFC crest: #ff3000, #f07020, black. */
:root {
  --brand: #ff3000;
  --brand-2: #f07020;
  --brand-dark: #0d0d0f;

  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface-2: #faf8f6;
  --border: #e4e0da;
  --text: #16181d;
  --muted: #6b7280;
  --accent: #c42400;
  --gold: #c9971c;
  --silver: #94a3b8;
  --bronze: #b07b4f;
  --good: #1f7a4d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.06);
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121215;
    --surface: #1a1a1f;
    --surface-2: #212128;
    --border: #2f2f38;
    --text: #e8eaed;
    --muted: #9aa3b2;
    --accent: #ff5a2b;
    --gold: #e0b544;
    --silver: #aab6c6;
    --bronze: #c69063;
    --good: #4cc08a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 900px; margin: 0 auto; padding: 0 16px 64px; }
.narrow { max-width: 620px; }

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

/* ------------------------------------------------------------------ hero */

/* The club banner logo is a white wordmark on transparency, so the hero band
   stays dark in both themes. */
header.hero {
  padding: 26px 16px 30px;
  text-align: center;
  background: var(--brand-dark);
  border-bottom: 3px solid var(--brand);
  color: #fff;
}

header.hero .brand { display: inline-block; margin-bottom: 16px; }
header.hero .brand img { display: block; width: 260px; max-width: 72vw; height: auto; }

header.hero h1 {
  font-family: var(--font);
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  color: #fff;
}

header.hero .tagline { color: #a9adb6; margin: 0; font-size: 1.02rem; }

.draw-note {
  margin-top: 14px;
  display: inline-block;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ff8a5c;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 6px 14px;
}

section { margin-top: 40px; }

h2.section-title {
  font-family: var(--font);
  font-size: 1.6rem;
  margin: 0 0 4px;
}

.section-sub { color: var(--muted); margin: 0 0 18px; font-size: 0.95rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

/* ------------------------------------------------------------ countdown */

.countdown {
  margin-top: 28px;
  text-align: center;
  background: var(--brand-dark);
  border-radius: var(--radius);
  padding: 20px 16px 18px;
  color: #fff;
}

.countdown-label {
  margin: 0 0 12px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ff8a5c;
  font-weight: 600;
}

.countdown-clock { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.cd-unit {
  min-width: 72px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 6px 8px;
}

.cd-value {
  display: block;
  font-family: var(--font);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.cd-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a9adb6;
  margin-top: 2px;
}

.cd-closed { font-family: var(--font); font-size: 1.4rem; color: #ff8a5c; }
.countdown-date { margin: 12px 0 0; font-size: 0.85rem; color: #a9adb6; }

@media (max-width: 420px) {
  .countdown-clock { gap: 6px; }
  .cd-unit { min-width: 62px; }
  .cd-value { font-size: 1.6rem; }
}

/* --------------------------------------------------------------- totals */

.totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat .value { font-size: 1.9rem; font-weight: 700; font-family: var(--font); }
.stat .label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }

.progress-shell {
  margin-top: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 999px;
  transition: width 600ms ease;
}

.progress-caption { font-size: 0.9rem; color: var(--muted); margin-top: 8px; text-align: center; }

/* ---------------------------------------------------------- leaderboard */

table.board { width: 100%; border-collapse: collapse; }

table.board th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--border);
}

table.board td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.board tr:last-child td { border-bottom: 0; }

.rank {
  width: 46px;
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

tr.top-1 .rank { color: var(--gold); }
tr.top-2 .rank { color: var(--silver); }
tr.top-3 .rank { color: var(--bronze); }
tr.top-1 { background: linear-gradient(90deg, rgba(201, 151, 28, 0.10), transparent); }

.member-name { font-weight: 600; }
.member-sub { font-size: 0.82rem; color: var(--muted); }

td.tickets { text-align: right; width: 110px; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.1rem; }
td.tickets small { display: block; font-weight: 400; font-size: 0.75rem; color: var(--muted); }

.bar-cell { width: 34%; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.empty { text-align: center; color: var(--muted); padding: 32px 10px; }

/* -------------------------------------------------------------- prizes */

ul.prizes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

/* A dozen prizes is a long single column on a wide screen. */
@media (min-width: 720px) {
  ul.prizes { grid-template-columns: 1fr 1fr; }
  .narrow ul.prizes { grid-template-columns: 1fr; }
}

.prizes-note {
  margin: 14px 2px 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

/* The IRFU's twelve, condensed to one line each on the buyer's form. */
ol.prizes-compact {
  list-style: none;
  counter-reset: prize;
  margin: 0;
  padding: 0;
}

ol.prizes-compact li {
  counter-increment: prize;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 2px 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

ol.prizes-compact li:last-child { border-bottom: 0; padding-bottom: 0; }
ol.prizes-compact li:first-child { padding-top: 0; }

ol.prizes-compact li::before {
  content: counter(prize);
  grid-row: span 2;
  font-family: var(--font);
  font-weight: 700;
  color: var(--brand);
  text-align: right;
  font-size: 0.95rem;
  line-height: 1.5;
}

.np-name { font-weight: 600; font-size: 0.95rem; }
.np-donor { font-size: 0.82rem; color: var(--muted); font-style: italic; }
.np-donor::before { content: "Compliments of "; }

.prizes-pdf { margin: 16px 0 0; font-size: 0.92rem; font-weight: 600; }

/* Clears up the recurring "did the club get these prizes?" confusion. */
.disclaimer {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--text);
}

li.prize {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
}

li.prize:first-child { border-left-color: var(--gold); }
li.prize .place { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
li.prize h3 { margin: 2px 0 4px; font-family: var(--font); font-size: 1.2rem; }
li.prize p { margin: 0; color: var(--muted); font-size: 0.93rem; }
li.prize .donor { font-style: italic; font-size: 0.85rem; margin-top: 4px; }

.cause-title { margin-top: 0; font-family: var(--font); font-size: 1.25rem; }

/* ---------------------------------------------------------------- forms */

form.entry { display: grid; gap: 18px; }

/* Honeypot: off-screen rather than display:none, which some bots detect. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.92rem; }
.field .hint { font-size: 0.82rem; color: var(--muted); }

input[type="text"], input[type="tel"], input[type="email"], input[type="number"], select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.checkline { display: flex; gap: 10px; align-items: flex-start; }
.checkline input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.checkline label { font-weight: 500; font-size: 0.93rem; }

.total-line {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.total-line strong { font-size: 1.3rem; font-family: var(--font); }

button.primary, a.primary {
  font: inherit;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 14px 20px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

button.primary:hover { filter: brightness(1.07); }

.errors {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.92rem;
}
.errors ul { margin: 6px 0 0; padding-left: 20px; }

.seller-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.9rem;
  color: var(--muted);
}
.seller-chip strong { color: var(--text); }

/* ---------------------------------------------------------------- admin */

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.admin-table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); padding: 0 8px 8px; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 12px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.qr-thumb { width: 74px; height: 74px; border-radius: 8px; border: 1px solid var(--border); background: #fff; display: block; }
.muted { color: var(--muted); font-size: 0.85rem; }
.link { font-size: 0.8rem; word-break: break-all; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 8px; }
.toolbar a { font-size: 0.9rem; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 8px 12px; text-decoration: none; }
.notice { background: color-mix(in srgb, var(--good) 14%, transparent); border: 1px solid var(--good); color: var(--text); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 0.92rem; }

footer.site {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.updated { font-size: 0.8rem; color: var(--muted); text-align: right; margin-top: 10px; }

@media (max-width: 560px) {
  .bar-cell { display: none; }
  header.hero { padding: 28px 16px 24px; }
}
