/* Change these to match the school's colours. */
:root {
  --brand: #1f6f5c;        /* main colour: buttons, links */
  --brand-ink: #ffffff;    /* text on the main colour */
  --accent: #d9822b;       /* highlights: "you're winning", countdowns */
  --bg: #f6f2ea;
  --card: #ffffff;
  --ink: #1d2320;
  --muted: #66706b;
  --line: #e4ddd0;
  --good: #1f7a3f;
  --bad: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 18px rgba(40,30,10,.06);
  --head: "Fraunces", Georgia, serif;
  --body: "Source Sans 3", system-ui, -apple-system, Segoe UI, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 17px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 .4em; font-weight: 600; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }

/* ---------- top bar */
.topbar { background: var(--brand); color: var(--brand-ink); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; }
.topbar a { color: inherit; text-decoration: none; }
.brand { font-family: var(--head); font-size: 19px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who { font-size: 14px; display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.who button { background: rgba(255,255,255,.16); color: inherit; border: 0; border-radius: 999px; padding: 6px 12px; font: inherit; cursor: pointer; }
.paddle { background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 9px; font-weight: 700; }

/* ---------- hero / countdown */
.hero { padding: 26px 0 8px; }
.hero h1 { font-size: clamp(28px, 6vw, 44px); }
.clock { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-weight: 600; box-shadow: var(--shadow); }
.clock .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); }
.clock.ended .dot { background: var(--bad); }
.toolbar { display: flex; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.toolbar input, .toolbar select { flex: 1 1 200px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--card); }

/* ---------- item grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; padding-bottom: 48px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; transition: transform .15s; }
.card:active { transform: scale(.99); }
.card .ph { aspect-ratio: 4/3; background: #ece6da center/cover no-repeat; position: relative; }
.lot { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.65); color: #fff; font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge { position: absolute; top: 10px; right: 10px; font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: #fff; }
.badge.out { background: var(--bad); }
.badge.closed { background: #444; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 19px; margin: 0; }
.price { display: flex; justify-content: space-between; align-items: baseline; margin-top: auto; padding-top: 8px; }
.price strong { font-size: 22px; }
.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: #fff1c2; } to { background: var(--card); } }

/* ---------- item page */
.item { display: grid; gap: 24px; padding: 20px 0 60px; }
@media (min-width: 860px) { .item { grid-template-columns: 1.1fr 1fr; align-items: start; } }
.item .photo { border-radius: var(--radius); overflow: hidden; background: #ece6da; box-shadow: var(--shadow); }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.stat { display: flex; gap: 22px; flex-wrap: wrap; margin: 14px 0; }
.stat div { min-width: 110px; }
.stat b { display: block; font-size: 28px; font-family: var(--head); }
.status { border-radius: 10px; padding: 10px 14px; font-weight: 600; margin: 12px 0; }
.status.win { background: #e5f4ea; color: var(--good); }
.status.lose { background: #fbe9e7; color: var(--bad); }
.status.info { background: #f1ede4; color: var(--ink); }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.quick button { padding: 14px 6px; font-size: 18px; }
.custom { display: flex; gap: 10px; }
.custom .money { position: relative; flex: 1; }
.custom .money span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.custom input { width: 100%; padding: 14px 14px 14px 28px; font: inherit; font-size: 18px; border: 1px solid var(--line); border-radius: 10px; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.history li:first-child { font-weight: 700; }

/* ---------- buttons & forms */
.btn { background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 10px; padding: 13px 20px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn.alt { background: #f1ede4; color: var(--ink); }
.btn.big { width: 100%; font-size: 19px; padding: 16px; }
.btn.danger { background: var(--bad); }
label { display: block; font-weight: 600; font-size: 15px; margin: 12px 0 4px; }
.field { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 17px; background: #fff; }
textarea.field { min-height: 110px; resize: vertical; }
.err { color: var(--bad); font-weight: 600; min-height: 1.4em; margin-top: 8px; }

/* ---------- modal & toast */
.modal { position: fixed; inset: 0; background: rgba(20,20,15,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 50; padding: 0; }
@media (min-width: 640px) { .modal { align-items: center; padding: 16px; } }
.sheet { background: var(--card); width: 100%; max-width: 440px; border-radius: 18px 18px 0 0; padding: 24px 20px 28px; max-height: 92vh; overflow: auto; }
@media (min-width: 640px) { .sheet { border-radius: 18px; } }
.sheet .row { display: flex; gap: 10px; margin-top: 18px; }
.sheet .row .btn { flex: 1; }
.code-input { letter-spacing: .5em; text-align: center; font-size: 26px !important; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.celebrate { text-align: center; }
.celebrate .big { font-family: var(--head); font-size: 40px; color: var(--good); }

/* ---------- my bids */
.list { display: grid; gap: 12px; margin: 16px 0 40px; }
.row-item { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; text-decoration: none; color: inherit; }
.row-item .thumb { width: 72px; height: 72px; border-radius: 10px; background: #ece6da center/cover; flex-shrink: 0; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item h3 { font-size: 17px; margin: 0 0 2px; font-family: var(--body); font-weight: 700; }
.pill { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill.win { background: #e5f4ea; color: var(--good); }
.pill.lose { background: #fbe9e7; color: var(--bad); }
.pill.paid { background: #e3eefc; color: #1d4f91; }
.paybox { background: var(--card); border: 2px solid var(--accent); border-radius: var(--radius); padding: 20px; margin: 18px 0; }

/* ---------- test mode */
.testbar { background: repeating-linear-gradient(45deg, #ffd84d, #ffd84d 14px, #ffe27a 14px, #ffe27a 28px); color: #3a2d00;
  text-align: center; font-weight: 700; font-size: 14px; padding: 7px 16px; }
.testcode { display: inline-block; margin-top: 8px; background: #fff3c4; color: #3a2d00; padding: 6px 10px; border-radius: 8px; }

/* ---------- empty / footer */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 40px; }
