/* Competitions: the judging page and the boards (a judge's favorites, the
   combined results). Warm palette of its own; the boards print. */
/* Palette and type borrowed from newcommunity.us: Figtree body, Poppins
   headings, blue #1545D3 on cream #FAF8F2, near-black ink. */
.comp {
  --ink: #010101; --muted: #5c5c5c; --cream: #FAF8F2; --coral: #1545D3; --orange: #8ac2dd; --line: #e6e2d8;
  --card: #ffffff; --blue: #1545D3; --blue-dark: #0e2f94; --gold: #e9bb67;
  color: var(--ink); background: var(--cream); color-scheme: light;
  font-family: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
.comp h1, .comp h2, .comp h3, .comp .big-score, .comp .stat b, .comp .pie-name, .comp .entry-card h3, .comp .admin h2 { font-family: "Poppins", "Figtree", sans-serif; }
.comp main { max-width: 1130px; }
.hero { position: relative; overflow: hidden; color: white; padding: 48px 20px 98px;
  background: radial-gradient(circle at 80% 0%, #3b67e8 0, transparent 45%), linear-gradient(130deg, var(--blue-dark), var(--blue) 70%, #2a5ae0); }
.hero:after { content: ""; position: absolute; bottom: -90px; right: -80px; width: 280px; height: 280px; border: 28px solid #ffffff1f; border-radius: 50%; pointer-events: none; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.brand svg { width: 44px; height: 44px; flex: none; }
.brand .eyebrow { margin: 0; }
.hero .wrap { max-width: 1130px; margin: auto; }
.wrap { max-width: 1130px; margin: auto; }
.eyebrow { font-weight: 700; letter-spacing: .22em; text-transform: uppercase; font-size: 12px; color: #dbe4ff; }
.hero h1 { font-size: clamp(34px, 6.3vw, 68px); line-height: 1.05; max-width: 770px; margin: 6px 0 12px; letter-spacing: -.03em; font-weight: 700; }
.hero p { font-size: 17px; opacity: .9; margin: 0; }
.hero nav { position: absolute; top: 16px; right: 20px; display: flex; gap: 14px; font-size: 13px; }
.hero nav a { color: #ffffff; text-decoration: none; font-weight: 700; opacity: .9; }
.pie-art { position: absolute; right: 9%; top: 40px; width: 170px; height: 170px; opacity: .18; transform: rotate(20deg); }
.pie-art svg { width: 100%; height: 100%; }
.judge-credit { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 18px; border: 1px solid #ffffff55; border-radius: 999px; background: #ffffff1a; color: #eef2ff; font-size: 15px; font-weight: 600; }
.judge-credit strong { color: white; }
.motto { letter-spacing: .18em; text-transform: uppercase; font-size: 11px; font-weight: 700; color: var(--muted); }
.comp main { padding: 0 20px 55px; }
.stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: -45px; position: relative; z-index: 1; }
.stat { min-width: 150px; flex: 1; background: var(--card); border-radius: 14px; padding: 18px 24px; box-shadow: 0 10px 26px #0e2f9414; border: 1px solid var(--line); }
.stat b { font-family: "Poppins", "Figtree", sans-serif; font-size: 32px; display: block; }
.stat small { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 45px 0 20px; }
.section-head h2 { font-family: "Poppins", "Figtree", sans-serif; letter-spacing: -.025em; font-size: clamp(27px, 4vw, 36px); margin: 0; }
.section-head p { margin: 7px 0 0; color: var(--muted); }
.podium { display: grid; grid-template-columns: 1fr 1.12fr 1fr; gap: 16px; align-items: stretch; }
.podium-card { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 23px; text-align: center; box-shadow: 0 7px 20px #0e2f940a; }
.podium-card.gold { background: linear-gradient(160deg, #fff7df, #fff); border: 2px solid var(--gold); transform: translateY(-8px); }
.medal { font-size: 43px; }
.place-label { font-size: 11px; letter-spacing: .17em; font-weight: 800; color: var(--blue); margin: 12px 0; }
.pie-name { font-family: "Poppins", "Figtree", sans-serif; font-weight: bold; font-size: clamp(17px, 2.2vw, 25px); min-height: 59px; display: flex; align-items: center; justify-content: center; }
.big-score { font-family: "Poppins", "Figtree", sans-serif; font-size: 37px; font-weight: bold; margin: 15px 0; }
.big-score span { font: normal 14px system-ui; color: var(--muted); }
.meter, .mini-track { background: #efe7dd; border-radius: 9px; overflow: hidden; height: 9px; }
.meter, .mini-track { background: #e9edf8; }
.meter i, .mini-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-dark), var(--blue)); border-radius: 9px; }
.controls { display: flex; gap: 10px; align-items: center; }
.search { padding: 11px 14px; border: 1px solid #dbcaba; border-radius: 10px; background: var(--card); color: var(--ink); width: min(250px, 100%); font-size: 14px; }
.comp button, .comp a.button { font: inherit; border: none; background: var(--blue); color: white; padding: 12px 18px; border-radius: 999px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block; }
.comp button.secondary { background: transparent; color: var(--blue); border: 1px solid #b7c4f0; }
.comp button.danger { background: #010101; }
.comp button:disabled { opacity: .5; cursor: default; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 12px 30px #4e2a1709; }
.comp table { width: 100%; border-collapse: collapse; min-width: 700px; }
.comp thead { background: #010101; color: #fff; }
.comp th { font-size: 12px; text-align: left; letter-spacing: .02em; padding: 16px 15px; white-space: nowrap; }
.comp td { padding: 14px 15px; font-size: 14px; border-top: 1px solid #f0e7df; }
.comp tr:nth-child(even) { background: #fbfaf5; }
.comp tbody tr:hover { background: #eef2ff; }
td.rank { font-weight: 800; color: var(--blue); }
td.entry { font-weight: 700; min-width: 225px; }
td.total { min-width: 120px; }
td.total b { font-size: 17px; }
td.total small { color: var(--muted); }
td.dash { color: var(--muted); }
.mini-track { height: 5px; margin-top: 6px; }
.comp footer { color: var(--muted); text-align: center; font-size: 12px; padding: 30px 0 4px; display: grid; gap: 6px; }
.comp footer .motto { color: var(--blue); }
.legend { color: var(--muted); font-size: 13px; margin: 15px 2px 0; }
.note { color: var(--muted); font-size: 13px; }

/* Judging page */
.judge-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin-top: -45px; position: relative; z-index: 1; box-shadow: 0 10px 26px #0e2f9414; }
.judge-bar label { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.judge-bar input { font: inherit; padding: 9px 12px; border: 1px solid #dbcaba; border-radius: 10px; background: var(--cream); color: var(--ink); width: 14rem; }
.judge-bar .links { display: flex; gap: 10px; flex-wrap: wrap; }
.progress { color: var(--muted); font-size: 14px; }
.banner { background: #fff3d6; border: 1px solid var(--gold); border-radius: 12px; padding: 12px 16px; margin: 20px 0; font-weight: 600; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.entry-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: 0 7px 20px #0e2f940a; display: flex; flex-direction: column; gap: 10px; }
.entry-card.done { border-color: var(--blue); }
.entry-card h3 { font-family: "Poppins", "Figtree", sans-serif; font-size: 20px; margin: 0; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.entry-card h3 .num { color: var(--muted); font: 600 13px system-ui; letter-spacing: .1em; }
.cat { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.cat select { font: inherit; padding: 6px 10px; border: 1px solid #dbcaba; border-radius: 8px; background: var(--cream); color: var(--ink); min-width: 5.5rem; }
.entry-card .sum { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.entry-card .sum b { font-family: Georgia, serif; font-size: 22px; }
.entry-card .sum small { color: var(--muted); }
.entry-card textarea { font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid #dbcaba; border-radius: 8px; background: var(--cream); color: var(--ink); resize: vertical; min-height: 2.2rem; }
.saved { font-size: 12px; color: #1f7a3c; min-height: 1em; }
.saved.error { color: var(--coral); }
.admin { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin-top: 40px; box-shadow: 0 7px 20px #0e2f940a; }
.admin h2 { font-family: "Poppins", "Figtree", sans-serif; margin: 0 0 12px; }
.admin ul { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 6px; }
.admin li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.admin li a { color: var(--blue); font-weight: 700; }
.admin .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.status { color: var(--muted); min-height: 1.5em; margin-top: .75rem; }
.status.error { color: var(--coral); }

/* New competition form */
form.comp-new { display: grid; gap: 14px; max-width: 760px; margin-top: 30px; }
form.comp-new label { display: grid; gap: 6px; font-weight: 600; }
form.comp-new input, form.comp-new textarea { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid #dbcaba; border-radius: 10px; background: var(--card); color: var(--ink); }
form.comp-new .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

@media (max-width: 700px) {
  .hero { padding: 45px 20px 89px; }
  .hero nav { position: static; margin-bottom: 14px; }
  .brand svg { width: 36px; height: 36px; }
  .pie-art { right: -55px; opacity: .14; }
  .podium { grid-template-columns: 1fr; gap: 10px; }
  .podium-card.gold { transform: none; order: -1; }
  .podium-card { padding: 20px; }
  .pie-name { min-height: 0; }
  .section-head { align-items: start; flex-direction: column; }
  .controls { width: 100%; }
  .search { flex: 1; }
  .stats { gap: 8px; }
  .stat { min-width: 105px; padding: 15px; }
  .stat b { font-size: 24px; }
  form.comp-new .two { grid-template-columns: 1fr; }
}
@media print {
  .comp { background: white; }
  .hero { padding: 20px 0 30px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .hero h1 { font-size: 45px; }
  .hero nav, .print, .search { display: none; }
  .comp main { padding: 0; }
  .stats { margin-top: 10px; }
  .podium-card.gold { transform: none; }
  .podium-card, .comp tr { break-inside: avoid; }
  .comp table { min-width: 0; font-size: 11px; }
  .comp th, .comp td { padding: 8px; }
  .section-head { margin: 22px 0 12px; }
  .judge-credit { border-color: #eee; background: transparent; }
}
