:root {
  --navy: #262948;
  --navy-deep: #1b1d36;
  --card: #30345a;
  --card-2: #3a3f68;
  --line: #454a75;
  --line-2: #5a5f8c;
  --text: #ffffff;
  --muted: #bfc8e4;
  --pink: #e8239a;      /* display marks */
  --pink-btn: #d1127a;  /* fills under white text (passes 4.5:1) */
  --blue: #8fd3f4;      /* accent text, links, on-the-way */
  --green: #7bc47f;     /* here */
  --green-ink: #10200f;
  --radius: 16px;
  --tabbar: 84px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--navy); color: var(--text); }
body {
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
a { color: var(--blue); }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }
.hidden { display: none !important; }

.screen { max-width: 520px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 28px) 20px calc(var(--tabbar) + env(safe-area-inset-bottom) + 24px); display: flex; flex-direction: column; gap: 16px; }
.neon { font-family: 'Monoton', 'Jost', sans-serif; font-weight: 400; color: var(--pink); line-height: 1; letter-spacing: 0; }
.neon .amp { color: var(--blue); font-family: "Jost", sans-serif; font-weight: 400; } /* Monoton draws & as "Et" */
.label { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.label.accent { color: var(--blue); }
.muted { color: var(--muted); }
.h1 { font-size: 32px; font-weight: 600; line-height: 1.05; margin: 0; }
.stop-name { font-size: 40px; font-weight: 600; line-height: 1.05; margin: 0; }

.topbar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.topbar .neon { font-size: 30px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.card.now { border-color: var(--blue); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; background: var(--blue); }

.btn { min-height: 46px; border-radius: 12px; border: 0; background: var(--card-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 500; font-size: 15px; text-decoration: none; padding: 0 14px; }
.btn.primary { background: var(--pink-btn); color: #fff; font-weight: 700; font-size: 17px; min-height: 54px; border-radius: 14px; }
.btn.outline { background: transparent; border: 2px solid var(--blue); font-weight: 700; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn[disabled] { opacity: 0.5; }
.btn svg { flex: none; }

.status-btn { min-height: 50px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 500; font-size: 14px; }
.status-btn.on.here { background: var(--green); border-color: var(--green); color: var(--green-ink); font-weight: 700; }
.status-btn.on.onway { background: var(--blue); border-color: var(--blue); color: var(--navy-deep); font-weight: 700; }
.status-btn.on.notyet { background: var(--card-2); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; }
.chip.on { background: var(--text); color: var(--navy); border-color: var(--text); }

.counts { font-size: 14px; text-decoration: none; color: var(--text); }
.counts .here { color: var(--green); font-weight: 700; }
.counts .onway { color: var(--blue); font-weight: 700; }

.announce { background: var(--card-2); border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.announce svg { flex: none; margin-top: 2px; color: var(--blue); }

/* Agenda */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 14px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; width: 18px; }
.tl-dot { width: 14px; height: 14px; border-radius: 7px; border: 2px solid var(--muted); margin-top: 20px; flex: none; }
.tl-item.now .tl-dot { background: var(--blue); border-color: var(--blue); }
.tl-item.done .tl-dot { background: var(--muted); }
.tl-line { flex: 1; width: 2px; background: var(--line-2); }
.tl-item:last-child .tl-line { display: none; }
.tl-item .card { flex: 1; margin-bottom: 14px; }
.tl-item.done .card { opacity: 0.65; }
.links { display: flex; gap: 16px; font-size: 15px; font-weight: 500; }

/* People */
.group-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 5px; flex: none; }
.dot.here { background: var(--green); }
.dot.onway { background: var(--blue); }
.dot.notyet { border: 2px solid var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 8px 12px; border-radius: 999px; background: #213a23; color: #cfebd0; font-size: 14px; }
.pill.me { outline: 2px solid var(--green); }
.list-row { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: var(--card); font-size: 15px; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.tile { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 6px; overflow: hidden; background: var(--card); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile .pip { position: absolute; left: 5px; top: 5px; width: 34%; aspect-ratio: 3 / 4; border: 2px solid #fff; border-radius: 6px; overflow: hidden; }
.tile .pip img { width: 100%; height: 100%; object-fit: cover; }
.tile .by { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; font-size: 11px; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,0.55)); }
.queue-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--card); font-size: 14px; }
.queue-item .progress { flex: 1; }
.queue-item.failed { border: 1px solid var(--pink); }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 14px; }

/* Tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding: 8px 8px calc(env(safe-area-inset-bottom) + 20px); border-top: 1px solid var(--line); background: rgba(38, 41, 72, 0.96); backdrop-filter: blur(8px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); z-index: 10; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; color: var(--muted); text-decoration: none; }
.tabbar a.on { color: var(--blue); }

/* Join */
.join { min-height: 100dvh; padding-bottom: 32px; justify-content: flex-start; gap: 26px; padding-top: calc(env(safe-area-inset-top) + 64px); }
.join .big1 { font-size: 92px; }
.join .big2 { font-size: 60px; }
.join .big3 { font-size: 46px; color: var(--blue); }
.rules { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.rules div { height: 3px; }
.input { min-height: 52px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); padding: 0 16px; font: 400 17px 'Jost', sans-serif; width: 100%; }
textarea.input { padding: 14px 16px; min-height: 110px; resize: vertical; line-height: 1.4; }
.footnote { font-size: 13px; color: var(--muted); }

/* Overlays */
.overlay { position: fixed; inset: 0; z-index: 50; background: #0f1024; display: flex; flex-direction: column; }
.lightbox { background: rgba(10, 11, 26, 0.96); padding: calc(env(safe-area-inset-top) + 12px) 12px calc(env(safe-area-inset-bottom) + 16px); gap: 12px; }
.lightbox .stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.lightbox .stage > img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
.lightbox .stage.flip { cursor: pointer; touch-action: pan-y; }
.lightbox .stage.flip > img { position: absolute; inset: 0; margin: auto; opacity: 0; transform: scale(0.97); transition: opacity 0.28s ease, transform 0.28s ease; }
.lightbox .stage.flip > img.on { opacity: 1; transform: none; }
.seg { display: flex; align-self: center; padding: 4px; gap: 4px; border-radius: 999px; background: var(--card); }
.seg button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 600 15px 'Jost', sans-serif; transition: background 0.2s, color 0.2s; }
.seg button.on { background: var(--pink-btn); color: #fff; }
.tile .two { position: absolute; right: 5px; top: 5px; padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,0.6); color: #fff; font-size: 10px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .lightbox .stage.flip > img { transition: none; } }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(15, 16, 36, 0.6); color: #fff; display: inline-flex; align-items: center; justify-content: center; }

.camera video, .camera canvas.frozen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera video.mirror { transform: scaleX(-1); }
.camera .top { position: absolute; left: 16px; right: 16px; top: calc(env(safe-area-inset-top) + 14px); display: flex; justify-content: space-between; align-items: center; z-index: 2; }
.camera .steps { display: flex; gap: 8px; font-size: 13px; font-weight: 600; }
.camera .step { padding: 8px 12px; border-radius: 999px; background: rgba(15, 16, 36, 0.6); }
.camera .step.on { background: var(--pink-btn); }
.camera .step.done { color: var(--green); }
.camera .thumb { position: absolute; left: 16px; top: calc(env(safe-area-inset-top) + 72px); width: 112px; aspect-ratio: 3 / 4; border: 3px solid #fff; border-radius: 14px; overflow: hidden; z-index: 2; }
.camera .thumb img { width: 100%; height: 100%; object-fit: cover; }
.camera .count { position: absolute; left: 0; right: 0; top: 38%; text-align: center; font-size: 120px; z-index: 2; }
.camera .hint { position: absolute; left: 0; right: 0; top: calc(38% + 132px); text-align: center; font-size: 18px; font-weight: 600; z-index: 2; text-shadow: 0 1px 6px rgba(0,0,0,0.6); }
.camera .bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 20px calc(env(safe-area-inset-bottom) + 24px); background: rgba(15, 16, 36, 0.75); display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 2; }
.shutter { width: 78px; height: 78px; border-radius: 39px; border: 5px solid #fff; background: transparent; display: flex; align-items: center; justify-content: center; padding: 0; }
.shutter span { width: 58px; height: 58px; border-radius: 29px; background: var(--pink); }
.preview { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 20px); gap: 14px; background: #0f1024; z-index: 3; }
.preview .stage { position: relative; flex: 1; min-height: 0; border-radius: 18px; overflow: hidden; }
.preview .stage > img { width: 100%; height: 100%; object-fit: cover; }
.preview .pip-big { position: absolute; left: 12px; top: 12px; width: 32%; border: 3px solid #fff; border-radius: 12px; overflow: hidden; }
.preview .pip-big img { width: 100%; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 14px); transform: translateX(-50%); background: var(--text); color: var(--navy); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 60; max-width: 90vw; }

/* Tab bar holds five tabs */
.tabbar { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* Bingo */
.bingo-status { padding: 10px 14px; border-radius: 12px; background: var(--card); font-size: 14px; }
.bingo-status.review { background: var(--pink-btn); color: #fff; font-weight: 700; }
.bingo-status.certified { background: var(--green); color: var(--green-ink); font-weight: 700; }
.bingo-status.rejected { border: 1px solid var(--pink); }
.bingo-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.sq { position: relative; min-height: 86px; padding: 6px 5px 4px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; text-align: left; gap: 4px; min-width: 0; }
.sq-text { font-size: 11px; line-height: 1.2; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
.sq-meta { display: flex; justify-content: space-between; align-items: center; gap: 2px; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); min-width: 0; }
.sq-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq.on { background: var(--pink-btn); border-color: var(--pink-btn); }
.sq.on .sq-meta { color: #ffe3f2; }
.sq.free { align-items: center; justify-content: center; text-align: center; background: var(--navy-deep); border-color: var(--blue); }
.sq.free .sq-text { color: var(--blue); font-weight: 700; letter-spacing: .12em; }
.sq-check { color: #fff; display: inline-flex; flex: none; }
.sq[disabled] { cursor: default; }
.sq:focus-visible, .chip:focus-visible, .btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Feed */
.feed { display: flex; flex-direction: column; gap: 8px; }
.feed-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid transparent; font-size: 15px; }
.feed-item .label { font-size: 11px; margin-bottom: 2px; }
.feed-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.feed-thumb { position: relative; flex: none; width: 64px; height: 64px; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--card-2); }
.feed-thumb img { width: 100%; height: 100%; object-fit: cover; }
.feed-thumb .pip { position: absolute; left: 3px; top: 3px; width: 40%; aspect-ratio: 3 / 4; border: 2px solid #fff; border-radius: 4px; overflow: hidden; }
.feed-thumb .pip img { width: 100%; height: 100%; object-fit: cover; }
.badge { flex: none; width: 40px; height: 40px; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; background: var(--card-2); color: var(--blue); }
.k-ruling { border-color: var(--pink); }
.k-ruling .badge, .k-foul .badge, .k-objection .badge { color: var(--pink); }
.k-certify { border-color: var(--green); }
.k-certify .badge { color: var(--green); }
.k-bingo { border-color: var(--pink-btn); }
.chip svg { vertical-align: -3px; }

/* Commissioner card on Now */
.commish-card { border-color: var(--pink); }
.avatar { flex: none; width: 60px; height: 60px; border-radius: 30px; border: 3px solid var(--pink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; color: var(--pink); overflow: hidden; background: var(--navy-deep); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Bottom sheets */
.sheet-wrap { background: rgba(10, 11, 26, 0.7); justify-content: flex-end; }
.sheet { background: var(--navy); border-top: 2px solid var(--pink); border-radius: 20px 20px 0 0; padding: 20px 20px calc(env(safe-area-inset-bottom) + 20px); display: flex; flex-direction: column; gap: 12px; max-height: 92dvh; overflow: auto; }
select.input { appearance: auto; }

/* No-signal banner */
.offline { padding: 10px 14px; border-radius: 12px; background: #4a3a14; color: #ffe2a8; font-size: 14px; font-weight: 500; }

/* ---------- foul cards ---------- */
:root { --card-yellow: #ffd400; --card-red: #e8182c; }
.foul-post { border-radius: 16px; overflow: hidden; background: var(--card); border: 3px solid var(--card-yellow); display: flex; flex-direction: column; }
.foul-post.red { border-color: var(--card-red); }
.foul-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--card-yellow); color: #1a1a1a; font-size: 13px; }
.foul-post.red .foul-head { background: var(--card-red); color: #fff; }
.foul-head .muted { color: inherit; opacity: 0.75; }
.foul-word { font: 800 18px 'Jost', sans-serif; letter-spacing: 1px; }
.foul-word small { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; opacity: 0.85; margin-left: 4px; }
.foul-photo { position: relative; display: block; border: 0; padding: 0; background: #000; }
.foul-photo img { display: block; width: 100%; max-height: 70vh; object-fit: cover; }
.foul-text { padding: 10px 12px 12px; font-size: 15px; line-height: 1.4; }
.foul-text .muted { font-size: 14px; }
.pardon-stamp { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%) rotate(-14deg); padding: 6px 16px; border: 4px solid var(--blue); border-radius: 10px; color: var(--blue); background: rgba(15,16,36,0.75); font: 800 26px 'Jost', sans-serif; letter-spacing: 2px; white-space: nowrap; }
.wanted-cards { letter-spacing: 2px; font-size: 16px; }
.cardpick { display: flex; gap: 10px; }
.cardpick label { flex: 1; }
.cardpick input { position: absolute; opacity: 0; pointer-events: none; }
.cardpick span { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 12px; border: 2px solid var(--line); font-weight: 700; font-size: 17px; cursor: pointer; transition: transform 0.15s, background 0.15s; }
.cardpick .y input:checked + span { background: var(--card-yellow); border-color: var(--card-yellow); color: #1a1a1a; transform: rotate(-3deg); }
.cardpick .r input:checked + span { background: var(--card-red); border-color: var(--card-red); color: #fff; transform: rotate(3deg); }
.cardpick input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .foul-post.slam { animation: slam 0.55s cubic-bezier(.2,1.4,.4,1) both; }
  .foul-post.slam .whistle { animation: tweet 0.5s 0.35s ease-in-out 3; display: inline-flex; }
  @keyframes slam { 0% { transform: scale(1.35) rotate(-6deg); opacity: 0; } 60% { transform: scale(0.97) rotate(1deg); opacity: 1; } 80% { transform: translateX(-4px); } 90% { transform: translateX(4px); } 100% { transform: none; } }
  @keyframes tweet { 50% { transform: rotate(-18deg) scale(1.2); } }
}
