/* ======================================================================
   SHARED FINALS ARENA LAYOUT — single source of truth.
   Host classes (.finals-head/.vote-bar/.vote-lanes/.vlane/.vl-*) and
   /play classes (.pa-finals-head/.pa-bar/.pa-lanes/.pa-lane/.pa-*) are
   grouped so the two views lay out IDENTICALLY and can never drift.
   This file owns SIZE + POSITION only; per-page CSS keeps its own colors.
   Loaded LAST on both pages so it wins the cascade for layout props.
   The finals container itself is given identical fixed-overlay positioning
   on each page (host: body[data-view=finals] .view-finals ; /play: #pArena).
   ====================================================================== */

/* Consistent text rendering across OSes: force ANTIALIASED smoothing on every element so macOS (which defaults to the
   heavier subpixel smoothing) matches Windows/Linux. Set here because BOTH the host page and /play load arena.css. */
*, *::before, *::after { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ---- head: FINALS title + round pill, centered column ---- */
.finals-head, .pa-finals-head{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; gap:10px; position:relative; margin:0 0 12px;
}
.finals-head .page-title, .pa-title{
  font-family:var(--display); font-weight:900; letter-spacing:-1px;
  font-size:clamp(38px,6.4vw,88px); line-height:.94; margin:0;
}

/* ---- wave bar: "N finalists" pinned left, wave centered, timer right ---- */
.vote-bar, .pa-bar{
  position:relative; display:flex; justify-content:center;
  left:auto; transform:none;
  width:min(100%,1160px); margin:0 auto 14px; box-sizing:border-box;
}
.vote-mix, .pa-mix{ width:100%; }
.vote-fin-count, .pa-fin-count{
  position:absolute; right:100%; top:50%; transform:translateY(-50%);
  padding:0 14px 0 0; white-space:nowrap;
  font-size:12.5px; font-weight:800; color:#9aa0ad;
  border:0; background:none; border-radius:0; font-variant-numeric:tabular-nums;
}

/* ---- cards row ---- */
.vote-lanes, .pa-lanes{
  display:flex; gap:10px; align-items:stretch;
  left:auto; transform:none;
  width:min(100%,1160px); margin:0 auto; box-sizing:border-box;
}
.vlane, .pa-lane{
  flex:1 1 0; min-width:0; display:flex; flex-direction:column;
  align-items:stretch; gap:8px; padding:14px 12px; box-sizing:border-box;
}

/* ---- text parity: identical type + indicators on both views ---- */
.vl-rank, .pa-rank{ font-family:var(--body); position:absolute; top:6px; left:8px; z-index:2; }  /* # moved to the lane's top-left corner */
.vl-head, .pa-head{ justify-content:center; }            /* avatar centered */
/* finalist name back UNDER each lane avatar (Dru: "we need their names visible during finals") — identical on host + /play */
.vl-name, .pa-name{ display:block; text-align:center; font-family:var(--body); font-weight:800; font-size:12px; line-height:1.1; color:#fff; letter-spacing:.2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; margin-top:4px; text-shadow:0 1px 3px rgba(0,0,0,.8); }
.vl-name:empty, .pa-name:empty{ display:none; }
.vlane.mine::before, .pa-lane.my-vote::before{
  content:"\25C6 YOUR VOTE"; position:absolute; bottom:3px; left:0; right:0;
  text-align:center; font-weight:900; font-size:8.5px; letter-spacing:.6px;
  color:#7fc4ff; text-shadow:0 0 8px rgba(61,169,255,.9); z-index:3;
}

/* ---- producer profile modal (ported from the host leaderboard, /play parity) ---- */
.modal{position:fixed;inset:0;z-index:90;display:grid;place-items:center;padding:5vh 4vw;background:rgba(6,5,12,.72);-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);animation:pmFade .25s}
.modal[hidden]{display:none}
.modal-card{position:relative;width:min(560px,94vw);background:#161821;border:1px solid #2c2f3a;border-radius:24px;padding:30px;box-shadow:0 30px 90px rgba(0,0,0,.6);animation:pmPop .35s cubic-bezier(.2,.8,.2,1)}
.modal-card .overlay-close{position:absolute;top:18px;right:18px;width:34px;height:34px;border:none;border-radius:50%;font-size:13px;cursor:pointer;background:rgba(255,255,255,.07);color:#cfd3dc;display:grid;place-items:center}
@keyframes pmFade{from{opacity:0}to{opacity:1}}
@keyframes pmPop{from{transform:scale(.9) translateY(12px);opacity:0}to{transform:none;opacity:1}}
.pm-head{display:flex;align-items:center;gap:16px;margin-bottom:22px}
.pm-head img{width:66px;height:66px;border-radius:18px;object-fit:cover}
.pm-head .pm-badge{width:52px;height:52px}.pm-head .pm-badge svg{width:52px;height:52px}
.pm-name{font-family:var(--display);font-weight:800;font-size:26px;letter-spacing:-.8px;line-height:1.1}
.pm-rank{font-size:13px;font-weight:600;margin-top:3px}
.pm-elo{margin-left:auto;margin-right:44px;text-align:right}.pm-elo b{font-family:var(--display);font-size:27px;font-weight:600}.pm-elo span{display:block;font-size:11px;color:var(--muted)}
.pm-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:11px}
.pm-stat{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:15px 10px;text-align:center}
.pm-stat b{font-family:var(--display);font-weight:800;font-size:24px;display:block;letter-spacing:-.5px}
.pm-stat span{font-size:10.5px;color:var(--muted);letter-spacing:.3px}
.pm-disttitle{font-size:11px;color:var(--muted);letter-spacing:.5px;margin:20px 0 8px;font-weight:600}
.pm-dist{display:flex;height:16px;border-radius:8px;overflow:hidden;background:var(--panel);gap:2px}
.pm-dist i{display:block;height:100%;min-width:2px;transition:flex .4s}
.pm-legend{display:flex;gap:14px;flex-wrap:wrap;margin-top:10px;font-size:11.5px;color:var(--muted)}
.pm-legend span{display:flex;align-items:center;gap:5px}.pm-legend i{width:9px;height:9px;border-radius:2px;display:inline-block}

/* ===================== WELCOME/SETTINGS MENU (.hv-*) — shared by /play (display) + the host control-panel live editor (#helpEditOverlay).
   Moved here (was inline in play.html) so BOTH pages render it identically. Edit-mode selectors are container-agnostic (.hv-editing). ===================== */
.hv-card{width:min(720px,96vw);max-height:calc(90vh / var(--uisc,1));display:flex;flex-direction:column;background:#14151b;border:1px solid #2c2f3a;border-radius:18px;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.6)}
.hv-card, .hv-card p, .hv-card li, .hv-card span, .hv-card a, .hv-card b, .hv-card i, .hv-ctl *{font-family:-apple-system,"Segoe UI",system-ui,"Helvetica Neue",Arial,sans-serif !important}
.hv-top{display:flex;align-items:center;gap:10px;padding:13px 16px 0;flex-wrap:wrap}
.hv-tabs{display:flex;gap:6px;flex-wrap:wrap;padding:12px 16px 0}
.hv-tab{font-family:'Alagard',monospace !important;font-size:15px;letter-spacing:.02em;color:#9aa0b0;background:rgba(255,255,255,.04);border:1px solid #2c2f3a;border-radius:10px 10px 0 0;padding:9px 14px;cursor:pointer;transition:.14s}
.hv-tab:hover{color:#eef0f6;background:rgba(255,255,255,.08)}
.hv-tab.active{color:#140d1f;background:linear-gradient(180deg,#ffc48a,#f0a35f);border-color:#f0a35f}
.hv-body{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:16px 20px 22px;border-top:1px solid #2c2f3a}
.hv-pane{display:flex;flex-direction:column;gap:11px}
.hv-title{font-family:'Alagard',monospace !important;font-size:26px;color:#ffce5a;margin:0;letter-spacing:.03em;text-shadow:0 0 16px rgba(255,206,90,.25)}
.hv-sub{margin:-6px 0 4px;font-size:15px;color:#c4a7ef}
.hv-h{font-family:'Alagard',monospace !important;font-size:18px;color:#9fe8ff;margin:8px 0 0;letter-spacing:.03em}
.hv-card p{margin:0;font-size:15.5px;line-height:1.5;color:#dfe2ea}
.hv-card b{font-weight:800;color:#fff}
.hv-steps{display:flex;flex-direction:column;gap:8px;margin:2px 0 0;text-align:left}
.hv-step{display:flex;align-items:flex-start;gap:11px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.07);border-radius:11px;padding:10px 13px;font-size:15px;line-height:1.45;color:#dfe2ea;text-align:left}
.hv-step::before{content:'';flex:0 0 10px;width:10px;height:10px;margin-top:5px;background:#f0a35f;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
.hv-steps.warn .hv-step::before{background:#ff5e7a}
.hv-step b{color:#fff}
.hv-ps{font-size:13.5px;color:#9aa0b0;font-style:italic;margin-top:6px}
.hv-link{color:#ffce5a;text-decoration:underline;font-weight:700}
.hv-legend{display:flex;flex-direction:column;gap:8px;background:rgba(0,0,0,.25);border-radius:12px;padding:12px 14px}
.hv-leg{display:flex;align-items:center;gap:10px;font-size:14.5px}
.hv-leg b{flex:0 0 auto;min-width:128px;color:#fff}
.hv-leg span{color:#aeb4c2}
.hv-dot{width:18px;height:18px;border-radius:5px;flex:0 0 auto;box-shadow:0 0 10px currentColor}
.hv-tiers{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;background:rgba(0,0,0,.25);border-radius:12px;padding:14px}
.hv-tier{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:70px}
.hv-tier b{font-family:'Alagard',monospace !important;font-size:13px;letter-spacing:.04em}
.hv-tier small{font-size:11px;color:#9aa0b0}
.hv-ctl{display:flex;flex-direction:column;gap:0}
.hv-crow{display:flex;align-items:center;gap:14px;padding:11px 4px;border-bottom:1px solid rgba(255,255,255,.06)}
.hv-crow:last-child{border-bottom:0}
.hv-key{flex:0 0 128px;display:flex;flex-wrap:wrap;gap:5px}
.hv-kc{font-weight:800;font-size:12.5px;color:#140d1f;background:#cbd0db;border-radius:6px;padding:4px 8px;box-shadow:0 2px 0 #8a8f9c;white-space:nowrap}
.hv-cd{flex:1;font-size:14.5px;color:#dfe2ea;line-height:1.4}
.hv-cnote{margin-top:10px;padding-top:10px;border-top:1px solid rgba(255,255,255,.06);font-size:13px;color:#9aa0ad;line-height:1.45}
/* live editor (host control panel) — container-agnostic so it works on #helpEditOverlay */
.hv-editing [data-ek]{outline:1px dashed rgba(127,224,255,.6);outline-offset:3px;border-radius:4px;cursor:text;transition:outline-color .15s}
.hv-editing [data-ek]:hover{outline-color:#7fe0ff}
.hv-editing [data-ek]:focus{outline:2px solid #7fe0ff;background:rgba(127,224,255,.08)}
.hv-edithint{margin:12px 16px 0;padding:9px 12px;background:rgba(90,180,255,.1);border:1px solid rgba(90,180,255,.3);border-radius:10px;font-family:-apple-system,"Segoe UI",system-ui,sans-serif;font-size:12.5px;color:#bfe6f5;line-height:1.45;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.hv-edithint[hidden]{display:none}
.hv-resetall{font-family:-apple-system,"Segoe UI",system-ui,sans-serif;font-weight:700;font-size:11.5px;color:#ffb4b4;background:rgba(255,90,110,.12);border:1px solid rgba(255,90,110,.4);border-radius:8px;padding:5px 10px;cursor:pointer;margin-left:auto}
.hv-resetall:hover{background:rgba(255,90,110,.22)}
.hv-eclose{position:absolute;top:10px;right:12px;background:none;border:none;color:#cfd3dc;font-size:22px;line-height:1;cursor:pointer}
.hv-etitle{font-family:'Alagard',monospace !important;font-size:17px;color:#9fe8ff;letter-spacing:.02em;margin-right:auto}
