/* Battle Trivia - Moderator: a remote in your hand. One column, big buttons at the bottom, the
   answer key and everyone's status up top. Roomier on a laptop, same layout. */
body.host { min-height: 100dvh; background: var(--stage); background-attachment: fixed; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 14px calc(env(safe-area-inset-bottom, 0px) + 18px); }
#app.tabbed { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 76px); }
.grow { flex: 1; min-height: 12px; }
.x { font-stretch: 125%; font-weight: 800; }

/* header */
.mhd { display: flex; align-items: center; gap: 10px; padding: 0 4px; flex: none; }
.mhd .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(47,214,143,.2); flex: none; }
.mhd .dot.off { background: var(--bad); box-shadow: 0 0 0 4px rgba(240,68,82,.2); }
.mhd .code { font-stretch: 125%; font-weight: 800; font-size: 22px; color: var(--cyan); letter-spacing: .08em; }
.mhd .ph { font-weight: 900; font-size: 11px; letter-spacing: .12em; color: var(--lav); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mhd .ph.live { color: #ff9fd2; }
.mhd .sp { flex: 1; }
.mhd .tv { font-weight: 700; font-size: 12px; color: var(--good); white-space: nowrap; }
.mhd .tv.off { color: #ff7b86; }
.mhd .sec { font-stretch: 125%; font-weight: 800; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.title { font-stretch: 125%; font-weight: 800; font-size: 34px; line-height: 1; margin-top: 18px; }
.subt { font-weight: 500; font-size: 14px; line-height: 1.4; color: var(--lav); margin-top: 6px; }

/* cards */
.mcard { margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--card); }
.mcard .q { font-weight: 700; font-size: 17px; line-height: 1.3; }
.mcard .key { font-weight: 600; font-size: 14px; margin-top: 8px; }
.mcard .key b { color: var(--good); }
.mcard .key span { color: var(--lav); }
.mcard .meta { font-weight: 600; font-size: 13px; color: var(--lav); margin-top: 8px; }
.tally { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.tally > div { display: grid; grid-template-columns: 28px 1fr 22px; gap: 10px; align-items: center; }
.tally .L { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-stretch: 125%; font-weight: 800; font-size: 14px; background: #4f8dff; color: #fff; }
.tally .bar { position: relative; height: 32px; border-radius: 9px; background: var(--bg); overflow: hidden; box-shadow: inset 0 0 0 2px #261b6e; }
.tally .bar.right { box-shadow: inset 0 0 0 2px var(--good); }
.tally .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #4f8dff; opacity: .35; transition: width .3s; }
.tally .bar.right i { background: var(--good); }
.tally .bar span { position: relative; display: block; padding: 0 10px; font-weight: 600; font-size: 13.5px; line-height: 32px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tally .n { font-stretch: 125%; font-weight: 800; font-size: 16px; text-align: right; }

/* who's where during a question */
.ppl { display: flex; flex-wrap: wrap; gap: 12px 4px; margin-top: 14px; padding: 0 2px; }
.pp { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: calc((100% - 20px) / 6); min-width: 52px; }
.pp .badge { position: absolute; top: 30px; right: 2px; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 7px; background: #261b6e; color: var(--lav-2);
  font-stretch: 125%; font-weight: 800; font-size: 12px; line-height: 22px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.pp .badge.in { background: #4f8dff; color: #fff; }
.pp .badge.ok { background: var(--good); color: #00301f; }
.pp .badge.no { background: var(--bad); color: #fff; }
.pp .nm { font-weight: 700; font-size: 11.5px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp .t { font-weight: 600; font-size: 10.5px; color: var(--lav); white-space: nowrap; }
.pp .t.tp { color: var(--cyan); }
.pp .chip { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); padding: 2px 5px; border-radius: 6px; font-weight: 900; font-size: 8.5px; letter-spacing: .08em; white-space: nowrap; background: #5b3fd6; color: #fff; }
.pp .chip.frozen { background: #7fe3ff; color: #002838; }
.pp.out { opacity: .4; }

/* the big button and its friends */
.big { height: 112px; flex: none; border-radius: 17px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%;
  background: var(--hot); color: #fff; box-shadow: 0 3px 0 #1a3f9e; transition: transform .08s; }
.big:active { transform: translateY(4px); }
.big.done { background: var(--cyan); color: #06213d; box-shadow: 0 3px 0 #3a1d9e; }
.big .l { font-stretch: 125%; font-weight: 800; font-size: 28px; line-height: 1; }
.big .s { font-weight: 700; font-size: 13px; opacity: .8; }
.go2 { height: 64px; flex: none; width: 100%; border-radius: 12px; background: var(--go); color: #fff; box-shadow: 0 3px 0 #3a1d9e; font-stretch: 125%; font-weight: 800; font-size: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.go2:disabled { opacity: .45; }
.go2 small { font-stretch: 100%; font-weight: 700; font-size: 12px; }
.go2.tall { height: 66px; font-size: 22px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; flex: none; }
.two { display: flex; gap: 8px; margin-top: 10px; flex: none; }
.sbtn { height: 48px; border-radius: 15px; background: #261b6e; font-weight: 700; font-size: 15px; box-shadow: 0 3px 0 #05031a; flex: 1; }
.sbtn.on { background: var(--cyan); color: #06213d; box-shadow: 0 3px 0 #2a50b6; }
.sbtn.line { background: none; box-shadow: inset 0 0 0 2px #3b2d9a; }
.sbtn.red { color: #ff7a6b; }
.sbtn.tallb { height: 52px; border-radius: 12px; font-size: 14px; }
.note2 { text-align: center; font-weight: 600; font-size: 12.5px; color: var(--lav); margin-top: 10px; }
.sum { text-align: center; font-weight: 700; font-size: 14px; color: var(--lav); margin-bottom: 10px; }

/* write-in review */
.groups { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.grp { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 2px var(--bd, #3b2d9a); }
.grp .k { font-weight: 700; font-size: 19px; word-break: break-word; }
.grp .tag { padding: 3px 7px; border-radius: 7px; font-weight: 900; font-size: 10px; letter-spacing: .08em; vertical-align: 3px; margin-left: 6px; }
.grp .tag.exact { background: rgba(47,214,143,.18); color: var(--good); }
.grp .tag.typo { background: #45d0ff; color: #06213d; }
.grp .who { font-weight: 600; font-size: 13px; color: var(--lav); margin-top: 3px; }
.grp .marks { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.grp .marks > div { display: flex; gap: 6px; }
.grp .marks button { width: 48px; height: 44px; border-radius: 13px; background: #261b6e; color: var(--lav); font-weight: 900; font-size: 19px; }
.grp .marks button.half { font-weight: 800; font-size: 15px; }
.grp .marks button.ok.on { background: var(--good); color: #00301f; }
.grp .marks button.half.on { background: var(--warn); color: #3a2400; }
.grp .marks button.no.on { background: var(--bad); color: #fff; }
.grp .pts { font-weight: 700; font-size: 11.5px; white-space: nowrap; }

/* item time feed, log */
.feed { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.frow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--card); animation: bt-up .3s ease-out both; }
.frow img { width: 34px; height: 34px; flex: none; }
.frow .t { flex: 1; min-width: 0; font-weight: 600; font-size: 14.5px; }
.frow .st { padding: 4px 7px; border-radius: 7px; font-weight: 900; font-size: 9.5px; letter-spacing: .1em; color: var(--bg); background: #7c74c8; white-space: nowrap; }
.frow .st.hit { background: var(--hot); color: #fff; }
.frow .st.blocked { background: var(--good); }
.frow .st.fizzled { background: #b3aef0; }
.frow .st.info { background: #261b6e; color: var(--lav); }
.log { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.log div { font-weight: 500; font-size: 14px; color: var(--lav); padding: 8px 10px; border-radius: 10px; background: rgba(38,25,111,.5); }
.log div b { color: var(--text); font-weight: 700; }
.empty { font-weight: 500; font-size: 14px; color: var(--lav); margin-top: 14px; }

/* standings, players */
.rows { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.srow { min-height: 46px; display: grid; grid-template-columns: 24px 34px 1fr auto auto; gap: 10px; align-items: center; padding: 6px 10px 6px 12px; border-radius: 14px; background: #18124a; }
.srow .pl { font-stretch: 125%; font-weight: 800; font-size: 15px; color: var(--lav); }
.srow .nm { font-weight: 700; font-size: 15px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow .nm small { display: block; font-weight: 600; font-size: 11.5px; color: var(--lav); }
.srow .sc { font-stretch: 125%; font-weight: 800; font-size: 15px; }
.srow .ed { font-weight: 700; font-size: 12px; color: var(--lav); padding: 5px 8px; border-radius: 8px; background: var(--bg); }
.srow .mk { display: flex; gap: 4px; }
.srow .mk button { min-width: 34px; height: 30px; padding: 0 6px; border-radius: 8px; background: var(--bg); font-weight: 800; font-size: 13px; color: var(--lav); }
.srow .res { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 12px; }
.srow .res.ok { background: var(--good); color: #00301f; } .srow .res.half { background: var(--warn); color: #3a2400; } .srow .res.no { background: rgba(240,68,82,.25); color: #ff7b86; } .srow .res.none { background: #261b6e; color: var(--lav-2); }
.lws { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.lws .lw small { color: var(--text); font-size: 14px; font-weight: 700; }
.lws .lw .tm { font-weight: 600; font-size: 12px; color: var(--lav); }
.lws .empty { font-weight: 600; font-size: 13px; color: var(--lav); padding: 6px 2px; }
.editrow { display: flex; gap: 6px; padding: 4px 4px 8px 46px; }
.editrow button { flex: 1; height: 38px; border-radius: 10px; background: #261b6e; font-weight: 800; font-size: 14px; }
.editrow button.red { color: #ff7a6b; background: none; box-shadow: inset 0 0 0 2px #3b2d9a; }

/* lobby setup */
.roster { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--card); flex: none; }
.roster .faces { display: flex; flex-wrap: wrap; flex: 1; min-width: 0; row-gap: 6px; }
.roster .faces button { margin-right: -6px; padding: 0; border-radius: 50%; }
.roster .faces button .face { box-shadow: 0 0 0 3px #18124a; }
.roster .n { text-align: right; flex: none; }
.roster .n b { display: block; font-stretch: 125%; font-weight: 800; font-size: 18px; }
.roster .n span { font-weight: 600; font-size: 11.5px; color: var(--lav); }
.setlist { margin-top: 12px; padding: 0 4px; flex: 1; min-height: 0; }
.set { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #261b6e; }
.set .lb { font-weight: 600; font-size: 15px; }
/* a Custom clock: minutes and seconds, up to 10 minutes */
.cclock { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 10px 12px; margin: 6px 0; border-radius: 12px; background: rgba(69,208,255,.08); box-shadow: inset 0 0 0 1px rgba(69,208,255,.35); }
.cclock input { width: 58px; height: 42px; border: 0; border-radius: 10px; padding: 0 6px; text-align: center; font-size: 18px; font-weight: 800; font-stretch: 125%;
  background: var(--bg); box-shadow: inset 0 0 0 2px #3b2d9a; outline: none; -moz-appearance: textfield; }
.cclock input:focus { box-shadow: inset 0 0 0 3px var(--cyan); }
.cclock b { margin-right: 4px; color: var(--lav); font-size: 14px; font-weight: 700; }
.cclock .sbtn { flex: 1; height: 42px; min-width: 64px; background: var(--cyan); color: #06213d; box-shadow: none; }
.cclock em { flex: 1 1 100%; font-style: normal; color: var(--lav-2); font-size: 12.5px; font-weight: 600; }
.cclock em.bad { color: #ff7b86; }
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--card); gap: 2px; flex: none; }
.seg button { min-width: 40px; height: 32px; padding: 0 8px; border-radius: 9px; font-stretch: 125%; font-weight: 800; font-size: 14px; color: var(--text); }
.seg button.on { background: var(--cyan); color: #06213d; }
.tog { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #261b6e; text-align: left; width: 100%; }
.tog .tx { flex: 1; min-width: 0; }
.tog .tx b { display: block; font-weight: 600; font-size: 15px; }
.tog .tx span { display: block; font-weight: 500; font-size: 12.5px; line-height: 1.35; color: var(--lav); margin-top: 2px; }
.tog .sw { position: relative; width: 48px; height: 28px; flex: none; border-radius: 14px; background: #261b6e; transition: background .15s; }
.tog .sw i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.tog.on .sw { background: var(--good); }
.tog.on .sw i { transform: translateX(20px); }
.chips2 { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 0 8px; }
.chips2 button, .chips2 label { white-space: nowrap; padding: 7px 11px; border-radius: 999px; background: #261b6e; font-weight: 700; font-size: 12.5px; cursor: pointer; }
.chips2 .on { background: var(--go); color: #fff; }
.chips2 .picked { white-space: nowrap; padding: 7px 11px; border-radius: 999px; background: rgba(197,123,255,.18); color: #e3c6ff; font-weight: 700; font-size: 12.5px; }
.chips2 .line { background: none; box-shadow: inset 0 0 0 1.5px #3b2d9a; color: var(--lav); }
.chips2 input[type=file] { display: none; }
.packmsg { font-weight: 600; font-size: 13px; color: var(--lav); padding-bottom: 6px; }
.packmsg.bad { color: #ffb3ba; }
.more { font-weight: 700; font-size: 13px; color: var(--lav-2); padding: 10px 0; }
.cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 10px; }
.cats button { padding: 7px 11px; border-radius: 999px; background: none; box-shadow: inset 0 0 0 1.5px #3b2d9a; color: var(--lav-2); font-weight: 700; font-size: 12.5px; }
.cats button.on { background: #261b6e; box-shadow: none; color: var(--text); }
.start { margin-top: 10px; }

/* tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 10px 6px calc(env(safe-area-inset-bottom, 0px) + 14px); background: var(--card); box-shadow: inset 0 1px 0 #3b2d9a, 0 -10px 30px rgba(0,0,0,.35); }
.tabs button { font-weight: 700; font-size: 12px; color: var(--lav); padding: 6px 0; }
.tabs button.on { color: var(--cyan); }

/* login */
.login { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 0; text-align: center; padding-bottom: 8vh; }
.login .logo { font-size: 44px; }
.login .role { font-weight: 900; font-size: 12px; letter-spacing: .2em; color: var(--lav); margin-top: 14px; }
.login p { font-weight: 500; font-size: 15px; line-height: 1.45; color: var(--lav); margin: 26px 0 18px; }
.login input { width: 100%; height: 72px; border-radius: 18px; border: 0; background: var(--card); box-shadow: inset 0 0 0 2px #3b2d9a; color: var(--text); text-align: center;
  font-stretch: 125%; font-weight: 800; font-size: 34px; letter-spacing: .3em; text-transform: uppercase; margin-bottom: 10px; outline: 0; }
.login input:focus { box-shadow: inset 0 0 0 3px var(--cyan); }
.login input::placeholder { color: #3b2d9a; letter-spacing: .2em; }
.login .err { min-height: 22px; font-weight: 600; font-size: 15px; color: #ff7b86; margin: 4px 0 8px; }
.login .fine { font-weight: 500; font-size: 13px; line-height: 1.45; color: var(--lav-2); margin-top: 22px; }
.toast2 { position: fixed; z-index: 30; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 50%; transform: translateX(-50%); padding: 12px 18px; border-radius: 14px; background: rgba(11,7,36,.94);
  box-shadow: inset 0 0 0 1.5px rgba(175,210,255,.35); font-weight: 700; font-size: 15px; animation: bt-banner 2.6s ease-in-out forwards; white-space: nowrap; }
.sdesc { padding: 0 0 10px; border-bottom: 1px solid #261b6e; color: var(--lav); font-size: 12.5px; font-weight: 500; line-height: 1.4; }
