body.master { font-size: 15px; }
.mbar { display: flex; align-items: center; gap: 20px; padding: 8px 18px; background: #141a2e; color: #fff; height: 52px; }
.mbar h1 { font-size: 1.1em; margin: 0; white-space: nowrap; }
.mbar nav { display: flex; gap: 4px; }
.mbar nav button { background: transparent; color: #c9d1e8; border: none; }
.mbar nav button.on { background: #fff; color: #141a2e; }
.mbar .links { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.mbar a { color: #9fc0ff; text-decoration: none; }
.conn { width: 10px; height: 10px; border-radius: 50%; background: #999; }
.conn.on { background: #2ecc71; }
.bypass-warn { background: #ffcc00; color: #3a2c00; border: none; font-weight: 700; padding: .3em .8em; }
.mbar .who { color: #c9d1e8; font-size: .85em; }
.mbar .logout { background: transparent; color: #c9d1e8; border-color: #3a4466; padding: .3em .8em; }
.bot-btn { width: 100%; }
.bot-btn.on { background: #e6f7ec; border-color: var(--ok); color: #17663a; font-weight: 700; }
.cardtime-tag { background: #fff6d6; color: #6b4e00; padding: .45em .8em; border-radius: 8px; font-weight: 700; }
.card-list { display: flex; flex-wrap: wrap; gap: 6px; }
.card-chip { display: inline-flex; align-items: center; gap: 4px; padding: .3em .6em; border-radius: 8px; border: 1px solid hsl(var(--line)); background: #fff; font-weight: 600; }
.card-chip.attack { background: #fdecec; border-color: #f3b4b4; }
.card-chip.defense { background: #e8f0fe; border-color: #b3c8f5; }
.card-chip.boost { background: #fff6d6; border-color: #f0d98a; }
.card-chip.used { opacity: .45; text-decoration: line-through; }
.card-chip small { font-weight: 400; color: var(--muted); }
.card-chip .x { border: none; background: transparent; padding: 0 2px; color: var(--muted); }
.nowrap { white-space: nowrap; }
.tag-cat { background: #fff3cd; color: #6b4e00; padding: .2em .6em; border-radius: 6px; font-weight: 700; }
.big-ans { font-size: 1.3em; }
.reveal-now { font-weight: 700; color: hsl(var(--brand)); }
label.check { flex-direction: row !important; align-items: center; gap: 8px !important; }
.pins .pin-in { width: 110px; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.pins td { vertical-align: middle; }
.pins .acts button { margin-left: 4px; }
.admins { margin: 0; padding-left: 1.2em; }
.admins li { margin: 6px 0; }
.admins button { padding: .2em .7em; margin-left: 8px; }
.login { position: fixed; inset: 0; z-index: 100; background: #141a2e; display: grid; place-items: center; }
.login-card { background: #fff; border-radius: 16px; padding: 28px 32px; width: min(400px, 92vw); display: flex; flex-direction: column; gap: 14px; }
.login-card h2 { margin: 0 0 4px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; }

.tab { display: none; }
.tab.on { display: block; }
#tab-control.on { display: grid; grid-template-columns: 270px 1fr 260px; height: calc(100vh - 52px); }
.page { padding: 18px 24px; max-width: 1300px; }

.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg button { flex: 1; padding: .45em .5em; }
.seg button.on { background: hsl(var(--brand)); color: #fff; border-color: hsl(var(--brand)); }

.left { border-right: 1px solid hsl(var(--line)); background: #fff; display: flex; flex-direction: column; gap: 10px; padding: 12px; min-height: 0; }
#qlist { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.qitem { display: flex; gap: 8px; text-align: left; align-items: flex-start; padding: .55em .6em; }
.qitem .no { font-weight: 700; color: var(--muted); min-width: 1.4em; }
.qitem .tx { flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qitem.played { background: #f2f3f6; color: var(--muted); }
.qitem.cur { border-color: hsl(var(--brand)); box-shadow: inset 0 0 0 2px hsl(var(--brand)); color: var(--fg); background: #eef2ff; }
.qitem .ck { color: var(--ok); font-weight: 700; }
.screen-ctl h3, .right h3 { margin: 4px 0 8px; font-size: 1em; }

#livePanel { padding: 18px 24px; overflow: auto; }
.lh { display: flex; align-items: center; gap: 12px; font-size: 1.2em; font-weight: 700; }
.lh .tag { background: hsl(var(--brand)); color: #fff; border-radius: 6px; padding: .15em .55em; font-size: .85em; }
.lh .st { color: var(--muted); font-weight: 500; }
.lh .timer { margin-left: auto; font-size: 2.2em; font-weight: 900; font-variant-numeric: tabular-nums; }
#livePanel .slot-q { margin: 14px 0; padding: 16px; background: #fff; border-radius: 12px; border: 1px solid hsl(var(--line)); }
#livePanel .slot-q .q-text { font-size: 1.25em; font-weight: 700; }
#livePanel .slot-q .q-img img { max-height: 220px; }
.mopts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.mopt { padding: .55em .75em; border-radius: 8px; background: #f5f6f8; border: 1px solid transparent; }
.mopt.ans { background: #dff5e6; font-weight: 700; }
.mopt.unshown { opacity: .55; border: 1px dashed #bbb; }
.mopt.wrong { text-decoration: line-through; color: var(--bad); }
.ans-tag { font-size: .75em; background: var(--ok); color: #fff; border-radius: 4px; padding: .05em .4em; margin-left: 4px; }
#livePanel .slot-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 16px; align-items: center; }
button.subtle { margin-left: auto; color: var(--muted); }
.blog { padding-left: 1.4em; } .blog li { margin: 6px 0; }
.dgrid.small { height: 440px; }

.right { border-left: 1px solid hsl(var(--line)); background: #fff; padding: 12px; overflow: auto; }
.adj { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.adj input { width: 70px; }
.team-row { display: grid; grid-template-columns: 12px 2.4em 1fr 38px 38px; gap: 6px; align-items: center; margin: 7px 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #ccc; }
.dot.on { background: #2ecc71; }
.team-row .score { font-size: 1.4em; font-weight: 800; text-align: right; padding-right: 6px; font-variant-numeric: tabular-nums; }
.team-row button { padding: .3em 0; font-size: 1.1em; }
.small { font-size: .85em; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .seg { flex: none; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.tbl th, .tbl td { border-bottom: 1px solid hsl(var(--line)); padding: 8px 10px; text-align: left; vertical-align: top; }
.tbl th { background: #f7f8fa; font-weight: 600; color: var(--muted); }
.tbl.compact td, .tbl.compact th { padding: 5px 8px; }
.tbl .tx { max-width: 420px; white-space: pre-wrap; }
.tbl .opts-col div { margin: 1px 0; }
.tbl .opts-col .ans { color: var(--ok); font-weight: 700; }
.tbl .ans-col { font-weight: 800; font-size: 1.1em; }
.tbl .acts { white-space: nowrap; }
.tbl .acts button { padding: .3em .6em; }
.tbl tr.undone td { opacity: .4; text-decoration: line-through; }
.big-num { font-size: 1.4em; font-weight: 800; }
.img-ref { font-size: .85em; color: var(--muted); margin-top: 4px; }
.img-ref.missing { color: var(--bad); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.img-card { background: #fff; border: 1px solid hsl(var(--line)); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.img-card img { width: 100%; height: 110px; object-fit: contain; background: #f5f6f8; border-radius: 6px; }
.img-card .nm { font-size: .85em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-card .row { display: flex; justify-content: space-between; align-items: center; font-size: .85em; }
.img-card button { padding: .2em .6em; }
.cols { display: flex; gap: 28px; align-items: flex-start; }
.cols > div:first-child { width: 320px; }
.grow { flex: 1; }

.settings { display: flex; flex-direction: column; gap: 12px; max-width: 640px; margin-bottom: 18px; }
.settings label { display: flex; flex-direction: column; gap: 4px; }
fieldset { border: 1px solid hsl(var(--line)); border-radius: 10px; padding: 12px 16px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 700; padding: 0 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
code { background: #f1f3f6; padding: .1em .4em; border-radius: 4px; user-select: all; }

dialog { border: none; border-radius: 14px; padding: 0; width: min(640px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10,15,30,.45); }
.editor { padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.editor h2 { margin: 0; }
.editor label { display: flex; flex-direction: column; gap: 4px; }
.opt-edit { display: flex; flex-direction: column; gap: 6px; }
.oe { flex-direction: row !important; align-items: center; gap: 8px !important; }
.oe input[type=radio] { width: 20px; height: 20px; }
.oe input:not([type]) { flex: 1; }
