/* FURIA FEVER — participant (mobile first, thumb-friendly, one hand). */
.participant {
  min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom));
  background:
    var(--halftone) 0 0 / 14px 14px,
    radial-gradient(ellipse at 100% -10%, rgba(122, 43, 255, .45), transparent 55%),
    var(--ink);
}
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); background: rgba(9, 7, 12, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-logo { max-width: 92px; }
.top-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.top-meta strong { font: 1rem var(--display); text-transform: uppercase; }
.top-meta span { color: var(--acid); font-size: .78rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sound { min-height: 44px; width: 44px; padding: 0; font-size: 1.15rem; }
.now-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--purple); color: #fff; font-size: .9rem; }
.now-bar b { flex: none; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.now-bar span:last-child { opacity: .92; min-width: 0; overflow-wrap: anywhere; } /* wraps on 320 px instead of cutting */
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 4px rgba(220, 255, 31, .25); animation: blink 1.4s infinite; flex: none; }
@keyframes blink { 50% { opacity: .35; } }
.offline { position: sticky; top: 64px; z-index: 29; padding: 8px 14px; background: var(--danger); color: var(--ink); font-weight: 800; text-align: center; }

.shell { width: min(720px, 100%); margin: 0 auto; padding: 16px 14px 24px; }
.view { display: none; }
.view.active { display: block; animation: view-in .18s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
.view-head { margin: 6px 0 14px; }
.view-head h1 { margin: 4px 0 6px; font: clamp(1.8rem, 8vw, 2.6rem)/1 var(--display); text-transform: uppercase; letter-spacing: -.01em; }
.block { margin-top: 22px; }
.block-title { margin: 22px 0 10px; font: 1.15rem/1.1 var(--display); text-transform: uppercase; }
.card { margin: 0 0 16px; padding: 18px; background: var(--ink-2); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }
.card h2 { margin: 0 0 4px; font: 1.25rem/1.1 var(--display); text-transform: uppercase; }
.card .btn-block { margin-top: 16px; }
.opt { color: var(--muted); font-weight: 500; }
/* Festa × Clipe/Karaokê choice: two big thumb targets */
.mode-pick { margin: 14px 0 0; padding: 0; border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 0; }
.mode-pick legend { padding: 0; margin-bottom: 6px; font-weight: 700; font-size: .92rem; }
.mode-opt { position: relative; margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px; border-radius: 12px; cursor: pointer; background: var(--ink-3); box-shadow: inset 0 0 0 2px var(--line); font-weight: 600; }
.mode-opt input { position: absolute; opacity: 0; pointer-events: none; }
.mode-opt .tag { align-self: flex-start; padding: 2px 7px; font: 900 .72rem var(--text); letter-spacing: .08em; background: var(--cream); color: var(--ink); }
.mode-opt b { font: 1.05rem/1.1 var(--display); text-transform: uppercase; }
.mode-opt small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.mode-opt:has(input:checked) { background: var(--purple); box-shadow: inset 0 0 0 3px var(--acid), 4px 4px 0 var(--acid); }
.mode-opt:has(input:checked) .tag { background: var(--acid); }
.mode-opt:has(input:checked) small { color: #f1e9ff; }
.mode-opt:has(input:focus-visible) { outline: 3px solid var(--acid); outline-offset: 3px; }

/* Live card: the one thing that matters right now */
.live { position: relative; margin-bottom: 16px; padding: 18px; border-radius: var(--radius); background: var(--cream); color: var(--ink); box-shadow: 6px 6px 0 var(--purple); }
.live .eyebrow { color: var(--purple); }
.live h2 { margin: 6px 0 4px; font: clamp(1.6rem, 7.5vw, 2.3rem)/1 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.live p { margin: 6px 0 0; font-weight: 600; }
.live .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.live .actions .btn { flex: 1 1 auto; }
.live.dark { background: var(--ink-3); color: var(--cream); box-shadow: 6px 6px 0 var(--acid); }
.live.dark .eyebrow { color: var(--acid); }
.duel { display: grid; gap: 10px; margin-top: 12px; }
.vote-option { position: relative; display: block; width: 100%; min-height: 86px; padding: 14px 16px; border: 0; border-radius: 12px; text-align: left; cursor: pointer; color: var(--ink); background: #fff; box-shadow: inset 0 0 0 3px var(--ink); touch-action: manipulation; }
.vote-option:nth-of-type(2) { background: var(--acid); }
.vote-option small { display: block; font: 800 .72rem var(--text); letter-spacing: .14em; }
.vote-option strong { display: block; margin-top: 4px; font: 1.35rem/1.05 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.vote-option:disabled { cursor: default; opacity: .55; }
.vote-option.mine { opacity: 1; box-shadow: inset 0 0 0 4px var(--purple), 0 0 0 3px var(--purple); }
.vote-option.mine::after { content: 'SEU VOTO ✓'; position: absolute; top: 10px; right: 12px; background: var(--purple); color: #fff; font: 900 .7rem var(--text); letter-spacing: .1em; padding: 3px 6px; }
.versus { justify-self: center; font: 1.1rem var(--display); color: var(--purple); }
.timer-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.timer { font: 2rem/1 var(--display); font-variant-numeric: tabular-nums; min-width: 2.4ch; }
.timer.hot { color: #c0003c; }
.progress { flex: 1; height: 12px; background: rgba(9, 7, 12, .15); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--purple); transform-origin: left; transition: transform .25s linear; }

/* Personal checklist */
.panel { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 14px; background: var(--ink-2); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.row .ico { font-size: 1.4rem; text-align: center; }
.row b { display: block; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--acid); }
.row span { display: block; font-weight: 700; overflow-wrap: anywhere; }
.row .btn { min-height: 44px; padding: 0 12px; font-size: .9rem; }
.row.done { box-shadow: inset 0 0 0 1px #2c6a46; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.timeline li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; background: var(--ink-2); border-radius: 12px; }
.timeline li b { font: 1.05rem var(--display); color: var(--acid); }
.timeline li em { font-style: normal; font-variant-numeric: tabular-nums; font-weight: 800; color: var(--muted); }
.timeline li.done { opacity: .5; }
.timeline li.next { background: var(--acid); color: var(--ink); }
.timeline li.next b, .timeline li.next em { color: var(--ink); }

/* Costumes */
#costumeSearch { margin-bottom: 12px; }
.costume-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.costume { position: relative; min-height: 118px; padding: 14px; border: 0; border-radius: 12px; text-align: left; cursor: pointer; background: var(--ink-2); color: var(--cream); box-shadow: inset 0 0 0 1px var(--line); touch-action: manipulation; }
.costume-photo { display: block; aspect-ratio: 1; margin-bottom: 8px; border-radius: 8px; overflow: hidden; background: #16121a; }
.costume-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.costume .costume-initial { display: grid; place-items: center; color: var(--acid); font: 3rem/1 var(--display); }
.costume small { display: block; font: 800 .7rem var(--text); letter-spacing: .12em; color: var(--acid); }
.costume strong { display: block; margin: 6px 0 4px; font: 1.05rem/1.1 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.costume span { color: var(--muted); font-size: .9rem; }
.costume[aria-pressed="true"] { background: var(--cream); color: var(--ink); box-shadow: 5px 5px 0 var(--purple); }
.costume[aria-pressed="true"] small { color: var(--purple); }
.costume[aria-pressed="true"] span { color: #4a4152; }
.costume[aria-pressed="true"]::after { content: '✓'; position: absolute; top: 8px; right: 10px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--purple); color: #fff; font-weight: 900; }
.vote-bar { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px -14px 0; padding: 12px 14px; background: rgba(9, 7, 12, .95); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
.vote-bar span { font-weight: 900; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); border-radius: 12px; box-shadow: inset 0 0 0 1.5px dashed var(--line); border: 1.5px dashed var(--line); }

/* Films + bracket */
.film-list { display: grid; gap: 8px; }
.film { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 10px; padding: 12px 14px; background: var(--ink-2); border-radius: 12px; border: 2px dashed rgba(244, 237, 218, .18); }
.film i { font: 1.2rem var(--display); font-style: normal; color: var(--acid); }
.film strong { display: block; overflow-wrap: anywhere; }
.film span { color: var(--muted); font-size: .85rem; }
.film.mine { border-color: var(--acid); }
.bracket { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; }
.round { flex: 0 0 min(250px, 78vw); scroll-snap-align: start; display: flex; flex-direction: column; gap: 10px; }
.round h3 { margin: 0; font: 800 .75rem var(--text); letter-spacing: .14em; color: var(--acid); text-transform: uppercase; }
.bmatch { background: var(--ink-2); border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.bmatch div { padding: 9px 12px; font-size: .92rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bmatch div + div { border-top: 1px solid var(--line); }
.bmatch .ph { color: #7d7389; font-style: italic; font-weight: 500; }
.bmatch .win { background: var(--acid); color: var(--ink); }
.bmatch.live { box-shadow: inset 0 0 0 2px var(--acid); }

/* Interact */
.reactions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.reactions button { min-height: 58px; font-size: 1.8rem; border: 0; border-radius: 12px; background: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; touch-action: manipulation; }
.reactions button:active { transform: scale(.94); background: var(--purple); }
.reactions button:disabled { opacity: .45; }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; font-weight: 600; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--acid); }
/* the native file picker has an intrinsic ~376 px width: on 320 px phones it widened the page and pushed the tab bar off screen */
input[type="file"] { display: block; width: 100%; max-width: 100%; min-height: 44px; }
.photo-preview { display: block; margin-top: 10px; max-height: 220px; border-radius: 10px; object-fit: contain; }

/* Results */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.stat { padding: 14px; background: var(--ink-2); border-radius: 12px; }
.stat strong { display: block; font: 1.8rem var(--display); color: var(--acid); }
.stat span { color: var(--muted); font-size: .85rem; }
.podium { display: grid; gap: 8px; margin-bottom: 16px; }
.podium .place { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 14px; background: var(--ink-2); border-radius: 12px; }
.podium .place:first-child { background: var(--cream); color: var(--ink); box-shadow: 5px 5px 0 var(--purple); }
.podium .place b { font: 1.4rem var(--display); color: var(--acid); }
.podium .place:first-child b { color: var(--purple); }
.podium .place strong { display: block; overflow-wrap: anywhere; }
.champion { margin: 16px 0; padding: 20px; background: var(--acid); color: var(--ink); border-radius: var(--radius); box-shadow: 6px 6px 0 var(--purple); }
.champion strong { display: block; margin-top: 6px; font: clamp(1.8rem, 8vw, 2.6rem)/1 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }

/* Bottom tab bar */
/* toasts are transient, but never on top of the tab bar while they last */
.participant .toast-region { bottom: calc(76px + env(safe-area-inset-bottom)); }
.tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); background: rgba(9, 7, 12, .96); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.tabbar button { position: relative; min-height: 64px; border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 700 .72rem var(--text); cursor: pointer; }
.tabbar button span { font-size: 1.3rem; line-height: 1; }
.tabbar button.active { color: var(--acid); }
.tabbar button.active::before { content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; background: var(--acid); }
.tabbar button .badge.ok { background: var(--acid); }
.tabbar button .badge { position: absolute; top: 8px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: var(--ink); font: 900 .66rem/18px var(--text); }

/* Join modal */
/* MANICAS birthday (MANICAS.md) */
.mn-card-phone { box-shadow: inset 0 0 0 2px #ff2d95; }
.mn-reactions { grid-template-columns: repeat(4, 1fr); }
.mn-reactions .mn-paw { font-size: 1.8rem; }
.mn-hug-phone { margin: 18px 0 4px; font: 1.05rem/1.1 var(--display); text-transform: uppercase; }
.live.mn-live { box-shadow: 6px 6px 0 #ff2d95; }
.live.mn-live .eyebrow { color: #c4126c; }

/* Open duel: the vote is the only thing on the phone (ENGAGEMENT.md). The tab bar and every other section disappear
   (not just disabled) for everybody until the duel closes. */
.participant.duel-lock { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.participant.duel-lock .tabbar, .participant.duel-lock .vote-bar { display: none !important; }
.participant.duel-lock .view:not(#view-home) { display: none !important; }
.participant.duel-lock #view-home { display: block !important; }
.participant.duel-lock #view-home > :not(#liveCard) { display: none !important; }
.lock-note { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--ink); color: var(--acid); font-weight: 800; font-size: .92rem; line-height: 1.3; }
.lock-note[data-role="voted"] { background: var(--purple); color: #fff; }

/* Join modal: first thing after scanning the QR. Flex + margin:auto centers the card when it fits and pins it to the top
   when it does not, so the whole card (and the submit button) is always reachable by scrolling — a grid with
   place-items:center pushed part of a tall card out of the scrollable area. */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(5, 3, 8, .88); backdrop-filter: blur(6px); }
.modal-card { flex: none; margin: auto 0; width: min(460px, 100%); padding: 22px 18px; background: var(--ink-2); border-radius: 16px; box-shadow: 0 0 0 1px var(--line), 8px 8px 0 var(--purple); }
.modal-logo { max-width: min(240px, 70%); margin: 0 auto 6px; }
.modal-card h1 { margin: 6px 0; text-align: center; font: 1.8rem/1 var(--display); text-transform: uppercase; }
.modal-card > .help:first-of-type { text-align: center; }
.no-costume { margin-top: 10px; }
.no-costume[aria-pressed="true"] { background: var(--acid); color: var(--ink); box-shadow: none; }
.modal-card .btn-acid { margin-top: 16px; }
/* Office or at home: two big targets, the first thing to answer */
.where-pick { margin: 10px 0 0; padding: 0; border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-width: 0; }
.where-opt { position: relative; margin: 0; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 6px; border-radius: 10px; text-align: center; cursor: pointer; background: var(--ink-3); box-shadow: inset 0 0 0 1.5px var(--line); }
.where-opt input { position: absolute; opacity: 0; pointer-events: none; }
.where-opt b { font-size: .95rem; line-height: 1.15; }
.where-opt small { color: var(--muted); font-size: .72rem; font-weight: 600; line-height: 1.15; }
.where-opt:has(input:checked) { background: var(--purple); box-shadow: inset 0 0 0 2px var(--acid); }
.where-opt:has(input:checked) small { color: #f1e9ff; }
.where-opt:has(input:focus-visible) { outline: 3px solid var(--acid); outline-offset: 2px; }
.modal-card .reenter { color: var(--acid); font-weight: 800; }
.reentry-only #joinHelp, .reentry-only #wherePick, .reentry-only #costumeBox, .reentry-only #homeNote { display: none; }
#joinWatch { margin-top: 8px; }
.where-home { margin-top: 12px; padding: 10px 12px; border-radius: 10px; color: var(--cream); background: rgba(25, 199, 192, .14); box-shadow: inset 0 0 0 1px rgba(25, 199, 192, .55); }
/* short phones (320×568 and landscape): compact card so name, costume and the submit button fit without scrolling */
@media (max-height: 700px) {
  .modal-card { padding: 14px 14px 16px; }
  .modal-logo { max-width: min(104px, 40%); max-height: 56px; margin-bottom: 0; }
  .where-pick { margin-top: 6px; }
  .modal-card h1 { margin: 2px 0 4px; font-size: 1.45rem; }
  .modal-card .help { margin: 4px 0; font-size: .85rem; line-height: 1.3; }
  .modal-card label { margin: 10px 0 4px; }
  .modal-card input { min-height: 46px; padding: 10px 12px; }
  .modal-card .btn { min-height: 46px; }
  .no-costume { margin-top: 8px; }
  .modal-card .btn-acid { margin-top: 10px; }
}

/* Smallest phones: the re-entry line stays, "Primeira vez?…" gives its room so the button needs no scrolling. */
@media (max-height: 620px) {
  .modal-card #joinHelp { display: none; }
}

@media (min-width: 720px) {
  .costume-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .top-logo { max-width: 120px; }
}
