/* Super Sims - Ranked. Global display rules from the spec. */
:root {
  --navy: #252A45;
  --blue: #515FA2;
  --sky: #AADAF0;
  --lav: #CAA6CE;
  --red: #CD4D66;
  --yellow: #FFE48C;
  --green: #63BF85;
  --sub: rgba(37, 42, 69, 0.45);   /* sub-row on blue */
  --sub-strong: rgba(37, 42, 69, 0.7);
  --c-str: var(--red);
  --c-end: var(--yellow);
  --c-men: var(--green);
  --c-lik: var(--sky);
  --c-inf: var(--lav);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--navy);
  color: var(--sky);
  font-family: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", sans-serif;
  font-size: 16px;
  min-height: 100vh;
}
a { color: var(--lav); }
button, input, select { font-family: inherit; }
.hidden { display: none !important; }
.dim { opacity: .55; }
.muted { color: var(--sky); opacity: .7; }
.y { color: var(--yellow); }
.r { color: var(--red); }
.l { color: var(--lav); }
.b { font-weight: bold; }

/* ------------------------------------------------------------------ header */
.site-header {
  max-width: 1440px; margin: 0 auto; padding: 26px 40px 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
}
.logo {
  font-size: 68px; font-weight: bold; color: var(--lav); letter-spacing: 3px;
  text-decoration: none; line-height: 1; margin: 6px 0 0 160px; white-space: nowrap;
}
.account { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.account-panel {
  background: var(--blue); border-radius: 12px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
}
.account-panel input {
  background: var(--navy); color: var(--sky); border: 0; border-radius: 8px;
  height: 36px; width: 180px; padding: 0 14px; font-size: 16px;
}
.account-panel input::placeholder { color: var(--sky); opacity: .7; }
.account-panel .who { padding: 0 6px 0 6px; font-size: 17px; }
.account-panel .who b { color: var(--lav); }
.signup-hint { font-size: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; cursor: pointer; font-weight: bold;
  text-decoration: none; font-size: 17px; height: 36px; padding: 0 20px;
  background: var(--lav); color: var(--navy);
}
.btn:hover { filter: brightness(1.06); }
.btn-blue { background: var(--blue); color: var(--sky); }
.btn-yellow { background: var(--yellow); color: var(--navy); }
.btn-red { background: var(--red); color: var(--navy); }
.btn-sky { background: var(--sky); color: var(--navy); }
.btn-navy { background: var(--navy); color: var(--yellow); }
.btn-navy.r { color: var(--red); }
.btn-pill { border-radius: 999px; }
.btn-big { height: 52px; font-size: 21px; padding: 0 34px; min-width: 190px; }
.divider { max-width: 1280px; margin: 20px auto 0; border: 0; border-top: 2px solid var(--blue); }

.flash { max-width: 900px; margin: 16px auto 0; padding: 12px 18px; border-radius: 10px;
  background: var(--blue); border: 2px solid var(--yellow); color: var(--yellow); }
.flash.error { border-color: var(--red); color: var(--sky); }

/* ------------------------------------------------------------------ layout */
.page { max-width: 1440px; margin: 0 auto; padding: 18px 24px 40px; overflow-x: clip; }
.game { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 26px; align-items: start; }
.game-main { min-width: 0; }

.sidebar {
  background: var(--blue); border-radius: 16px; padding: 18px 16px 20px;
  position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow-y: auto;
  display: flex; flex-direction: column; min-height: 724px;
}
.sidebar h3 { color: var(--sky); font-size: 19px; margin: 6px 4px 10px; }
.sidebar h3 small { font-size: 13px; font-weight: normal; opacity: .75; }
.sidebar .prev { display: flex; flex-direction: column; gap: 6px; }
.sidebar .later-h { margin-top: 22px; }
.sidebar .rnd-row { display: flex; align-items: stretch; background: var(--sub); border-radius: 7px; }
.sidebar .rnd-row a { flex: 1; color: var(--lav); text-decoration: none; padding: 5px 14px; font-size: 16px; }
.sidebar .rnd-row a:hover { color: var(--yellow); }
.sidebar .rnd-toggle { width: 36px; border: 0; background: none; color: var(--sky); font-size: 22px; line-height: 1; cursor: pointer;
  border-radius: 0 7px 7px 0; }
.sidebar .rnd-toggle .chev { display: inline-block; width: 8px; height: 8px; border-right: 2px solid var(--sky); border-bottom: 2px solid var(--sky);
  transform: rotate(-45deg); transition: transform .15s; }
.sidebar .rnd-toggle:hover { background: var(--sub-strong); }
.sidebar .rnd.open .rnd-toggle .chev { transform: translateY(-3px) rotate(45deg); }
.sidebar .rnd-segs { display: none; flex-direction: column; gap: 4px; padding: 6px 0 4px 14px; }
.sidebar .rnd.open .rnd-segs { display: flex; }
.sidebar .rnd-segs a { color: var(--sky); text-decoration: none; font-size: 15px; padding: 4px 10px; border-radius: 6px; background: var(--sub); opacity: .9; }
.sidebar .rnd-segs a:hover { opacity: 1; color: var(--yellow); }
.sidebar .round-head {
  color: var(--lav); font-size: 28px; font-weight: bold; text-align: center;
  padding: 14px 0 10px; border-bottom: 2px solid var(--lav); margin: 6px 4px 12px;
}
.sidebar .segs { display: flex; flex-direction: column; gap: 8px; }
.sidebar .segs a {
  display: block; background: var(--sub-strong); color: var(--sky); text-decoration: none;
  border-radius: 8px; padding: 9px 16px; font-size: 17px; opacity: .92;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar .segs a.on {
  background: var(--navy); color: var(--yellow); font-weight: bold;
  box-shadow: inset 6px 0 0 var(--yellow); opacity: 1;
}
.sidebar .back { margin-top: auto; padding-top: 24px; display: flex; justify-content: center; }
.sidebar .back .btn { width: 240px; height: 44px; border-radius: 999px; font-size: 19px; }

.screen-title {
  text-align: center; font-size: 38px; font-weight: bold; margin: 4px 0 18px;
  display: flex; justify-content: center; gap: 30px; flex-wrap: wrap;
}
.screen-title .rl { color: var(--lav); }
.screen-title .dash { color: var(--sky); }
.screen-title .seg { color: var(--yellow); }

.continue-row { display: flex; justify-content: center; gap: 24px; margin-top: 24px; }

/* ------------------------------------------------------------------ panels */
.panel { background: var(--blue); border-radius: 16px; padding: 18px 24px 24px; margin-bottom: 20px; }
.panel-narrow { max-width: 600px; margin-left: auto; margin-right: auto; }
.panel-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  border-bottom: 2px solid var(--lav); padding-bottom: 8px; margin-bottom: 14px; flex-wrap: wrap;
}
.panel-head h2 { color: var(--lav); font-size: 23px; margin: 0; }
.panel-head .note { font-size: 14px; color: var(--sky); }
.panel h4 { color: var(--lav); font-size: 18px; margin: 16px 0 8px; }
.legend {
  background: var(--navy); border-radius: 7px; padding: 4px 10px; font-size: 14px;
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.legend .sw { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; margin-right: 4px; }
.legend .sw-rank { border: 1.5px solid var(--sky); color: var(--sky); font-size: 11px; font-weight: bold; text-align: center; line-height: 13px; }
.legend .sw-inf { background: var(--lav); }
.legend .sw-lik { background: var(--sky); }

.navy-box { background: var(--navy); border-radius: 10px; padding: 8px; }
.sub-box { background: var(--sub); border-radius: 8px; padding: 6px 8px; }

/* ------------------------------------------------------------------ name pill */
.pill {
  --c: var(--red);
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--c); border: 2px solid var(--navy); border-radius: 7px;
  height: 32px; min-width: 0; width: 144px; padding: 0 3px; color: var(--on-rank, var(--navy));
  font-weight: bold; font-size: 13px; vertical-align: middle; flex: none;
}
.pill .rk {
  background: var(--navy); color: var(--sky); border-radius: 5px; flex: none;
  min-width: 22px; height: 24px; padding: 0 3px; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.pill .nm { flex: 1; min-width: 0; overflow: hidden; text-align: center; white-space: nowrap; }
.fit { display: inline-block; white-space: nowrap; }
.pill .st {
  flex: none; min-width: 24px; height: 24px; border: 2px solid var(--navy); border-radius: 5px;
  font-size: 12px; display: inline-flex; align-items: center; justify-content: center; padding: 0 2px;
  color: var(--navy);   /* stat boxes have their own color, not the rank gradient */
}
.pill .st-inf { background: var(--lav); }
.pill .st-lik { background: var(--sky); }
/* Rank colors touching navy get a border in the season's Text Color (invisible with navy text). */
.navy-box .pill, .navy-box .box-rank, .navy-box .rankbox,
.navy-row .pill, .navy-row .box-rank, .navy-row .rankbox,
.on-navy .pill, .on-navy .box-rank, .on-navy .rankbox,
.arow .pill, .arow .box-rank, .arow .rankbox,
.cand .pill, .cand .box-rank, .cand .rankbox,
.push .pill, .push .box-rank, .push .rankbox,
.vote-col .pill, .vote-col .box-rank, .vote-col .rankbox,
.banner-box .pill, .banner-box .box-rank, .banner-box .rankbox,
.who-row .pill, .who-row .box-rank, .who-row .rankbox,
.fracture .pill, .fracture .box-rank, .fracture .rankbox,
.crow .pill, .crow .box-rank, .crow .rankbox,
.stat-card .pill, .stat-card .box-rank, .stat-card .rankbox,
.equity .card .pill, .equity .card .box-rank, .equity .card .rankbox,
.jury-row .pill, .jury-row .box-rank, .jury-row .rankbox,
.tally-cards .card .pill, .tally-cards .card .box-rank, .tally-cards .card .rankbox,
.conn .pill, .conn .box-rank, .conn .rankbox,
.swap-card .pill, .swap-card .box-rank, .swap-card .rankbox,
.jvote .pill, .jvote .box-rank, .jvote .rankbox,
.summary .card .pill, .summary .card .box-rank, .summary .card .rankbox { border-color: var(--on-rank, var(--navy)); }
.pill.lg { height: 40px; width: 100%; font-size: 21px; }
.pill.lg .rk { height: 28px; min-width: 26px; font-size: 13px; }
.pill.lg .st { height: 28px; min-width: 30px; font-size: 17px; }
.pill.wide { width: 100%; }
.pill.sm { width: 120px; height: 28px; }
.pill.sm .rk, .pill.sm .st { height: 20px; }
.pill.out { outline: 3px solid var(--yellow); outline-offset: -1px; }
.pill.gone { opacity: .45; }
.pill.nobadge .rk { display: none; }

/* ------------------------------------------------------------------ tags */
.tag {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-weight: bold; font-size: 12px; letter-spacing: .5px;
  height: 22px; padding: 0 10px; white-space: nowrap; flex: none;
}
.tag-new { background: var(--yellow); color: var(--navy); border: 2px solid var(--navy); font-size: 15px; height: 26px; }
.tag-lie { background: var(--red); color: var(--yellow); border: 2px solid var(--navy); min-width: 34px; font-size: 13px; }
.tag-alt { background: var(--lav); color: var(--navy); }
.tag-mutual { background: var(--lav); color: var(--navy); border: 2px solid var(--navy); font-size: 13px; }
.tag-ends { --c: var(--red); background: var(--c); color: var(--on-rank, var(--navy)); border: 2px solid var(--navy); font-size: 13px; }
.tag-ufe { background: var(--red); color: var(--navy); border: 2px solid var(--navy); }
.tag-deranked { background: var(--red); color: var(--navy); border: 2px solid var(--navy); }
.tag-self { background: var(--lav); color: var(--navy); }
.tag-throw { background: var(--yellow); color: var(--navy); border: 2px solid var(--navy); }
.tag-tiebreak { background: var(--yellow); color: var(--navy); }
.tag-held { background: var(--sky); color: var(--navy); min-width: 118px; }
.tag-fractured { background: var(--red); color: var(--navy); min-width: 118px; }
.tag-n1 { background: var(--navy); color: var(--yellow); }
.tag-winner { background: var(--yellow); color: var(--navy); border: 2px solid var(--navy); }
.tag-finalist { background: var(--lav); color: var(--navy); border: 2px solid var(--navy); }
.tag-jury { background: var(--sky); color: var(--navy); border: 2px solid var(--navy); }
.dup {
  background: var(--lav); color: var(--navy); border-radius: 999px; font-weight: bold;
  font-size: 16px; height: 26px; min-width: 42px; display: inline-flex; align-items: center; justify-content: center;
}
.crown { display: inline-block; width: 15px; height: 10px; margin-right: 5px; vertical-align: -1px;
  background: var(--on-rank, var(--navy));
  clip-path: polygon(0 100%, 0 10%, 25% 55%, 50% 0, 75% 55%, 100% 10%, 100% 100%); }

/* ------------------------------------------------------------------ stat chips */
.chips { display: inline-flex; gap: 6px; flex: none; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 26px; border-radius: 6px; border: 2px solid var(--navy);
  color: var(--navy); font-weight: bold; font-size: 14px;
}
.chip-head { height: 20px; font-size: 10px; letter-spacing: .5px; }
.chip-str { background: var(--c-str); }
.chip-end { background: var(--c-end); }
.chip-men { background: var(--c-men); }
.chip-lik { background: var(--c-lik); }
.chip-inf { background: var(--c-inf); }

/* ------------------------------------------------------------------ rank bars */
/* Text on rank colors uses the season's Text Color (--on-rank, set on .game).
   PREVIEW ONLY: ?badges=text makes borders and rank badges follow it too. */
.badges-text .bar, .badges-text .pill, .badges-text .box-rank { border-color: var(--on-rank, var(--navy)); }
.badges-text .bar .rk, .badges-text .pill .rk { background: var(--on-rank, var(--navy)); color: var(--navy); }
/* Navy boxes sitting on a rank color get a thin ring in the season's Text Color. */
.bar .rk, .bar .chips, .bar .cell, .pill .rk { box-shadow: inset 0 0 0 1.5px var(--on-rank, var(--navy)); }
/* Stat chips sit on a navy strip so they never blend into the bar color. */
.bar .chips { background: var(--navy); padding: 4px; border-radius: 7px; }
.roster-head .chips, .bar-head .chips { padding: 0 4px; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar {
  --c: var(--red);
  display: flex; align-items: center; gap: 14px; min-height: 40px;
  background: var(--c); border: 3px solid var(--navy); border-radius: 9px; padding: 3px 6px;
  color: var(--on-rank, var(--navy)); font-weight: bold;
}
.bar .rk {
  background: var(--navy); color: var(--sky); border-radius: 6px; min-width: 40px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 17px; flex: none; padding: 0 6px;
}
.bar .rk.red { color: var(--red); }
.bar .rk.y { color: var(--yellow); }
.bar .nm { font-size: 20px; min-width: 0; overflow: hidden; white-space: nowrap; flex: 0 1 150px; }
.bar .nm small { display: block; font-size: 11px; line-height: 1; font-weight: normal; }
.bar .grow { flex: 1; }
.bar .cell {
  background: var(--navy); color: var(--sky); border-radius: 6px; height: 30px; min-width: 90px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; flex: none; padding: 0 8px;
}
.cell .mini {
  --c: var(--red);
  background: var(--c); color: var(--on-rank, var(--navy)); border-radius: 4px; padding: 1px 6px; font-size: 13px;
}
.cell.dimmed { color: rgba(170, 218, 240, .45); }
.bar-head { display: flex; gap: 14px; align-items: center; padding: 0 9px; font-weight: bold; font-size: 15px; }
.cell-head { min-width: 90px; text-align: center; flex: none; }
.up { color: var(--yellow) !important; }
.down { color: var(--red) !important; }
.same { color: rgba(170, 218, 240, .55) !important; }
.arrow-up::before { content: "↑"; color: var(--yellow); font-weight: bold; font-size: 18px; }
.arrow-down::before { content: "↓"; color: var(--red); font-weight: bold; font-size: 18px; }
.to-arrow { color: var(--sky); font-size: 22px; padding: 0 4px; }

/* ------------------------------------------------------------------ alliance rows */
.alliances { display: flex; flex-direction: column; gap: 12px; }
.arow { background: var(--navy); border-radius: 10px; padding: 8px 10px; display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.arow .members { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.arow .members .pill { width: 144px; height: 32px; font-size: 15px; }
.arow.with-targets { grid-template-columns: 46px minmax(0, 1fr) 2px 160px 160px; }
.arow .vsep { background: var(--blue); width: 2px; align-self: stretch; }
.target-head { display: grid; grid-template-columns: 1fr 160px 160px; gap: 8px; text-align: center; font-weight: bold; color: var(--sky); }
.na { background: var(--sub-strong); background: #383F6E; color: var(--sky); border-radius: 7px; height: 32px;
  display: flex; align-items: center; justify-content: center; font-weight: bold; }
.lie-wrap { position: relative; display: inline-block; }
.lie-wrap .tag-lie, .lie-wrap .tag-alt { position: absolute; top: -14px; right: -6px; height: 20px; min-width: 26px; font-size: 11px; padding: 0 5px; }
.deals { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px 28px; }
.deal {
  position: relative; background: var(--sub); border-radius: 8px; padding: 4px 8px; max-width: 100%;
  display: flex; flex-direction: column; gap: 4px;
}
.deal::before { content: ""; position: absolute; left: -24px; top: -10px; width: 18px; height: 26px;
  border-left: 2px solid rgba(170, 218, 240, .45); border-bottom: 2px solid rgba(170, 218, 240, .45); }
.deal.narrow { max-width: 760px; }
.drow { display: flex; align-items: center; gap: 10px; min-height: 32px; white-space: nowrap; }
.drow .word { min-width: 42px; text-align: right; font-size: 15px; color: var(--sky); }
.drow .word.lead { min-width: 0; }
.drow .rankbox { --c: var(--lav); background: var(--c); color: var(--on-rank, var(--navy)); font-weight: bold; border: 2px solid var(--navy); border-radius: 6px; padding: 1px 6px; font-size: 14px; }
.drow .rankbox.red { background: var(--red); }
.drow.needs { opacity: .6; }
.drow .spacer { width: 144px; flex: none; }
.drow .noswap { color: var(--sky); opacity: .75; font-size: 15px; }

/* candidate cards */
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.cand { background: var(--navy); border-radius: 10px; padding: 8px; }
.cand .pill { width: 100%; }
.cand-caption { text-align: center; padding: 8px 0 2px; color: var(--sky); font-size: 15px; white-space: nowrap; }
.cand-caption b { color: var(--yellow); }

/* pushing bar */
.push { background: var(--navy); border-radius: 10px; padding: 10px 12px 10px; }
.push-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.push-top .pill { width: 116px; }
.push-top .count { font-size: 18px; }
.push-top .count b { color: var(--yellow); }
.push-top .right { margin-left: auto; font-size: 16px; }
.push-top .right small { font-size: 13px; opacity: .8; margin-right: 8px; }
.meter { position: relative; height: 12px; background: var(--blue); border-radius: 999px; margin: 26px 0 4px; }
.meter .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--yellow); border-radius: 999px; }
.meter .mark { position: absolute; top: -8px; bottom: -6px; width: 3px; background: var(--lav); }
.meter .mark span { position: absolute; bottom: 18px; left: -2px; white-space: nowrap; font-size: 12px; color: var(--lav); }
.other-deals { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 24px; }
.other-deals.stack { grid-template-columns: 1fr; }

/* ------------------------------------------------------------------ votes */
.vote-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.vote-col { background: var(--navy); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; border: 3px solid var(--navy); }
.vote-col.win { border-color: var(--yellow); }
.vote-col.out { border-color: var(--red); }
.vote-col .head { position: relative; }
.vote-col .head .pill { width: 100%; height: 40px; font-size: 21px; }
.vote-col .head .tag { position: absolute; right: 10px; top: 9px; }
.vote-col .voters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 12px 0; align-content: start; flex: 1; }
.vote-col .voters .pill { width: 100%; }
.penalty { border: 2px solid var(--red); color: var(--red); border-radius: 7px; height: 32px;
  display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 15px; }
.vote-col .total { text-align: center; font-size: 27px; font-weight: bold; color: var(--sky); }
.vote-col.win .total { color: var(--yellow); }
.vote-col.out .total { color: var(--red); }
.banner { text-align: center; }
.banner .tally { color: var(--sky); font-size: 22px; font-weight: bold; margin-bottom: 8px; }
.banner .win { display: inline-block; background: var(--yellow); color: var(--navy); font-size: 23px; font-weight: bold;
  border: 2px solid var(--navy); border-radius: 999px; padding: 8px 76px; }
.banner-box { border: 3px solid var(--red); border-radius: 12px; background: var(--navy); padding: 14px 20px; text-align: center;
  font-size: 21px; font-weight: bold; color: var(--sky); }
.banner-box.gold { border-color: var(--yellow); }
.banner-box .big { font-size: 28px; color: var(--yellow); }
.banner-box .line2 { font-weight: normal; font-size: 18px; margin: 4px 0; }

.who { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.who-row { background: var(--navy); border-radius: 8px; padding: 4px 8px; display: flex; align-items: center; gap: 12px; min-height: 38px; }
.who-row .pill { width: 116px; }
.who-row .note { font-size: 14px; color: var(--sky); white-space: nowrap; }
.who-row .note.r { color: var(--red); font-weight: bold; }
.who-row .tag { font-size: 12px; }
.arrow { color: var(--sky); font-size: 24px; line-height: 1; }

/* fractures */
.fracture { background: var(--navy); border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; }
.fracture .line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 17px; margin-bottom: 8px; }
.fracture .line .pill { width: 118px; }
.fracture .roll { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.fracture h5 { color: var(--lav); font-size: 17px; margin: 14px 0 6px; }
.fracture h5 small { color: var(--sky); font-weight: normal; font-size: 13px; margin-left: 6px; }
.member-strip { background: #383F6E; border-radius: 8px; padding: 6px 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member-strip .pill { width: 120px; }
.member-strip .note { font-size: 14px; margin-left: 16px; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.side { background: #383F6E; border-radius: 8px; padding: 8px 10px; }
.side-head { display: flex; align-items: center; gap: 12px; font-weight: bold; }
.side-head .pill { width: 120px; }
.side-head .tag { margin-left: auto; }
.joiner { display: flex; align-items: center; gap: 12px; margin: 8px 0 0 22px; font-size: 14px; position: relative; }
.joiner::before { content: ""; position: absolute; left: -14px; top: -10px; width: 10px; height: 26px;
  border-left: 2px solid rgba(170, 218, 240, .45); border-bottom: 2px solid rgba(170, 218, 240, .45); }
.joiner .pill { width: 120px; }
.joiner b { color: var(--yellow); }
.side .empty { text-align: center; padding: 18px 0 10px; }
.results { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.result { background: #383F6E; border-radius: 8px; padding: 6px 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.result .pill { width: 120px; }
.result .tag { margin-left: auto; }

/* ------------------------------------------------------------------ challenge table */
.ctable { display: flex; flex-direction: column; gap: 8px; }
.crow { display: grid; align-items: center; background: var(--navy); border-radius: 8px; min-height: 40px; padding: 0 10px;
  grid-template-columns: 80px 170px 1fr 160px 160px; gap: 8px; text-align: center; }
.crow.head { background: none; min-height: 24px; font-weight: bold; font-size: 15px; }
.crow .place { font-weight: bold; font-size: 17px; }
.crow .place.top { color: var(--yellow); }
.crow .vals { display: flex; justify-content: center; gap: 30px; }
.crow .val { width: 50px; height: 26px; border-radius: 5px; color: var(--navy); font-weight: bold; display: inline-flex; align-items: center; justify-content: center; }
.crow .time { font-weight: bold; font-size: 19px; }
.crow .rp { justify-self: center; background: #383F6E; border-radius: 6px; width: 80px; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-weight: bold; font-size: 18px; }
.chal-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.chal-head h2 { color: var(--lav); margin: 0 0 10px; font-size: 26px; }
.stat-tag { display: inline-flex; padding: 2px 18px; border-radius: 7px; border: 2px solid var(--navy); color: var(--navy); font-weight: bold; font-size: 17px; }
.avg-box { background: var(--navy); border-radius: 10px; padding: 12px 56px; text-align: center; font-size: 14px; }
.avg-box b { display: block; color: var(--yellow); font-size: 31px; }
.bg-str { background: var(--c-str); } .bg-end { background: var(--c-end); } .bg-men { background: var(--c-men); }
.bg-lik { background: var(--c-lik); } .bg-inf { background: var(--c-inf); }

/* results table cells on bars */
.box-rank { min-width: 56px; height: 28px; border: 2px solid var(--navy); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex: none; background: var(--c); color: var(--on-rank, var(--navy)); }

/* ------------------------------------------------------------------ finale */
.compare { display: grid; grid-template-columns: 280px repeat(var(--n, 3), minmax(0, 1fr)); gap: 12px; align-items: center; }
.compare-row { display: contents; }
.stat-card { background: var(--navy); border-radius: 10px; display: grid; grid-template-columns: 280px repeat(var(--n, 3), minmax(0, 1fr)); gap: 12px; padding: 10px 14px; align-items: center; margin-bottom: 12px; }
.stat-card .label { display: flex; align-items: center; gap: 14px; }
.stat-card .label .wt { background: var(--lav); color: var(--navy); font-weight: bold; border-radius: 6px; padding: 4px 6px; font-size: 16px; }
.stat-card .label b { color: var(--lav); font-size: 19px; display: block; }
.stat-card .label small { font-size: 13px; }
.score-cell { background: #383F6E; border-radius: 8px; padding: 6px 14px 10px; }
.score-cell .top { display: flex; justify-content: space-between; align-items: baseline; }
.score-cell .raw { font-size: 21px; font-weight: bold; }
.score-cell .math { font-size: 15px; font-weight: bold; }
.score-cell .math small { opacity: .7; font-weight: normal; }
.score-cell.best .math .pts { color: var(--yellow); }
.track { height: 9px; background: var(--navy); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.track span { display: block; height: 100%; background: var(--sky); border-radius: 999px; }
.score-cell.best .track span { background: var(--yellow); }
.finalist-heads { display: grid; grid-template-columns: 280px repeat(var(--n, 3), minmax(0, 1fr)); gap: 12px; padding: 0 14px; margin-bottom: 10px; }
.finalist-heads .pill { width: 150px; justify-self: center; }
.equity { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 16px; }
.equity .card { background: var(--navy); border-radius: 10px; padding: 10px 12px; }
.equity .card .top { display: flex; justify-content: space-between; align-items: center; }
.equity .card .pill { width: 148px; }
.equity .card .num { font-size: 27px; font-weight: bold; }
.equity .card.best .num { color: var(--yellow); }
.share-bar { display: flex; gap: 4px; background: var(--navy); border-radius: 999px; padding: 3px; margin-top: 16px; }
.share-bar span { --c: var(--red); background: var(--c); color: var(--on-rank, var(--navy)); border-radius: 999px; text-align: center; font-size: 13px; font-weight: bold; padding: 2px 0; white-space: nowrap; overflow: hidden; }

.jury-grid { display: grid; grid-template-columns: 300px repeat(var(--n, 3), minmax(0, 1fr)) 200px; gap: 10px; align-items: center; }
.jury-row { background: var(--navy); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.jury-row .pill { width: 148px; }
.jury-row .out { font-size: 14px; margin-left: 12px; }
.count-box { justify-self: center; width: 90px; height: 32px; border-radius: 7px; background: #383F6E; font-size: 19px; font-weight: bold;
  display: flex; align-items: center; justify-content: center; }
.count-box.zero { color: rgba(170, 218, 240, .45); }
.count-box.best { border: 3px solid var(--yellow); color: var(--yellow); background: var(--navy); }
.nopref { background: #383F6E; border-radius: 7px; height: 32px; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 15px; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.summary .card { background: var(--navy); border-radius: 10px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.summary .num { font-size: 28px; font-weight: bold; color: var(--yellow); }
.summary .card.none .num { color: var(--sky); }

.jvote { background: var(--navy); border-radius: 10px; padding: 6px 20px; display: flex; align-items: center; gap: 18px; margin-bottom: 10px; }
.jvote .n { font-weight: bold; font-size: 18px; width: 64px; }
.jvote .why { color: var(--yellow); font-weight: bold; font-size: 15px; }
.jvote .why.pref { color: var(--lav); }
.tally-cards { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 16px; }
.tally-cards .card { background: var(--navy); border: 3px solid var(--navy); border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; }
.tally-cards .card.win { border-color: var(--yellow); }
.tally-cards .card .pill { width: 166px; }
.tally-cards .card .num { font-size: 27px; font-weight: bold; }
.tally-cards .card.win .num { color: var(--yellow); }

.coming-soon { border: 2px dashed rgba(170, 218, 240, .5); border-radius: 12px; background: #383F6E; height: 92px;
  display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 18px; color: rgba(170, 218, 240, .75); }

/* ------------------------------------------------------------------ alliance stats */
.al-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 16px; align-items: start; }
.al-layout .panel { margin-bottom: 0; }
.conn { display: flex; align-items: center; gap: 8px; background: var(--navy); border-radius: 7px; padding: 4px 6px; margin-bottom: 8px; }
.conn .pill { width: 104px; height: 26px; }
.conn .n { margin-left: auto; padding-right: 8px; font-weight: bold; color: var(--yellow); font-size: 18px; }
.app { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.app .conn { margin: 0; }
.app .conn .pill { width: 118px; height: 22px; font-size: 13px; }
.app .conn .n { font-size: 16px; padding-right: 4px; }
.subhead { color: var(--sky); font-weight: bold; font-size: 18px; margin: 12px 0 8px; }

/* ------------------------------------------------------------------ swaps */
.swap-card { background: var(--navy); border-radius: 10px; padding: 10px 24px; display: flex; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.swap-card .n { font-size: 20px; font-weight: bold; width: 80px; color: var(--sky); }
.swap-card .n small { display: block; font-size: 11px; font-weight: normal; }
.swap-card .pill { width: 116px; }
.swap-card .xchg { color: var(--yellow); font-size: 26px; font-weight: bold; }
.swap-card .what { margin-left: auto; text-align: right; font-weight: bold; font-size: 16px; }

/* ------------------------------------------------------------------ menu / setup / creation */
.menu-title { text-align: center; color: var(--lav); font-size: 28px; margin: 18px 0 14px; }
.format-card {
  display: block; background: var(--yellow); border-radius: 22px; padding: 16px 24px 22px; width: 640px; max-width: 100%;
  margin: 0 auto; text-decoration: none; color: var(--sky); transition: transform .12s;
}
.format-card:hover { transform: translateY(-2px); }
.format-bubble { display: flex; align-items: center; justify-content: center; gap: 28px; background: var(--navy); color: var(--yellow);
  font-size: 31px; font-weight: bold; border-radius: 999px; width: 270px; height: 68px; margin: 0 auto 14px; }
.info-i { position: relative; width: 32px; height: 32px; border: 3px solid currentColor; border-radius: 50%; font-style: italic; font-size: 20px;
  display: inline-flex; align-items: center; justify-content: center; cursor: help; }
.info-i .tip { display: none; position: absolute; top: 40px; left: 50%; transform: translateX(-50%); width: 300px; z-index: 10;
  background: var(--navy); border: 2px solid var(--lav); color: var(--sky); font-style: normal; font-weight: normal; font-size: 14px;
  border-radius: 10px; padding: 10px 12px; text-align: left; }
.info-i:hover .tip, .info-i:focus .tip { display: block; }
.info-i.sm { width: 20px; height: 20px; border-width: 2px; font-size: 13px; }
.format-image { width: 280px; height: 280px; margin: 0 auto 24px; border-radius: 14px; background: var(--blue);
  border: 2px dashed rgba(37, 42, 69, .6); display: flex; align-items: center; justify-content: center; color: rgba(170, 218, 240, .7); font-size: 20px; }
.format-blurb { background: var(--navy); border-radius: 14px; padding: 30px 30px; text-align: center; font-size: 18px; line-height: 30px; }
.menu-buttons { display: flex; justify-content: center; gap: 20px; margin-top: 26px; }
.menu-buttons .btn { width: 190px; height: 52px; font-size: 21px; }

.setup { width: 800px; max-width: 100%; margin: 0 auto; background: var(--blue); border-radius: 16px; padding: 24px 40px 26px; }
.setup h1 { text-align: center; }
.setup label.h { display: block; color: var(--lav); font-weight: bold; font-size: 23px; margin: 8px 0 10px; }
.setup input[type=text] { width: 100%; height: 48px; background: var(--navy); color: var(--sky); border: 0; border-radius: 8px; font-size: 18px; padding: 0 18px; }
.setup input[type=text]::placeholder { color: rgba(170, 218, 240, .7); }
.slider-row { display: flex; align-items: center; gap: 30px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--lav); height: 10px; }
.slider-row .count { background: var(--navy); color: var(--yellow); font-weight: bold; font-size: 23px; width: 80px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; }
.slider-scale { display: flex; justify-content: space-between; width: calc(100% - 110px); font-size: 14px; margin-top: 4px; }
.toggle { display: inline-flex; background: var(--navy); border-radius: 999px; padding: 2px; }
.toggle input { display: none; }
.toggle label { padding: 8px 34px; border-radius: 999px; cursor: pointer; font-size: 17px; }
.toggle input:checked + label { background: var(--sky); color: var(--navy); font-weight: bold; }
.color-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin: 18px 0; }
.color-row .lbl { font-size: 15px; margin-bottom: 4px; }
.color-pick { display: flex; align-items: center; gap: 12px; background: var(--navy); border-radius: 8px; height: 52px; padding: 0 10px; cursor: pointer; }
.color-pick input[type=color] { width: 38px; height: 36px; border: 2px solid var(--sky); border-radius: 6px; padding: 0; background: none; cursor: pointer; }
.color-pick .hex { font-size: 19px; }
.grad-preview { height: 42px; border-radius: 10px; border: 3px solid var(--navy); }

.cc-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin: 14px 0 10px; }
.cc-top .left { display: flex; gap: 16px; }
.cc-top .right { justify-self: end; }
.cc-top h1 { margin: 0; color: var(--lav); font-size: 38px; text-align: center; }
.cc-top .sub { text-align: center; font-size: 17px; }
.cc { background: var(--blue); border-radius: 16px; padding: 14px 20px 20px; overflow-x: auto; }
.cc table { border-collapse: separate; border-spacing: 8px 8px; margin: 0 auto; }
.cc th { font-size: 15px; color: var(--sky); white-space: nowrap; }
.cc th.sec { color: var(--lav); font-size: 20px; border-bottom: 2px solid var(--lav); padding-bottom: 4px; }
.cc th.statcol { padding-bottom: 6px; white-space: normal; line-height: 1.1; vertical-align: bottom; }
.cc th.statcol .lbl { display: inline-block; max-width: 74px; }
.cc th.statcol.str, .cc th.statcol.brute, .cc th.statcol.speed { color: var(--red); box-shadow: inset 0 -3px 0 var(--red); }
.cc th.statcol.end, .cc th.statcol.balance, .cc th.statcol.searching { color: var(--yellow); box-shadow: inset 0 -3px 0 var(--yellow); }
.cc th.statcol.men, .cc th.statcol.puzzles, .cc th.statcol.trivia { color: var(--green); box-shadow: inset 0 -3px 0 var(--green); }
.cc th.statcol.lik { color: var(--sky); box-shadow: inset 0 -3px 0 var(--sky); }
.cc th.statcol.inf { color: var(--lav); box-shadow: inset 0 -3px 0 var(--lav); }
.cc .sec-btns { text-align: center; white-space: nowrap; }
.cc .sec-btns .btn { height: 30px; font-size: 15px; padding: 0 16px; border-radius: 999px; }
.cc td.num { color: var(--sky); font-weight: bold; text-align: center; font-size: 17px; }
.cc input.name { width: 188px; height: 36px; background: var(--navy); color: var(--sky); border: 0; border-radius: 7px; padding: 0 12px; font-size: 16px; }
.cc select { height: 36px; background: var(--navy); color: var(--sky); border: 0; border-radius: 7px; padding: 0 6px; font-size: 15px; }
.cc select.pron { width: 108px; }
.cc input.stat { width: 74px; height: 36px; border: 2px solid var(--navy); border-radius: 7px; text-align: center; font-weight: bold; font-size: 16px; color: var(--navy); }
.cc input.stat.str { background: var(--red); } .cc input.stat.end { background: var(--yellow); } .cc input.stat.men { background: var(--green); }
.cc input.stat.lik { background: var(--sky); } .cc input.stat.inf { background: var(--lav); }
.cc select.mod { width: 70px; font-weight: bold; text-align: center; border: 2px solid var(--navy); }
.cc select.mod[data-v="-10"] { background: var(--red); color: var(--navy); }
.cc select.mod[data-v="-5"] { background: var(--yellow); color: var(--navy); }
.cc select.mod[data-v="0"] { background: var(--navy); color: var(--sky); }
.cc select.mod[data-v="5"] { background: var(--green); color: var(--navy); }
.cc select.mod[data-v="10"] { background: var(--sky); color: var(--navy); }
.cc tr.locked input, .cc tr.locked select { opacity: .55; pointer-events: none; }
.cc tr.locked .name-wrap::after { content: "🔒"; position: absolute; right: 10px; top: 8px; font-size: 14px; }
.name-wrap { position: relative; display: inline-block; }
.cc tr.locked .unlock { display: inline-flex; }
.unlock { display: none; height: 22px; font-size: 11px; padding: 0 8px; margin-left: 4px; }

.modal-bg { position: fixed; inset: 0; background: rgba(15, 18, 32, .75); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--blue); border-radius: 16px; padding: 20px 24px; width: 760px; max-width: 94vw; max-height: 80vh; display: flex; flex-direction: column; }
.modal h2 { color: var(--lav); margin: 0 0 12px; }
.modal .list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.modal label.pp { display: flex; align-items: center; gap: 12px; background: var(--navy); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.modal .foot { display: flex; justify-content: flex-end; gap: 12px; margin-top: 14px; }

/* info pop-up (the "i" icons) */
.info-modal-bg { position: fixed; inset: 0; background: rgba(15, 18, 32, .75); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.info-modal-bg.hidden { display: none; }
.info-modal { position: relative; background: var(--navy); border: 3px solid var(--lav); border-radius: 16px; padding: 22px 26px; width: 640px; max-width: 100%; max-height: 82vh; display: flex; flex-direction: column; color: var(--sky); text-align: left; font-style: normal; font-weight: normal; }
.info-modal h2 { color: var(--lav); margin: 0 36px 12px 0; }
.info-modal h2[hidden] { display: none; }
.info-modal .info-body { overflow-y: auto; font-size: 16px; line-height: 1.5; }
.info-modal .info-body img { max-width: 100%; height: auto; }
.info-modal .info-body h1, .info-modal .info-body h2, .info-modal .info-body h3 { color: var(--lav); }
.info-modal .info-body b, .info-modal .info-body strong { color: var(--yellow); }
.info-close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 8px; background: var(--blue); color: var(--sky); font-size: 24px; line-height: 1; cursor: pointer; }
.info-close:hover { background: var(--lav); color: var(--navy); }
button.info-i { background: none; color: inherit; padding: 0; font-family: inherit; font-weight: bold; cursor: pointer; vertical-align: middle; }

.simple-list { display: flex; flex-direction: column; gap: 8px; }
.simple-list .item { background: var(--navy); border-radius: 10px; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; text-decoration: none; color: var(--sky); }
.simple-list .item b { color: var(--lav); font-size: 18px; }
.auth { width: 480px; max-width: 100%; margin: 30px auto; }
.auth input { width: 100%; height: 42px; background: var(--navy); color: var(--sky); border: 0; border-radius: 8px; padding: 0 12px; font-size: 16px; margin: 4px 0 12px; }
.auth .helptext, .auth ul { font-size: 13px; opacity: .8; }
.errorlist { color: var(--red); font-weight: bold; padding-left: 18px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .logo { margin-left: 0; font-size: 48px; }
  .game { grid-template-columns: 1fr; }
  .sidebar { position: static; min-height: 0; max-height: none; }
  .al-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .site-header { flex-direction: column; align-items: center; padding: 16px 16px 0; }
  .logo { font-size: 40px; }
  .account-panel { flex-wrap: wrap; justify-content: center; }
  .account-panel input { width: 140px; }
  .page { padding: 12px 16px 32px; }
  .screen-title { font-size: 26px; gap: 10px; }
  .vote-cols, .who, .sides, .results, .equity, .tally-cards { grid-template-columns: 1fr; }
  .arow.with-targets { grid-template-columns: 1fr; }
  .arow.with-targets .vsep { display: none; }
  .other-deals { grid-template-columns: 1fr; }
  .stat-card, .finalist-heads, .jury-grid { grid-template-columns: 1fr; }
  .crow { grid-template-columns: 50px 1fr 1fr 70px 70px; }
  .format-image { width: 200px; height: 200px; }
  .color-row { grid-template-columns: 1fr; }
  .bar { flex-wrap: wrap; }
}

/* vote reveal */
.reveal-bar { position: sticky; top: 10px; z-index: 5; display: flex; justify-content: center; gap: 14px; margin-bottom: 16px; }
.reveal-bar .btn { height: 44px; font-size: 18px; padding: 0 28px; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.vote-col .voters > [data-vote] .pill { width: 100%; }
@media (max-width: 1250px) { .drow { flex-wrap: wrap; white-space: normal; } }

/* scrollbars: a plain lavender bar */
/* Firefox only: Chrome ignores the ::-webkit-scrollbar styles below if these are set. */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--lav) transparent; }
}
/* The visible bar is inset from the edge (a transparent border on the thumb) and the
   track stops short of the ends, so rounded corners never clip it. */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: transparent; margin: 14px 0; }
::-webkit-scrollbar-track:horizontal { margin: 0 14px; }
::-webkit-scrollbar-thumb { background: var(--lav); background-clip: padding-box; border-radius: 999px;
  border: 4px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }
/* The page's own scrollbar has no rounded corners: full length, slimmer gutter. */
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track { margin: 0; }
html::-webkit-scrollbar-thumb { border-width: 2px; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
