/* Howloween 2026 charity auction.
   Look and feel follows howloween.ca: dark sci-fi HUD, cyan accent, clipped-corner panels,
   condensed uppercase headings, countdown cells. Design tokens are copied from that site's
   stylesheet; the display font is a free look-alike (Saira) because the originals are licensed. */

@font-face {
  font-family: "Saira";
  src: url("/assets/fonts/saira-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Saira";
  src: url("/assets/fonts/saira-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --bg: #04070b;
  --panel: rgba(5, 12, 18, 0.88);
  --panel-strong: rgba(3, 8, 13, 0.96);
  --text: #e5edf4;
  --muted: #7b8793;
  --line: rgba(63, 97, 119, 0.36);
  --line-strong: rgba(66, 215, 255, 0.58);
  --cyan: #42d7ff;
  --cyan-deep: #0c8daf;
  --purple: #975dff;
  --green: #79dd4d;
  --amber: #ffbe3b;
  --red: #ff4a3d;
  --danger-text: #ff8a80;
  --font-display: "Saira", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --glow-cyan: 0 0 22px rgba(66, 215, 255, 0.16);
  --cut: 0.9rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(circle at top center, rgba(66, 215, 255, 0.12), transparent 28rem),
    radial-gradient(circle at 75% 16%, rgba(151, 93, 255, 0.11), transparent 18rem),
    linear-gradient(135deg, #02050a 0%, #04070b 48%, #06111a 100%);
  background-color: var(--bg);
}
html:not(.is-embedded) body { min-height: 100vh; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(66, 215, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66, 215, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 4.5rem, 4.5rem 100%;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82), transparent 96%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82), transparent 96%);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a, button { transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, filter 160ms ease, transform 160ms ease; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; white-space: nowrap; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; color: var(--cyan); }

/* ---- layout ---- */

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}
.shell--narrow { max-width: 34rem; }
/* Top box only: the box sits in the middle of whatever height it is given (a tall iframe included). */
.page--minimal .shell { min-height: 100vh; min-height: 100dvh; align-content: center; padding-block: 1rem; }
.is-embedded .shell { padding-top: 0.6rem; }
.stack { display: grid; gap: 0.9rem; }
.stack-lg { display: grid; gap: 1.2rem; }
.pad { padding: 1.1rem; }
.inline { display: inline; }

/* ---- panels (clipped corners, 1px frame) ---- */

.panel {
  --panel-cut: var(--cut);
  position: relative;
  isolation: isolate;
  background: var(--line);
  clip-path: polygon(0 0, calc(100% - var(--panel-cut)) 0, 100% var(--panel-cut), 100% 100%, var(--panel-cut) 100%, 0 calc(100% - var(--panel-cut)));
}
.panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 16%),
    linear-gradient(90deg, rgba(66, 215, 255, 0.035), transparent 26%),
    var(--panel);
  clip-path: polygon(0 0, calc(100% - var(--panel-cut)) 0, 100% var(--panel-cut), 100% 100%, var(--panel-cut) 100%, 0 calc(100% - var(--panel-cut)));
}

/* ---- type ---- */

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--cyan);
  font: 600 0.92rem/1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kicker::before { content: ""; width: 2px; height: 1.15rem; background: currentColor; box-shadow: 0 0 10px currentColor; }

.display-title, .section-title, .item__title, .price, .label, .field__label, .chip, .badge, .button, .countdown__value {
  font-family: var(--font-display);
  text-transform: uppercase;
}
.display-title {
  margin: 0.4rem 0 0.8rem;
  font-weight: 600;
  font-stretch: 62%;
  letter-spacing: 0.02em;
  line-height: 0.95;
  font-size: clamp(2.3rem, 8vw, 4.4rem);
  text-wrap: balance;
}
.display-title--item { font-size: clamp(2rem, 6vw, 3.2rem); margin-bottom: 0.4rem; }
.section-title { margin: 0 0 0.6rem; font-size: 1.35rem; font-weight: 600; font-stretch: 75%; letter-spacing: 0.05em; }
.lead { margin: 0.2rem 0 0.4rem; max-width: 60ch; font-size: 1.05rem; color: rgba(232, 237, 242, 0.86); }
.beneficiary, .note, .meta { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.92rem; }
.beneficiary strong { color: var(--text); }
.label { font-size: 0.74rem; font-weight: 600; font-stretch: 90%; letter-spacing: 0.14em; color: var(--muted); }
.prose p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; color: rgba(232, 237, 242, 0.88); }

/* ---- hero + status ---- */

.hero { display: flex; gap: 1rem; padding: 1.4rem 1.2rem; }
.hero__text { flex: 1; min-width: 0; }
.hero__icon { flex: none; width: 5rem; height: auto; align-self: flex-start; filter: drop-shadow(0 0 14px rgba(74, 164, 219, 0.5)); }
@media (max-width: 30rem) { .hero { padding: 1.1rem 1rem; } .hero__icon { width: 3rem; } }

.status { padding: 1rem 1.1rem 1.1rem; }
.status__head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.status__label { margin-top: 0.7rem; font: 600 0.8rem/1 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.status__when { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.92rem; }
.status__local { white-space: nowrap; }

.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin: 0.5rem 0 0.4rem; }
.countdown__cell { padding: 0.6rem 0.25rem 0.55rem; text-align: center; border: 1px solid var(--line); background: rgba(6, 17, 24, 0.7); }
.countdown__value {
  font-size: clamp(1.8rem, 8vw, 2.8rem);
  font-weight: 600;
  font-stretch: 70%;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}
.tone-green .countdown__value { color: var(--green); }
.tone-amber .countdown__value { color: var(--amber); }
.tone-red .countdown__value { color: var(--red); }
.countdown__label { margin-top: 0.4rem; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.7rem;
  border: 1px solid currentColor;
  color: var(--cyan);
  background: rgba(66, 215, 255, 0.07);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.chip::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.chip--open { color: var(--green); background: rgba(121, 221, 77, 0.07); }
.chip--soon, .chip--paused { color: var(--amber); background: rgba(255, 190, 59, 0.07); }
.chip--closed { color: var(--red); background: rgba(255, 74, 61, 0.07); }

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

.button {
  --cut: 0.85rem;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.15rem;
  border: 0;
  border-radius: 0;
  background: rgba(66, 215, 255, 0.52);
  color: var(--cyan);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.button::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 65%), rgba(6, 17, 24, 0.92);
  clip-path: polygon(0 0, 100% 0, 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.button--primary { background: rgba(66, 215, 255, 0.82); color: #02151b; }
.button--primary::before { background: linear-gradient(180deg, #53dfff 0%, #25b8d8 100%); }
.button:hover { filter: brightness(1.12); transform: translateY(-1px); }
.button:focus-visible { background: #fff; outline: none; text-decoration: underline; }
.button:disabled, .button[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }
.button--block { display: flex; width: 100%; }
.button--small { min-height: 2.5rem; padding: 0.5rem 0.8rem; font-size: 0.9rem; }

.chip-button {
  min-height: 2.75rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: rgba(66, 215, 255, 0.06);
  color: var(--cyan);
  font: 600 1.05rem/1 var(--font-display);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.chip-button:hover { background: rgba(66, 215, 255, 0.16); }

.linklike { padding: 0; border: 0; background: none; color: var(--cyan); font: inherit; text-decoration: underline; cursor: pointer; }

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

input[type="text"], input[type="search"], input[type="password"], input[type="datetime-local"], select, textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(6, 17, 24, 0.9);
  color: var(--text);
  font: 1rem/1.3 var(--font-body);
}
textarea { min-height: 7rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: rgba(123, 135, 147, 0.7); }
input:focus, select:focus, textarea:focus { border-color: var(--line-strong); outline: 2px solid rgba(66, 215, 255, 0.35); outline-offset: 0; }
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--cyan) 50%), linear-gradient(135deg, var(--cyan) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 50%, calc(100% - 0.8rem) 50%;
  background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
  background-repeat: no-repeat;
}
fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
fieldset:disabled { opacity: 0.5; }

.field { display: grid; gap: 0.35rem; }
.field__label { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; color: var(--cyan); }
.field small { color: var(--muted); font-size: 0.82rem; }
.field small.error, .error { color: var(--danger-text); }
.check { display: flex; gap: 0.6rem; align-items: center; color: var(--muted); }
.check input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--cyan); flex: none; }
.money { display: flex; align-items: stretch; }
.money__sym { display: grid; place-items: center; padding: 0 0.95rem; border: 1px solid var(--line); border-right: 0; border-radius: 2px 0 0 2px; background: rgba(66, 215, 255, 0.08); color: var(--cyan); font: 600 1.1rem var(--font-display); }
.money input { border-radius: 0 2px 2px 0; font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.form-msg { min-height: 1.5rem; margin: 0.5rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
.form-msg.is-error { color: var(--danger-text); }
.form-msg.is-ok { color: var(--green); }
.form-msg.is-info { color: var(--cyan); }
.notice { margin: 0.6rem 0; padding: 0.65rem 0.8rem; border: 1px solid currentColor; background: rgba(255, 255, 255, 0.03); }
.notice--wait { color: var(--amber); }
.notice--closed { color: var(--red); }
.notice--error { color: var(--danger-text); }

/* ---- list page ---- */

.embed-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 1.5rem; }
.embed-link { margin-left: auto; color: var(--muted); font-size: 0.85rem; text-decoration: underline; }
.crumbs a, a.back { display: inline-flex; align-items: center; color: var(--cyan); font: 600 0.9rem var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; }
.crumbs a::before, a.back::before { content: ""; width: 0.5rem; height: 0.5rem; margin-right: 0.6rem; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }

.toolbar { display: grid; gap: 0.6rem; grid-template-columns: 1fr; }
@media (min-width: 36rem) { .toolbar { grid-template-columns: 1fr 14rem; } }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr)); }
.item { display: flex; flex-direction: column; }
.item__media { display: block; margin: 1px 1px 0; aspect-ratio: 4 / 3; overflow: hidden; background: #050c12; }
.item__media img { width: 100%; height: 100%; object-fit: cover; }
.item__placeholder { display: grid; place-items: center; height: 100%; opacity: 0.3; }
.item__body { display: flex; flex-direction: column; flex: 1; gap: 0.55rem; padding: 0.9rem 1rem 1.1rem; }
.item__title { margin: 0; font-size: 1.3rem; font-weight: 600; font-stretch: 75%; line-height: 1.1; letter-spacing: 0.03em; overflow-wrap: anywhere; }
.item__title a:hover { color: var(--cyan); }
.item__donor, .item__value { margin: 0; color: var(--muted); font-size: 0.92rem; }
.item__bid { margin-top: auto; padding-top: 0.4rem; }
.price { font-size: 1.9rem; font-weight: 600; font-stretch: 80%; line-height: 1.1; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.price--big { font-size: 2.7rem; color: var(--cyan); }
.badge { margin: 0; padding: 0.4rem 0.6rem; border: 1px solid currentColor; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em; line-height: 1.2; }
.badge--win { color: var(--green); background: rgba(121, 221, 77, 0.08); }
.badge--out { color: var(--amber); background: rgba(255, 190, 59, 0.08); }
.empty { padding: 1.4rem; text-align: center; color: var(--muted); }
.is-updated { animation: flash 1.4s ease; }
@keyframes flash { 0% { color: #fff; text-shadow: 0 0 14px var(--cyan); } 100% { text-shadow: none; } }

.rules { padding: 0.9rem 1.1rem; }
.rules summary { cursor: pointer; color: var(--cyan); font: 600 1rem var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; }
.rules p { margin: 0.7rem 0 0; color: rgba(232, 237, 242, 0.86); }

.footer { margin: 1.5rem 0 0.5rem; color: var(--muted); font-size: 0.85rem; text-align: center; }
.footer p { margin: 0.25rem 0; }
.footer a { color: var(--cyan); text-decoration: underline; }

/* ---- item page ---- */

.item-page {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "gallery" "head" "bid" "about";
}
.item-page__gallery { grid-area: gallery; }
.item-page__head { grid-area: head; }
.item-page__bid { grid-area: bid; }
.item-page__about { grid-area: about; display: grid; gap: 1rem; }
@media (min-width: 62rem) {
  .item-page {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    grid-template-areas: "gallery head" "gallery bid" "about bid";
    align-items: start;
  }
}

.gallery { padding: 1px; }
.gallery__main { display: grid; place-items: center; min-height: 14rem; background: #050c12; }
.gallery__main img { width: 100%; height: auto; max-height: 34rem; object-fit: contain; }
.gallery--empty { display: grid; place-items: center; min-height: 14rem; opacity: 0.35; }
.gallery__thumbs { display: flex; gap: 0.5rem; padding: 0.6rem; overflow-x: auto; }
.gallery__thumbs button { flex: none; width: 4.5rem; height: 4.5rem; padding: 0; border: 1px solid var(--line); background: none; cursor: pointer; opacity: 0.75; }
.gallery__thumbs button.is-active { border-color: var(--cyan); opacity: 1; }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

.bidbox { padding: 1.1rem 1.1rem 1.2rem; }
.bidbox__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.bidbox__time { text-align: right; }
.time-left { font: 600 1.4rem/1.2 var(--font-display); font-stretch: 80%; font-variant-numeric: tabular-nums; color: var(--green); }
.bidform fieldset { display: grid; gap: 0.9rem; margin-top: 0.8rem; }
.quick { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.history { margin: 0; padding: 0; list-style: none; }
.history li { display: grid; grid-template-columns: 1fr auto; gap: 0.1rem 0.8rem; padding: 0.55rem 0; border-top: 1px solid var(--line); }
.history__who { overflow-wrap: anywhere; }
.history__amt { font: 600 1.15rem var(--font-display); color: var(--cyan); font-variant-numeric: tabular-nums; }
.history__when { grid-column: 1 / -1; color: var(--muted); font-size: 0.8rem; }

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