/* Silent auction, dressed for Leading Youth Forward.
   Everything comes from the logo: its cyan and magenta, its lettering (Ubuntu),
   and the forward-leaning cut that runs through the L, Y and F. That cut leans
   one across for every two up, and every slanted edge here uses the same lean. */

@font-face {
  font-family: "Ubuntu";
  src: url("fonts/ubuntu-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Ubuntu";
  src: url("fonts/ubuntu-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "Ubuntu";
  src: url("fonts/ubuntu-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}

:root {
  --cyan: #00B2EE;         /* the L and F */
  --magenta: #ED135D;      /* the chevron */
  --navy: #06223A;
  --paper: #FFFFFF;
  --sheet: #E9F6FC;        /* behind the page, and the organiser's background */
  --ink: var(--navy);
  --soft: #4B6273;
  --rule: #D3E8F2;
  --tab: #DDF3FC;          /* a lot number you have no bid on */
  --pen: var(--magenta);   /* the bid button; the organiser can change it */
  --on-pen: #FFFFFF;
  --link: #00719B;
  --lead: #00719B;         /* cyan, deepened so it reads as text */
  --lead-bg: #E0F5FD;
  --out: #C40E4B;          /* magenta, deepened so it reads as text */
  --out-bg: #FDE7EE;
  --danger: #C40E4B;
  --strip: var(--navy);
  --text: "Ubuntu", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: var(--text);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #071B2B;
    --sheet: #04121D;
    --ink: #F2F8FC;
    --soft: #9DB4C4;
    --rule: #17364B;
    --tab: #0E3048;
    --link: #3CC6F5;
    --lead: #3CC6F5;
    --lead-bg: #0A3148;
    --out: #FF7AA2;
    --out-bg: #3A0F22;
    --strip: #0D3550;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--sheet); }
body { margin: 0; color: var(--ink); font: 400 17px/1.5 var(--text); }
a { color: var(--link); }
h1, h2, p { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

.sr, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--paper); padding: 8px 12px; }

/* ---------------------------------------------------------------- buttons */

/* The main button points forward, like the chevron in the logo. */
.btn {
  --h: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--h); padding: 8px calc(var(--h) / 4 + 16px) 8px 18px;
  border: 0; border-radius: 8px 0 0 8px;
  background: var(--pen); color: var(--on-pen);
  font: 700 19px/1 var(--text); letter-spacing: .01em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  clip-path: polygon(0 0, calc(100% - var(--h) / 4) 0, 100% 50%, calc(100% - var(--h) / 4) 100%, 0 100%);
}
.btn.big { --h: 56px; font-size: 21px; }
.btn.small { --h: 40px; padding-left: 14px; font-size: 16px; background: var(--navy); color: #fff; }
.btn.is-confirm { background: var(--navy); color: #fff; }
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 5px var(--ink); }
.btn.quiet, .btn.danger {
  padding: 8px 18px; border-radius: 8px; clip-path: none;
}
.btn.quiet { border: 2px solid var(--ink); background: transparent; color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.quiet:focus-visible, .btn.danger:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; box-shadow: none; }
.btn:disabled { opacity: .6; cursor: default; }
@media (prefers-color-scheme: dark) {
  .btn.small, .btn.is-confirm { background: #F2F8FC; color: #06223A; }
}
button.link {
  border: 0; padding: 0; background: none; color: var(--link);
  font: inherit; text-decoration: underline; cursor: pointer;
}

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

.stack { display: grid; gap: 14px; }
label { display: grid; gap: 4px; font-size: 15px; font-weight: 500; }
.hint { font-weight: 400; color: var(--soft); }
input, select, textarea {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--soft); border-radius: 6px;
  background: var(--paper); color: var(--ink);
  font: 400 17px/1.3 var(--text);
}
input[type="checkbox"] { width: 20px; height: 20px; padding: 0; flex: none; accent-color: var(--magenta); }
input[type="color"] { width: 64px; height: 40px; padding: 2px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 16px; }
.form-error {
  padding: 10px 12px; border-radius: 6px;
  background: var(--out-bg); color: var(--out); font-weight: 500;
}
.fine { font-size: 14.5px; color: var(--soft); }

/* ------------------------------------------------------------ guest shell */

.guest {
  max-width: 640px; min-height: 100vh; margin: 0 auto;
  background: var(--paper);
  display: flex; flex-direction: column;
}
@media (min-width: 680px) { .guest { box-shadow: 0 0 0 1px var(--rule); } }
.guest main { flex: 1; }

.masthead { position: sticky; top: 0; z-index: 10; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 62px; padding: 8px 16px;
  background: var(--paper);
}
.event {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  color: var(--ink); text-decoration: none;
  font: 700 17px/1.15 var(--text);
}
.event span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.brand-mark { flex: none; display: block; height: 34px; width: auto; }

/* The bidder's number, on a paddle. */
.paddle {
  position: relative; flex: none;
  display: grid; place-items: center;
  min-width: 46px; height: 34px; margin-bottom: 9px; padding: 0 9px;
  border-radius: 9px 9px 13px 13px;
  background: var(--ink); color: var(--paper);
  font: 700 19px/1 var(--text); font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.paddle::after {
  content: ""; position: absolute; top: 100%; left: calc(50% - 4px);
  width: 8px; height: 9px; border-radius: 0 0 3px 3px; background: var(--ink);
}

.status {
  display: flex; align-items: stretch; justify-content: space-between; gap: 12px;
  min-height: 38px; padding: 0 0 0 16px;
  background: var(--strip); color: #fff; font-size: 15px;
}
.status > span { align-self: center; padding: 7px 0; white-space: nowrap; }
.status .tight { display: none; }
@media (max-width: 350px) {                 /* the smallest phones get the short form */
  .status .roomy { display: none; }
  .status .tight { display: inline; }
}
.status-setup { background: var(--tab); color: var(--ink); }
.countdown {                         /* a slab cut on the logo's lean */
  display: grid; place-items: center; flex: none;
  padding: 0 16px 0 33px; background: var(--magenta); color: #fff;
  font: 700 19px/1 var(--text); font-variant-numeric: tabular-nums; white-space: nowrap;
  clip-path: polygon(19px 0, 100% 0, 100% 100%, 0 100%);
}
.countdown:empty { display: none; }
.countdown.is-soon { background: #fff; color: var(--danger); }

.offline { padding: 8px 16px; background: var(--out-bg); color: var(--out); font-size: 15px; font-weight: 500; }

.toasts { display: grid; gap: 8px; padding: 0 12px; background: var(--paper); }
.toasts:has(.toast) { padding-block: 10px; border-bottom: 1px solid var(--rule); }
.toast {
  display: block; padding: 12px 14px; border-radius: 8px;
  background: var(--cyan); color: #06223A;
  font-size: 16px; font-weight: 500; line-height: 1.35; text-decoration: none;
}
.toast-error { background: var(--danger); color: #fff; }
a.toast { text-decoration: underline; text-underline-offset: 3px; }

.tagline { padding: 14px 16px; border-bottom: 1px solid var(--rule); color: var(--soft); }

.foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: 22px 16px 28px; font-size: 14px; color: var(--soft);
}
.foot a { color: inherit; }
.foot-logo { display: block; height: 60px; width: auto; }
.foot-words { display: grid; gap: 2px; text-align: right; margin-left: auto; }

/* --------------------------------------------------------------- the lots */

.sheet { list-style: none; margin: 0; padding: 0; }
.lot { border-bottom: 1px solid var(--rule); }
.lot > a {
  display: flex; align-items: center; gap: 12px;
  min-height: 72px; padding: 10px 16px 10px 0;
  color: inherit; text-decoration: none;
}
.lot > a:active { background: var(--lead-bg); }
/* The lot number sits on a tab cut to the logo's lean. Cyan when you're in
   front, magenta when you've been passed. */
.lot-no {
  flex: none; display: grid; place-items: center;
  min-width: 58px; height: 38px; padding: 0 23px 0 10px;
  background: var(--tab); color: var(--ink);
  font: 700 19px/1 var(--text); font-variant-numeric: tabular-nums;
  clip-path: polygon(0 0, 100% 0, calc(100% - 19px) 100%, 0 100%);
}
.is-lead .lot-no { background: var(--cyan); color: #06223A; }
.is-out .lot-no { background: var(--magenta); color: #fff; }
.lot-thumb { display: none; flex: none; width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
@media (min-width: 480px) { .lot-thumb { display: block; } }
.lot-main { flex: 1; min-width: 0; }
.lot-title { display: block; font-size: 17px; font-weight: 500; line-height: 1.25; }
.lot-state { display: block; margin-top: 3px; font-size: 14.5px; line-height: 1.25; color: var(--soft); }
.lot-amt { flex: none; text-align: right; }
.lot-amt small { display: block; font-size: 13px; line-height: 1.1; color: var(--soft); }
.lot-amt b { display: block; font: 700 25px/1.05 var(--text); font-variant-numeric: tabular-nums; }
.lot-amt.is-start b { font-weight: 400; color: var(--soft); }

.is-lead .lot-state, .is-lead .bid-state { color: var(--lead); font-weight: 700; }
.is-out .lot-state, .is-out .bid-state { color: var(--out); font-weight: 700; }
.lot.is-out { background: var(--out-bg); }

.bump { animation: bump 1.4s ease-out; }
@keyframes bump { from { background: var(--cyan); color: #06223A; } to { background: transparent; } }

.empty { padding: 48px 16px; }
.empty h1 { font: 700 30px/1.1 var(--text); margin-bottom: 8px; }
.empty p { color: var(--soft); }

/* ------------------------------------------------------------------ pages */

.page { padding: 18px 16px 26px; }
.page h1 { margin: 8px 0 14px; font: 700 31px/1.1 var(--text); letter-spacing: -.01em; text-wrap: balance; }
.page h2 { margin: 26px 0 8px; font: 700 21px/1.15 var(--text); }
.lede { margin-bottom: 18px; color: var(--soft); max-width: 46ch; }
.lot-tag {
  display: inline-grid; place-items: center; height: 30px; padding: 0 25px 0 12px;
  background: var(--cyan); color: #06223A;
  font: 700 16px/1 var(--text);
  clip-path: polygon(0 0, 100% 0, calc(100% - 15px) 100%, 0 100%);
}
.page .fine { margin-top: 18px; }
.page > .btn { margin-top: 4px; }
.join-logo { display: block; height: 96px; width: auto; margin: 6px 0 22px -4px; }

.back { display: block; width: max-content; margin-bottom: 14px; font-size: 15px; }
.back::before {
  content: ""; display: inline-block; width: .5em; height: .5em; margin-right: .35em;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}
.hero { display: block; width: 100%; max-height: 62vh; object-fit: cover; border-radius: 4px; margin-bottom: 16px; }

.bid-now { padding: 14px 0 16px; margin-bottom: 16px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.bid-label { font-size: 15px; color: var(--soft); }
.bid-amt {
  display: inline-block; margin: 2px -6px 4px; padding: 0 6px; border-radius: 4px;
  font: 700 66px/1 var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.bid-state { font-weight: 500; }
.bid-meta { margin-top: 6px; font-size: 15px; color: var(--soft); }

.desc p { margin-bottom: .7em; max-width: 60ch; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 16px 0 0; }
.facts dt { font-size: 14px; color: var(--soft); }
.facts dd { margin: 0; font-weight: 500; }

.sheet.inset { margin: 0 -16px; border-top: 1px solid var(--rule); }
.sum { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0 0; color: var(--soft); }
.sum b { color: var(--ink); font: 700 30px/1 var(--text); font-variant-numeric: tabular-nums; }
.leave { margin-top: 30px; font-size: 15px; color: var(--soft); }
.leave + .leave { margin-top: 12px; }

/* -------------------------------------------------------------- bid bar */

.bidbar {
  position: sticky; bottom: 0; z-index: 9;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 2px solid var(--ink);
}
.bidbar > .btn { width: 100%; }
.bidbar-note { font-weight: 500; text-align: center; padding: 6px 0; }
.bidbar-hint { margin-top: 8px; font-size: 15px; font-weight: 500; color: var(--out); }
.bidform { display: flex; gap: 8px; align-items: stretch; }
.bidform .btn { flex: 0 0 auto; min-width: 50%; padding-left: 12px; }
.stepper {
  flex: 1 1 0; min-width: 0; display: flex;
  border: 2px solid var(--ink); border-radius: 8px; overflow: hidden;
}
.step {
  flex: 0 0 38px; border: 0; background: transparent; color: var(--ink);
  font: 700 26px/1 var(--text); cursor: pointer;
}
.step:disabled { color: var(--rule); cursor: default; }
.amount {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 1px;
  font: 700 22px/1 var(--text); font-variant-numeric: tabular-nums;
}
.amount input {
  width: 4.2ch; min-width: 0; flex: 0 1 auto; padding: 10px 0; border: 0; border-radius: 0;
  background: transparent; font: inherit; color: inherit;
}
.amount input:focus { outline: none; }
.amount:has(.is-long) { font-size: 18px; }
.stepper:focus-within { outline: 3px solid var(--link); outline-offset: 2px; }
@media (max-width: 384px) {                 /* narrower phones: amount above, button below */
  .bidform { flex-wrap: wrap; }
  .stepper { flex: 1 1 100%; min-height: 48px; }
  .step { flex-basis: 52px; }
  .bidform .btn { flex: 1 1 100%; }
}

/* ------------------------------------------------------------ big screen */

.board {
  --b-bg: #06223A; --b-ink: #FFFFFF; --b-soft: #9FB6C6; --b-rule: #17405C;
  min-height: 100vh; margin: 0; padding: 2vw 2.6vw 1vw;
  background: var(--b-bg); color: var(--b-ink); font-family: var(--text);
  overflow-x: hidden;
}
html:has(.board) { background: #06223A; }
.board-top {
  display: grid; grid-template-columns: 1fr auto auto; gap: 3.2vw; align-items: center;
  padding-bottom: 1.5vw; border-bottom: 2px solid var(--b-rule);
}
.board-brand { display: flex; align-items: center; gap: 2.2vw; min-width: 0; }
.board-logo { flex: none; display: block; height: clamp(54px, 8vw, 170px); width: auto; }
.board-title { min-width: 0; }
.board-title h1 { font: 700 clamp(24px, 3.3vw, 72px)/1.05 var(--text); letter-spacing: -.01em; }
.board-title p { margin-top: .5em; font-size: clamp(15px, 1.5vw, 32px); color: var(--b-soft); }
.board-title p b { color: var(--cyan); font: 700 1.2em/1 var(--text); font-variant-numeric: tabular-nums; }
.board-total { text-align: right; }
.board-total p { font-size: clamp(14px, 1.4vw, 28px); color: var(--b-soft); }
.board-total b { display: block; font: 700 clamp(40px, 5.6vw, 118px)/1 var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.board-join { display: flex; align-items: center; gap: 1.1vw; }
.board-join p { font: 700 clamp(15px, 1.6vw, 34px)/1.15 var(--text); }
.board-join span { font: 400 clamp(11px, .95vw, 19px)/1.3 var(--text); color: var(--b-soft); overflow-wrap: anywhere; }
.board-qr { width: clamp(84px, 8.4vw, 176px); padding: .35vw; border-radius: 6px; background: #fff; }
.qr { display: block; width: 100%; height: auto; }

.board-grid {
  --row-h: calc((100vh - 15.5vw) / var(--rows, 6));
  display: grid; grid-auto-flow: column; gap: 0 3vw;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 6), auto);
}
.b-lot {
  display: grid; grid-template-columns: 2.9em minmax(0, 1fr) auto; align-items: center; gap: 0 .6em;
  min-height: var(--row-h); padding: .25em 0; border-bottom: 1px solid var(--b-rule);
  font-size: clamp(15px, min(calc(var(--row-h) * .235), 2.1vw), 42px);
}
.b-no {
  display: grid; place-items: center; height: 1.5em; padding-right: .75em;
  background: var(--cyan); color: #06223A;
  font: 700 .95em/1 var(--text); font-variant-numeric: tabular-nums;
  clip-path: polygon(0 0, 100% 0, calc(100% - .75em) 100%, 0 100%);
}
.is-none .b-no { background: #12405C; color: #fff; }
.b-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 500; line-height: 1.15; }
.b-who { display: block; margin-top: .15em; font-size: .68em; line-height: 1.2; color: var(--b-soft); }
.b-amt { padding: .08em .3em .08em .55em; font: 700 1.7em/1 var(--text); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.b-lot.is-none .b-amt { padding-inline: 0; font-weight: 400; font-size: 1.1em; color: var(--b-soft); }
.b-lot.is-new .b-amt {                /* a fresh bid lands on a magenta slab */
  background: var(--magenta); color: #fff;
  clip-path: polygon(.5em 0, 100% 0, 100% 100%, 0 100%);
}
.board-empty { padding: 6vw 0; font-size: clamp(18px, 2.2vw, 40px); color: var(--b-soft); }
@media (max-width: 700px) {
  .board-top { grid-template-columns: 1fr auto; }
  .board-join { display: none; }
  .board-grid { --row-h: 0px; }
}

@media (prefers-reduced-motion: reduce) {
  .bump { animation: none; }
  * { scroll-behavior: auto !important; }
}
