/* Hyro Team Trivia */
@font-face { font-family: "Lemon"; src: url("fonts/Lemon-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "PerfectlyNineties"; src: url("fonts/PerfectlyNineties-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PerfectlyNineties"; src: url("fonts/PerfectlyNineties-Semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "PerfectlyNineties"; src: url("fonts/PerfectlyNineties-RegularItalic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --red: #FB0D1B;
  --cream: #FFF4EC;
  --black: #050404;
  --accent: var(--red);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: "PerfectlyNineties", Georgia, serif;
  background: var(--cream);
  color: var(--black);
  min-height: 100dvh;
}
h1,h2,h3,.lemon { font-family: "Lemon", "PerfectlyNineties", serif; letter-spacing: 0; font-weight: 700; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

#app { max-width: 560px; margin: 0 auto; padding: 18px 16px calc(28px + env(safe-area-inset-bottom)); min-height: 100dvh; display: flex; flex-direction: column; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

.screen { display: flex; flex-direction: column; flex: 1; animation: fadeUp .28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.logo-row { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 0 2px; }
.logo-row img { height: 26px; }
.logo-row .lemon { font-size: 17px; }

/* Buttons */
.btn { display: block; width: 100%; padding: 15px 18px; font-size: 17px; border: none; border-radius: 14px; background: var(--red); color: #fff; font-family: "Lemon", serif; letter-spacing: 0; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .4; }
.btn-ghost { background: transparent; color: var(--black); border: 2px solid rgba(5,4,4,.25); font-family: "PerfectlyNineties", serif; font-weight: 600; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .btn { flex: 1; }

/* Gate */
.gate { justify-content: center; text-align: center; }
.gate-logo { width: 110px; margin: 0 auto 18px; }
.gate h1 { font-size: 42px; color: var(--red); line-height: 1.02; }
.gate .sub { margin: 12px 0 24px; font-size: 17px; opacity: .78; }
.gate input { width: 100%; padding: 15px 18px; font-size: 18px; border: 2px solid var(--black); border-radius: 14px; background: #fff; font-family: inherit; text-align: center; }
.gate input:focus { outline: 3px solid var(--red); outline-offset: 2px; }
.gate form .btn { margin-top: 12px; }
.err { margin-top: 14px; color: var(--red); font-weight: 600; }
.gate-foot { margin-top: 26px; font-size: 13px; opacity: .55; font-style: italic; }

/* Name picker */
.picker h1 { font-size: 30px; text-align: center; color: var(--red); margin-bottom: 4px; }
.picker .sub { text-align: center; opacity: .75; margin-bottom: 18px; }
.people-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.person-tile { position: relative; border: 2.5px solid rgba(5,4,4,.12); border-radius: 18px; background: #fff; padding: 0 0 10px; text-align: center; overflow: hidden; transition: border-color .12s, transform .12s, box-shadow .12s; }
.person-tile:active { transform: scale(.97); }
.person-tile.sel { border-color: var(--accent); box-shadow: 0 6px 18px rgba(5,4,4,.14); }
.person-tile.sel::after { content: "\2713"; position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.face { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #eee; }
.face-fallback { width: 100%; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; font-family: "Lemon", serif; font-size: 44px; color: #fff; }
.person-tile .nm { display: block; font-family: "Lemon", serif; font-size: 16px; margin-top: 8px; }
.person-tile .rl { display: block; font-size: 11.5px; opacity: .6; padding: 0 8px; margin-top: 2px; }
.person-tile .sg { display: inline-block; font-size: 11px; font-weight: 600; margin-top: 5px; padding: 2px 9px; border-radius: 999px; color: #fff; }

/* Progress */
.prog { margin: 8px 0 14px; }
.prog-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.prog-top .rt { color: var(--accent); font-family: "Lemon", serif; font-size: 13px; }
.prog-bar { height: 8px; border-radius: 999px; background: rgba(5,4,4,.1); overflow: hidden; }
.prog-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .25s ease; }

/* Round intro */
.round-intro { justify-content: center; text-align: center; }
.round-intro .big-emoji { font-size: 64px; margin-bottom: 14px; }
.round-intro .rn { font-family: "Lemon", serif; font-size: 15px; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.round-intro h1 { font-size: 38px; line-height: 1.05; }
.round-intro .tag { margin: 14px 0 30px; font-size: 18px; font-style: italic; opacity: .78; }

/* Question */
.q-text { font-family: "Lemon", serif; font-size: 23px; line-height: 1.18; margin: 2px 0 16px; }
.q-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.q-grid .person-tile .nm { font-size: 15px; margin-top: 7px; }
.q-grid .person-tile .rl, .q-grid .person-tile .sg { display: none; }
.q-foot { margin-top: 14px; }
.q-hint { text-align: center; font-size: 13px; opacity: .55; margin-top: 10px; font-style: italic; }

/* Tiebreak */
.tb input { width: 100%; padding: 16px 18px; font-size: 24px; border: 2px solid var(--black); border-radius: 14px; background: #fff; font-family: inherit; text-align: center; }
.tb input:focus { outline: 3px solid var(--red); outline-offset: 2px; }

/* End screen */
.end { justify-content: center; text-align: center; }
.end .big-emoji { font-size: 70px; }
.end h1 { font-size: 34px; color: var(--red); margin: 10px 0 12px; }
.end p { font-size: 17px; opacity: .85; margin-bottom: 8px; }
.end .status-pill { display: inline-block; margin: 14px auto 20px; padding: 8px 18px; border-radius: 999px; background: #fff; border: 2px solid rgba(5,4,4,.12); font-weight: 600; font-size: 15px; }
.end .links { margin-top: 18px; font-size: 14px; opacity: .7; }

/* Results */
.res h1 { font-size: 30px; color: var(--red); text-align: center; margin-bottom: 4px; }
.res .sub { text-align: center; opacity: .72; margin-bottom: 18px; font-style: italic; }
.card { background: #fff; border: 2px solid rgba(5,4,4,.1); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 19px; margin-bottom: 10px; }
.award-card { display: flex; gap: 14px; align-items: center; }
.award-card .aw-emoji { font-size: 38px; }
.award-card .aw-label { font-family: "Lemon", serif; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--red); }
.award-card .aw-name { font-family: "Lemon", serif; font-size: 22px; margin-top: 2px; }
.award-card .aw-why { font-size: 13.5px; opacity: .7; margin-top: 3px; }
.aw-face { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.aw-face-fb { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-family: "Lemon", serif; font-size: 24px; flex-shrink: 0; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(5,4,4,.07); }
.lb-row:last-child { border-bottom: none; }
.lb-rank { font-family: "Lemon", serif; width: 26px; font-size: 16px; color: var(--red); }
.lb-name { flex: 1; font-weight: 600; }
.lb-pts { font-family: "Lemon", serif; font-size: 16px; }
.qr-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.qr-face { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }
.qr-face-fb { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; font-family: "Lemon", serif; font-size: 20px; flex-shrink: 0; }
.qr-q { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.qr-win { font-family: "Lemon", serif; font-size: 17px; margin-top: 2px; color: var(--red); }
.bar-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 13px; }
.bar-row .bn { width: 52px; font-weight: 600; }
.bar-row .bar { flex: 1; height: 14px; border-radius: 7px; background: rgba(5,4,4,.07); overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; border-radius: 7px; }
.bar-row .bc { width: 18px; text-align: right; font-weight: 600; }
.hermes-box { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--cream); border: 1.5px dashed rgba(251,13,27,.4); font-size: 13.5px; }
.hermes-box b { font-family: "Lemon", serif; color: var(--red); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: 3px; }
.locked { justify-content: center; text-align: center; }
.locked .big-emoji { font-size: 64px; margin-bottom: 14px; }
.locked h1 { font-size: 30px; color: var(--red); margin-bottom: 10px; }
.locked p { opacity: .78; font-size: 16px; }
.admin-bar { position: sticky; top: 0; z-index: 10; background: var(--black); color: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
.admin-bar .ab-t { font-family: "Lemon", serif; font-size: 14px; margin-bottom: 8px; }
.admin-bar .btn { padding: 10px 14px; font-size: 14px; }
.admin-bar .btn-row { margin-top: 0; }
.small { font-size: 12.5px; opacity: .6; text-align: center; margin: 14px 0 4px; }
.spin { margin: 40px auto; width: 34px; height: 34px; border: 4px solid rgba(5,4,4,.12); border-top-color: var(--red); border-radius: 50%; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

@media (min-width: 480px) {
  .q-grid, .people-grid { grid-template-columns: repeat(2, 1fr); }
}
