/* Phone-first: the app is opened from a QR code, so everything lives in one narrow column.
   Fonts are loaded via <link> in each page (faster than @import). */

:root {
  --night: #140a12;
  --night-2: #22101d;
  --red: #b8132f;
  --red-dark: #7d0c20;
  --cream: #f6e7c8;
  --cream-dark: #e6cfa2;
  --gold: #f0b43c;
  --gold-dark: #b9801a;
  --ink: #2a1420;
  --muted: #b9a28a;
  --pink: #ff8a9c;
  --radius: 14px;
  --col: 480px;
  --display: 'Sancreek', 'Georgia', serif;
  --body: 'Oswald', 'Arial Narrow', sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(240, 180, 60, 0.16), transparent 55%),
    radial-gradient(ellipse at 50% 120%, rgba(184, 19, 47, 0.22), transparent 60%),
    var(--night);
  color: var(--cream);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; }
button { touch-action: manipulation; }

/* ---------- big top header ---------- */

.tent {
  position: relative;
  padding: 16px 16px 40px;
  text-align: center;
  background: repeating-linear-gradient(90deg, var(--red) 0 36px, var(--cream) 36px 72px);
  box-shadow: inset 0 -14px 30px rgba(0, 0, 0, 0.35);
}

.tent::after {
  /* scalloped valance */
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -18px;
  height: 36px;
  background: radial-gradient(circle at 18px 0, var(--red) 17px, transparent 18px) repeat-x;
  background-size: 36px 36px;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.4));
}

.marquee {
  position: relative;
  max-width: calc(var(--col) - 32px);
  margin: 0 auto;
  padding: 16px 16px 14px;
  background: var(--night-2);
  border: 3px solid var(--gold);
  border-radius: 16px;
  box-shadow: 0 0 0 5px var(--night-2), 0 12px 30px rgba(0, 0, 0, 0.6);
}

.bulbs {
  position: absolute;
  inset: 5px;
  border-radius: 11px;
  pointer-events: none;
  background:
    radial-gradient(circle, #ffe7a3 0 2.5px, transparent 3.5px) top left / 18px 18px repeat-x,
    radial-gradient(circle, #ffe7a3 0 2.5px, transparent 3.5px) bottom left / 18px 18px repeat-x;
  animation: blink 1.2s steps(2) infinite;
  opacity: 0.9;
}

@keyframes blink { 50% { opacity: 0.35; } }

.eyebrow {
  margin: 4px 0 2px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(28px, 9vw, 40px);
  line-height: 1.05;
  color: var(--cream);
  text-shadow: 2px 2px 0 var(--red), 4px 4px 0 rgba(0, 0, 0, 0.5);
}

.tagline { margin: 8px 0 4px; color: var(--muted); font-size: 15px; line-height: 1.35; }

/* ---------- layout ---------- */

main { max-width: var(--col); margin: 0 auto; padding: 36px 16px 40px; }

.banner {
  margin: 0 0 20px;
  padding: 12px 16px;
  text-align: center;
  border: 2px dashed var(--gold);
  border-radius: var(--radius);
  color: var(--gold);
  font-size: 17px;
  line-height: 1.4;
}
.banner.closed { border-color: var(--red); color: var(--pink); }
.banner b { color: var(--cream); }

.link {
  background: none; border: 0; padding: 0 0 0 6px;
  color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 15px;
}

.list { display: flex; flex-direction: column; gap: 22px; }

/* ---------- contestant poster card ---------- */

.card {
  position: relative;
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius);
  border: 4px solid var(--red);
  box-shadow: 0 0 0 3px var(--cream), 0 0 0 5px var(--red-dark), 0 14px 26px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  scroll-margin-top: 16px;
  transition: border-color 0.2s;
}
.card.rated { border-color: var(--gold); }

.photo {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 56svh;
  padding: 0;
  border: 0;
  border-bottom: 4px solid var(--red);
  background: repeating-linear-gradient(45deg, var(--cream-dark) 0 14px, var(--cream) 14px 28px);
  color: inherit;
}
.card.rated .photo { border-bottom-color: var(--gold); }
button.photo { cursor: zoom-in; }

.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.initial {
  font-family: var(--display);
  font-size: 110px;
  line-height: 1;
  color: var(--red);
  text-shadow: 3px 3px 0 var(--cream), 6px 6px 0 rgba(125, 12, 32, 0.25);
}

.number {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 1;
  min-width: 38px; height: 38px;
  padding: 0 8px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: var(--cream);
  border: 3px solid var(--cream);
  font-family: var(--display);
  font-size: 17px;
}

.zoom-hint {
  position: absolute;
  right: 10px; bottom: 10px;
  z-index: 1;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(20, 10, 18, 0.7);
  color: var(--cream);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stamp {
  position: absolute;
  top: 8px; right: 10px;
  z-index: 1;
  width: 64px; height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  border: 3px dashed var(--red-dark);
  box-shadow: 0 0 0 3px var(--gold), 0 6px 14px rgba(0, 0, 0, 0.4);
  transform: rotate(12deg);
  line-height: 1;
}
.stamp b { font-family: var(--display); font-size: 28px; font-weight: 400; }
.stamp small { font-size: 12px; font-weight: 700; }
.stamp.pop { animation: pop 0.3s ease; }
@keyframes pop { 0% { transform: rotate(12deg) scale(0.4); } 70% { transform: rotate(12deg) scale(1.15); } 100% { transform: rotate(12deg) scale(1); } }

.info { padding: 12px 14px 14px; }

.costume {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.15;
  color: var(--red-dark);
}

.who { margin: 2px 0 0; color: #6b4a52; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- post-vote promo poster ---------- */

.promo {
  margin: 4px 4px 30px;
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  background: var(--cream);
  color: var(--ink);
  border-radius: 12px;
  border: 4px solid var(--red);
  box-shadow: 0 0 0 4px var(--cream), 0 0 0 7px var(--gold), 0 18px 40px rgba(0, 0, 0, 0.55);
  transform: rotate(0.8deg);
}
.promo-eyebrow { margin: 0; color: var(--red); font-weight: 700; font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; }
.promo-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.1; color: var(--red-dark); }
.promo-title span { display: block; color: var(--red); }
.promo-warn {
  margin: 2px 0 4px;
  padding: 10px 12px;
  border: 2px dashed var(--red);
  border-radius: 10px;
  background: #fffaf0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}
.promo-btn { width: 100%; }
.promo-fine { margin: 0; font-size: 12px; color: #6b4a52; letter-spacing: 0.04em; }

/* ---------- 1–10 rating ---------- */

.scores {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.score {
  height: 50px;
  border-radius: 12px;
  border: 2px solid var(--red);
  background: #fffaf0;
  color: var(--red-dark);
  font-family: var(--display);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s ease, background 0.15s;
}
.score:active { transform: scale(0.94); }
.score:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.score.on { background: var(--red); color: var(--cream); border-color: var(--red-dark); box-shadow: 0 3px 0 var(--red-dark); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 8px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: var(--cream);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--red-dark);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-dark); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.btn.gold { background: var(--gold); color: var(--ink); box-shadow: 0 4px 0 var(--gold-dark); }
.btn.ghost { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 2px var(--cream); }
.btn.small { min-height: 40px; padding: 4px 14px; font-size: 14px; }

/* ---------- name ticket ---------- */

.ticket {
  position: relative;
  margin: 8px 4px 28px;
  padding: 24px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--cream);
  color: var(--ink);
  border-radius: 10px;
  border: 3px dashed var(--red);
  box-shadow: 0 0 0 8px var(--cream), 0 18px 40px rgba(0, 0, 0, 0.55);
  transform: rotate(-1deg);
  /* ticket notches */
  -webkit-mask: radial-gradient(circle 16px at 0 50%, transparent 15px, #000 16px) left / 51% 100% no-repeat,
                radial-gradient(circle 16px at 100% 50%, transparent 15px, #000 16px) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 16px at 0 50%, transparent 15px, #000 16px) left / 51% 100% no-repeat,
                radial-gradient(circle 16px at 100% 50%, transparent 15px, #000 16px) right / 51% 100% no-repeat;
}

.ticket-eyebrow { margin: 0; color: var(--red); font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; font-size: 13px; }
.ticket-label { font-family: var(--display); font-size: 28px; line-height: 1.1; color: var(--red-dark); }

.ticket input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 3px solid var(--red-dark);
  background: #fffaf0;
  color: var(--ink);
  font-size: 22px; /* ≥16px keeps iOS from zooming in on focus */
}
.ticket input:focus { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- sticky submit bar ---------- */

.submit-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(20, 10, 18, 0.95);
  border-top: 3px solid var(--gold);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}
.submit-inner { max-width: calc(var(--col) - 32px); margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.progress { flex: 1; min-width: 0; }
.progress-text { font-size: 15px; color: var(--muted); }
.progress-text b { font-family: var(--display); font-weight: 400; color: var(--gold); font-size: 22px; }
.progress-track { height: 6px; margin-top: 4px; border-radius: 999px; background: rgba(246, 231, 200, 0.12); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--gold); border-radius: 999px; transition: width 0.3s ease; }
.submit-bar .btn { flex: none; min-width: 150px; }
body.has-bar { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
body.has-bar .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------- photo lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: rgba(10, 5, 9, 0.94);
  cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 80svh; border-radius: 12px; border: 3px solid var(--gold); object-fit: contain; }
.lightbox p { margin: 0; text-align: center; font-family: var(--display); font-size: 24px; color: var(--cream); }
.lightbox small { display: block; font-family: var(--body); font-size: 14px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- results ---------- */

.results { margin-top: 40px; }

.section-title {
  margin: 0 0 18px;
  text-align: center;
  font-family: var(--display);
  font-weight: 400;
  font-size: 32px;
  color: var(--gold);
}

.bars { display: flex; flex-direction: column; gap: 14px; }

.bar-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
}

.place {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--night-2);
  border: 2px solid var(--muted);
  font-family: var(--display);
}
.bar-row[data-place="1"] .place { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.bar-row[data-place="2"] .place { background: #cfd3d6; color: var(--ink); border-color: #cfd3d6; }
.bar-row[data-place="3"] .place { background: #c98a52; color: var(--ink); border-color: #c98a52; }

.bar-label { font-size: 15px; line-height: 1.25; margin-bottom: 4px; }
.bar-label b { color: var(--cream); }
.bar-label span { color: var(--muted); }

.track { height: 12px; border-radius: 999px; background: rgba(246, 231, 200, 0.1); overflow: hidden; }
.fill {
  height: 100%;
  border-radius: 999px;
  background: repeating-linear-gradient(-45deg, var(--red) 0 10px, #d8304d 10px 20px);
  transition: width 0.8s cubic-bezier(.2,.8,.2,1);
}
.bar-row[data-place="1"] .fill { background: repeating-linear-gradient(-45deg, var(--gold) 0 10px, #ffd47a 10px 20px); }

.count { font-family: var(--display); font-size: 22px; color: var(--gold); min-width: 3ch; text-align: right; line-height: 1.1; }
.count small { display: block; font-family: var(--body); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }

/* Sancreek's "1" reads like an "I", so all numbers use the plain body face. */
.score, .stamp b, .number, .place, .count, .progress-text b, .num {
  font-family: var(--body);
  font-weight: 700;
}

/* ---------- misc ---------- */

.empty { text-align: center; color: var(--muted); padding: 32px 0; font-size: 18px; }

.toast {
  position: fixed;
  left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, calc(100% + 60px));
  visibility: hidden;
  width: max-content;
  max-width: calc(100vw - 32px);
  text-align: center;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, visibility 0.3s;
  z-index: 70;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.toast.error { background: var(--pink); }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 0 16px 28px; }
footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .bulbs { animation: none; }
  .card, .fill, .toast, .score, .progress-fill { transition: none; }
  .stamp.pop { animation: none; }
}
