/* Base layout for every event page. Colors and fonts come from variables
   that each theme file in /themes overrides. Mobile first. */

/* Neutral fallback while a theme file loads; every theme overrides these. */
:root {
  --frame: #111111;
  --bg: #0b0b0b;
  --surface: #171717;
  --surface-2: #232323;
  --text: #f2f2f2;
  --muted: #a8a8a8;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #e6e6e6;
  --accent-ink: #111111;
  --danger: #ff5a5f;
  --ok: #3ddc97;

  --hero-bg: transparent;
  --hero-title: var(--accent);
  --tag-a-bg: var(--text);
  --tag-a-ink: var(--bg);
  --tag-b-bg: var(--accent);
  --tag-b-ink: var(--accent-ink);
  --tag-note: var(--text);
  --when-bg: var(--text);
  --when-ink: var(--bg);
  --when-accent: #c2185b;

  --font-display: 'Oswald', system-ui, sans-serif;
  --font-label: 'Oswald', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 12px;
  --frame-w: 6px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--frame);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.page {
  max-width: 1100px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  border-left: var(--frame-w) solid var(--frame);
  border-right: var(--frame-w) solid var(--frame);
  display: flex;
  flex-direction: column;
}
@media (min-width: 700px) { :root { --frame-w: 14px; } }

.wrap { padding: 0 16px; }
main.wrap { flex: 1; padding-bottom: 32px; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  gap: 14px;
  padding: 18px 16px 8px;
  background: var(--hero-bg);
}
.hero-title {
  margin: 0;
  font-family: var(--font-display);
  color: var(--hero-title);
  font-size: clamp(2.3rem, 11vw, 4.6rem);
  line-height: 0.95;
  font-weight: 400;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.hero-side {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}
.tag, .tag-note {
  font-family: var(--font-label);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.tag {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 12px;
  line-height: 1.05;
}
.tag-a { background: var(--tag-a-bg); color: var(--tag-a-ink); font-size: 1.15rem; }
.tag-b { background: var(--tag-b-bg); color: var(--tag-b-ink); font-size: 1.5rem; }
.tag-b small { font-size: 0.95rem; display: block; }
.tag-note { align-self: center; color: var(--tag-note); font-size: 1.05rem; }
.hero-ticket {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.hero-ticket .ticket-note { color: var(--muted); font-size: 0.92rem; }
.hero-compact .hero-ticket .ticket-note { display: none; }
@media (min-width: 760px) { .hero-ticket { grid-column: 1 / -1; } }
.hero-when {
  display: grid;
  background: var(--when-bg);
  color: var(--when-ink);
  padding: 10px 16px;
  font-family: var(--font-label);
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1;
}
.when-dow { font-size: 1.05rem; }
.when-date { color: var(--when-accent); font-size: 2.2rem; margin: 4px 0; }
.when-time { font-size: 1.8rem; }

.hero-compact { gap: 10px; padding-top: 14px; }
.hero-compact .hero-title { font-size: clamp(1.9rem, 8.5vw, 3.2rem); }
.hero-compact .hero-when { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 8px 12px; }
.hero-compact .when-date { font-size: 1.4rem; margin: 0; }
.hero-compact .when-time, .hero-compact .when-dow { font-size: 1.05rem; }
.hero-compact .tag-b { font-size: 1.15rem; }

@media (min-width: 760px) {
  .hero { grid-template-columns: 1.6fr 1fr; align-items: center; padding: 28px 24px 12px; }
  .hero-side { flex-direction: column; align-items: flex-start; }
  .hero-when { grid-column: 1 / -1; }
  .hero-compact { grid-template-columns: 1fr auto; }
  .hero-compact .hero-side { flex-direction: row; align-items: center; }
}

/* ── Nav ────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 40px;
  text-align: center;
  padding: 9px 8px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  font-family: var(--font-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  line-height: 1;
  white-space: nowrap;
}
.nav a.active { background: var(--accent); color: var(--accent-ink); }

/* ── Status / callouts ──────────────────────────────────────────────────── */
.status {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.status p { margin: 0; flex: 1 1 220px; }
.status b { font-family: var(--font-label); text-transform: uppercase; letter-spacing: 0.03em; }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 12px;
}
.empty .big { font-size: 2.6rem; display: block; margin-bottom: 8px; }
.empty .big img { width: 46px; height: auto; display: block; margin: 0 auto; }
.status img { width: 26px; height: auto; vertical-align: middle; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 0.85rem; }

.section-title {
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1.15rem;
  margin: 24px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.section-title .count { color: var(--muted); font-size: 0.9rem; }

.search {
  width: 100%;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 12px;
}

.voter-picker {
  margin: 18px 0 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.voter-picker.is-selected {
  position: sticky;
  top: 61px;
  z-index: 15;
  background: var(--bg);
}
.voter-picker h2 {
  margin: 0 0 10px;
  font-family: var(--font-label);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.voter-picker .voter-search { margin-bottom: 8px; }
.voter-suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.voter-suggestion {
  min-height: 42px;
  min-width: 0;
  padding: 8px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}
.voter-note { margin: 8px 0 0; color: var(--muted); }
.voter-selected { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.voter-selected span { font-weight: 700; }

/* ── Entry cards ────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; } }
.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.card.voted { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.card .photo {
  display: block;
  padding: 0;
  border: 0;
  background: #000;
  aspect-ratio: 3 / 4;
  cursor: zoom-in;
}
.card .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .meta { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; }
.card .who { flex: 1; min-width: 0; }
.card .who b, .card .who span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .who b { font-size: 0.98rem; }
.card .who span { color: var(--muted); font-size: 0.85rem; }
.num {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-family: var(--font-label);
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.95rem;
}
.mine {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.vote {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface-2);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  filter: grayscale(1);
  opacity: 0.75;
  transition: transform 0.15s ease, background 0.15s ease, filter 0.15s ease;
}
.vote img { display: block; width: 34px; height: auto; margin: auto; }
.lightbox .lb-extra .btn img { width: 26px; height: auto; vertical-align: middle; }
.vote[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  filter: none;
  opacity: 1;
  animation: pop 0.35s ease;
}
.vote:disabled { cursor: not-allowed; opacity: 0.3; }
.vote.needs-voter {
  width: auto;
  max-width: 116px;
  height: auto;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  filter: none;
  opacity: 0.8;
}
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* ── Vote bar ───────────────────────────────────────────────────────────── */
.votebar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  z-index: 30;
  width: min(560px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.votebar { flex-wrap: wrap; }
.votebar .votebar-voter {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 0;
}
.votebar .votebar-voter[hidden] { display: none; }
.votebar .votebar-voter span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.has-votebar.club-voter main { padding-bottom: 140px; }
body.club-voter .votebar { border-radius: 18px; row-gap: 6px; }
.votebar .slots { font-size: 1.35rem; letter-spacing: 2px; white-space: nowrap; }
.votebar .slots span { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.votebar .slots img { width: 26px; height: auto; display: block; }
.votebar .slots .off { filter: grayscale(1); opacity: 0.3; }
.votebar .label { flex: 1; font-size: 0.92rem; }
.votebar .saving { font-size: 0.8rem; color: var(--muted); }
body.has-votebar main { padding-bottom: 96px; }

/* ── Results ────────────────────────────────────────────────────────────── */
.results-head { text-align: center; margin: 22px 0 12px; }
.results-head h2 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--hero-title);
  font-weight: 400;
  font-size: clamp(2rem, 9vw, 3.4rem);
  text-transform: uppercase;
  line-height: 1;
}
.results-head p { margin: 6px 0 0; color: var(--muted); }
.podium { display: grid; gap: 14px; }
@media (min-width: 700px) { .podium { grid-template-columns: repeat(3, 1fr); align-items: end; } }
.podium .spot {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--line);
  text-align: center;
}
.podium .spot.r1 { border-color: var(--accent); }
@media (min-width: 700px) { .podium .spot.r1 { order: 2; transform: translateY(-14px); } .podium .spot.r2 { order: 1; } .podium .spot.r3 { order: 3; } }
.podium img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: #000; }
.podium .medal { font-size: 2rem; margin-top: 8px; }
.podium .name { font-weight: 700; font-size: 1.1rem; padding: 0 8px; }
.podium .title { color: var(--muted); padding: 0 8px; }
.podium .votes { font-family: var(--font-label); text-transform: uppercase; padding: 6px 0 12px; }
.rest { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.rest li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.rest img { width: 44px; height: 56px; object-fit: cover; border-radius: 6px; background: #000; }
.rest .rk { font-family: var(--font-label); font-weight: 700; width: 2.2em; }
.rest .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rest .vt { color: var(--muted); white-space: nowrap; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form { display: grid; gap: 16px; max-width: 560px; margin: 16px auto 0; }
.field { display: grid; gap: 6px; }
#enter-roster { margin-top: 8px; }
#enter-suggestions { display: grid; gap: 5px; }
#enter-suggestions .btn { justify-content: flex-start; text-align: left; }
#enter-picked { color: var(--accent); font-weight: 700; }
.field label { font-family: var(--font-label); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; font-size: 0.95rem; }
.field .hint { color: var(--muted); font-size: 0.85rem; }
.field input[type='text'], .field input[type='date'], .field input[type='number'], .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 1rem;
}
.picker {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}
.picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.picker .prompt { padding: 24px; color: var(--muted); }
.picker .prompt .big { font-size: 2.6rem; display: block; }
.picker img { width: 100%; max-height: 60vh; object-fit: contain; display: block; background: #000; }
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s ease; }
.success { text-align: center; padding: 24px 8px; }
.success .big { font-family: var(--font-display); color: var(--hero-title); font-size: clamp(2.2rem, 10vw, 3.6rem); line-height: 1; text-transform: uppercase; }
.success img { max-width: 260px; border-radius: var(--radius); margin: 16px auto; display: block; }
.mylist { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.mylist span { background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 0.9rem; }

/* ── Photo collage ──────────────────────────────────────────────────────── */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filters button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.9rem;
}
.filters button[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.collage { column-count: 2; column-gap: 8px; }
@media (min-width: 700px) { .collage { column-count: 3; column-gap: 10px; } }
@media (min-width: 1000px) { .collage { column-count: 4; } }
.tile {
  break-inside: avoid;
  margin: 0 0 8px;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: zoom-in;
}
.tile img { width: 100%; display: block; height: auto; }
.tile .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 8px 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: #fff;
  font-size: 0.8rem;
  text-align: left;
}
.tile .kind {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 1px 8px;
}
.uploader {
  margin: 16px 0;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
}
.queue { display: grid; gap: 6px; }
.queue .row { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.queue .row img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.queue .row .progress { flex: 1; }

/* ── Lightbox ───────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 12px 16px;
}
.lightbox figure { margin: 0; display: grid; gap: 8px; justify-items: center; max-width: 100%; }
.lightbox img { max-width: 100%; max-height: 72vh; object-fit: contain; border-radius: 8px; }
.lightbox figcaption { text-align: center; color: #fff; }
.lightbox figcaption b { display: block; font-size: 1.1rem; }
.lightbox figcaption span { color: #ccc; }
.lightbox .lb-extra { margin-top: 12px; }
.lightbox button.lb-close, .lightbox button.lb-prev, .lightbox button.lb-next {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
}
.lb-close { top: 10px; right: 10px; }
.lb-prev { left: 8px; top: 50%; }
.lb-next { right: 8px; top: 50%; }

/* ── Venue footer ───────────────────────────────────────────────────────── */
.venue {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 16px 24px;
  border-top: 1px solid var(--line);
}
.venue-credit, .admin-credit {
  font-size: 0.8rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.venue-credit {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  margin-top: 4px;
  align-self: flex-start;
}
.admin-credit { margin-top: 24px; }
.venue-credit a, .admin-credit a { color: var(--text); }
.venue-credit a:hover, .admin-credit a:hover,
.venue-credit a:focus-visible, .admin-credit a:focus-visible { text-decoration: underline; }
.venue-name {
  font-family: var(--font-label);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1.4rem, 6vw, 2.2rem);
  line-height: 1.05;
  padding-bottom: 6px;
  border-bottom: 5px solid var(--when-accent);
  display: inline-block;
}
.venue-addr { margin-top: 8px; letter-spacing: 0.25em; text-transform: uppercase; font-weight: 600; font-size: 0.85rem; color: var(--muted); }
.venue-logo { width: 76px; height: 76px; border-radius: 50%; flex: none; background: #fff; }
@media (min-width: 700px) { .venue-logo { width: 104px; height: 104px; } }

/* ── Toast ──────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translate(-50%, 20px);
  z-index: 200;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  border: 1px solid var(--line);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast[data-kind='error'] { border-color: var(--danger); }
#toast[data-kind='ok'] { border-color: var(--ok); }

.loading { display: grid; place-items: center; padding: 60px 16px; color: var(--muted); }
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
