/* ============================================================
   神人杯#3 · 实时 BP 系统  —— 统一样式
   ============================================================ */

:root {
  --bg: #0a0e17;
  --panel: #111a29;
  --panel-2: #0d1520;
  --line: #1f2c42;
  --line-2: #2a3a55;
  --ink: #e8eefb;
  --ink-2: #c3cfe4;
  --muted: #8496b5;
  --dim: #5b6c88;
  --left-a: #2a3187;
  --left-b: #4a56d4;
  --left-c: #7c86ee;
  --right-a: #b57d16;
  --right-b: #e6b32f;
  --right-c: #f7d968;
  --ban: #ef4444;
  --pick: #38bdf8;
  --ok: #22c55e;
  --warn: #f59e0b;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: #8ea2ff; }
button, input, select { font-family: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #24314a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #33445f; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------- 通用控件 */

.btn {
  border: 1px solid var(--line-2);
  background: #16223a;
  color: var(--ink-2);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: .15s;
  white-space: nowrap;
}
.btn:hover { background: #1d2c48; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #4c58d8, #3b46b8);
  border-color: #5a67e8;
  color: #fff;
  font-weight: 600;
}
.btn.primary:hover { background: linear-gradient(180deg, #5d69ef, #4a55cc); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #7a2b2b; background: #2a1518; color: #f2a1a1; }
.btn.danger:hover { background: #3a1a1e; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }

.input, .select {
  background: #0b1220;
  border: 1px solid var(--line-2);
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  width: 100%;
  transition: .15s;
}
.input:focus, .select:focus { border-color: #4a56d4; box-shadow: 0 0 0 3px rgba(74, 86, 212, .18); }
.input::placeholder { color: var(--dim); }
.select { appearance: none; cursor: pointer; padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, #6b7f9e 50%), linear-gradient(135deg, #6b7f9e 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 1px 6px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--muted);
}
.tag.on { border-color: #2c6b45; color: #72d99b; background: #10231a; }

/* 提示条 */
#errbar {
  position: fixed; left: 50%; top: 14px; transform: translate(-50%, -24px);
  max-width: min(780px, 92vw); z-index: 999;
  background: #3a1418; border: 1px solid #a33; color: #ffd7d7;
  padding: 10px 18px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  opacity: 0; pointer-events: none; transition: .2s;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .6);
}
#errbar.show { opacity: 1; transform: translate(-50%, 0); }

#toast {
  position: fixed; left: 50%; bottom: 46px; transform: translate(-50%, 12px);
  background: #2b1a1a; border: 1px solid #a33; color: #ffd7d7;
  padding: 12px 22px; border-radius: 12px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .22s; z-index: 99;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.ok { background: #12251a; border-color: #2c6b45; color: #b9f2cd; }

/* 带搜索的选择面板 */
.picker {
  position: fixed; z-index: 300;
  background: #101a2b; border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .7); padding: 8px; display: flex; flex-direction: column;
}
.picker .input { padding: 6px 9px; font-size: 12.5px; margin-bottom: 6px; }
.picker-list { list-style: none; margin: 0; padding: 0; max-height: 250px; overflow-y: auto; }
.picker-item {
  padding: 6px 9px; border-radius: 6px; font-size: 12.5px; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.picker-item:hover { background: #1b2941; color: #fff; }
.picker-item.sel { background: #1d3a5c; color: #cfe6ff; }
.picker-item:first-child { color: var(--dim); border-bottom: 1px solid #1b2740; border-radius: 6px 6px 0 0; margin-bottom: 4px; padding-bottom: 7px; }
.picker-none { padding: 8px 9px; font-size: 12px; color: var(--dim); }
.picking { outline: 2px solid #5560d6; outline-offset: 1px; }

/* 分队操作按钮 */
.squad-tools { display: flex; gap: 4px; margin-top: 5px; }
.squad-tools .btn { flex: 1; padding: 3px 6px; font-size: 11.5px; border-radius: 6px; }
.squad-lock {
  display: flex; align-items: center; gap: 4px; margin-top: 5px;
  font-size: 11px; color: #7fd8a4;
}
.squad-lock .btn { padding: 2px 8px; font-size: 11px; border-radius: 5px; flex: none; }
.squad-current {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px;
  background: #131f33; border: 1px solid #24344f; font-size: 12px; color: #e2eaf7;
  cursor: pointer; text-align: left; width: 100%;
}
.squad-current:hover { border-color: #3a4c6d; }
.squad-current .ph2 { color: var(--dim); }
.squad-current .chev2 { margin-left: auto; color: var(--dim); font-size: 10px; }
.squad-badge {
  font-size: 10px; padding: 1px 6px; border-radius: 999px;
  border: 1px solid #2c6b45; color: #7fd8a4; background: #10231a;
}
.track-pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px;
  padding: 1px 8px; border-radius: 999px; border: 1px solid #2d3d5c;
  background: #131f33; color: #a8b8d2;
}

/* ---- 分队面板 ---- */
.panelwrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 9px; }
.sq-title { font-size: 14px; font-weight: 700; color: #cfd9ea; letter-spacing: 1px; flex: none; }
.sqgrid {
  flex: 1; min-height: 0; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px; padding-right: 3px; align-content: start;
}
.sqcard {
  position: relative; border: 1px solid #1b2740; border-radius: 8px; background: #101a2b;
  padding: 0; cursor: pointer; overflow: hidden; transition: .12s; display: block;
}
.sqcard img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #172236; }
.sqcard .sqname {
  font-size: 11px; text-align: center; color: #b8c6de; padding: 3px 2px 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sqgrid.can-act .sqcard:hover { border-color: #7c86ee; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .55); }
.sqgrid.can-act .sqcard:hover .sqname { color: #fff; }
/* 只有「已禁用 / 已使用」才置灰；「已选用」只是标记，被对方选用的分队仍然可以点 */
.sqcard.banned img, .sqcard.usedpast img { filter: grayscale(1) brightness(.45); }
.sqcard.banned .sqname, .sqcard.usedpast .sqname { color: #5c6c86; }
.sqcard.chosen .sqmark { box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }
.sqcard .sqmark {
  position: absolute; top: 4px; right: 4px; font-size: 10px; padding: 1px 5px;
  border-radius: 4px; color: #fff;
}
.sqcard.banned .sqmark { background: rgba(190, 40, 40, .85); }
.sqcard.chosen .sqmark { background: rgba(30, 120, 170, .85); }
.sqcard.usedpast .sqmark { background: rgba(120, 100, 30, .9); }

/* 选用分队栏 */
.slotbox[data-kind="choosesquad"] h3 { color: #9bd8f7; }
.slotbox[data-kind="choosesquad"] .slot.filled { border-color: #1f4d63; background: #0b1a24; }
img.sq-mini {
  width: 18px; height: 18px; border-radius: 3px; object-fit: cover;
  vertical-align: -3px; margin-right: 4px; border: 1px solid rgba(255, 255, 255, .25);
}
header.top .squad { display: flex; align-items: center; gap: 2px; }
.slot.squad-slot img { border: 1px solid #5c2626; }
.dim { color: rgba(255, 255, 255, .55); }

/* ============================================================ 加入页 */

body.join-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100%;
  background:
    radial-gradient(1000px 600px at 12% -10%, rgba(74, 86, 212, .28), transparent 60%),
    radial-gradient(900px 560px at 92% 108%, rgba(230, 179, 47, .16), transparent 62%),
    var(--bg);
  padding: 28px 16px;
}
.join-card {
  width: 100%; max-width: 480px;
  background: linear-gradient(180deg, rgba(20, 30, 48, .96), rgba(13, 20, 32, .98));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 26px 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
.join-card h1 {
  font-size: 25px; margin: 0; letter-spacing: 2px;
  background: linear-gradient(90deg, #9fb0ff, #fff 45%, #f5cf6a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.join-card .sub { color: var(--muted); font-size: 12.5px; margin: 8px 0 22px; letter-spacing: .5px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; letter-spacing: .8px; }
#code {
  font-size: 24px; letter-spacing: 9px; text-align: center; font-weight: 700;
  text-transform: uppercase; padding: 12px 10px 12px 19px;
  font-family: Consolas, "Courier New", monospace;
}
.code-hint { font-size: 12px; color: var(--dim); min-height: 17px; margin-top: 7px; }
.code-hint.bad { color: #f0a0a0; }
.code-hint.good { color: #7fd8a4; }

.team-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.team-card {
  border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 10px;
  cursor: pointer; text-align: center; transition: .15s; background: #0d1626; user-select: none;
}
.team-card .tn { font-weight: 700; font-size: 15px; letter-spacing: 1px; }
.team-card .tc { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.team-card .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.team-card[data-team="L"] .dot { background: var(--left-c); }
.team-card[data-team="R"] .dot { background: var(--right-c); }
.team-card[data-team="L"].sel { border-color: var(--left-c); background: linear-gradient(180deg, #18214a, #0e1728); box-shadow: 0 0 0 3px rgba(124, 134, 238, .16); }
.team-card[data-team="R"].sel { border-color: var(--right-c); background: linear-gradient(180deg, #3a2f10, #1a1608); box-shadow: 0 0 0 3px rgba(247, 217, 104, .14); }
.team-card.full { opacity: .42; cursor: not-allowed; }
.join-card .btn.primary { width: 100%; margin-top: 6px; padding: 11px; font-size: 15px; letter-spacing: 2px; }
.join-foot { margin-top: 16px; display: flex; justify-content: space-between; font-size: 11.5px; color: var(--dim); }
.join-foot a { color: var(--dim); text-decoration: none; }
.join-foot a:hover { color: #8ea2ff; }
.err { color: #f0a0a0; font-size: 12.5px; min-height: 18px; margin-top: 10px; text-align: center; }

/* ============================================================ 房间页 */

body.room { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ---- 顶栏 ---- */
header.top {
  position: relative; flex: none; height: 76px;
  display: grid; grid-template-columns: 1fr 340px 1fr; align-items: center;
  gap: 10px; padding: 0 16px; z-index: 5;
}
header.top .bg { position: absolute; top: 0; bottom: 0; z-index: 0; }
header.top .bg-l {
  left: 0; right: calc(50% - 46px);
  background: linear-gradient(96deg, #171c52 0%, #2b3287 42%, #4a56d4 100%);
  clip-path: polygon(0 0, 100% 0, calc(100% - 84px) 100%, 0 100%);
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .18);
}
header.top .bg-r {
  right: 0; left: calc(50% - 46px);
  background: linear-gradient(264deg, #b57d16 0%, #e6b32f 55%, #f7d968 100%);
  clip-path: polygon(84px 0, 100% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .16);
}
header.top .side { position: relative; z-index: 1; display: flex; flex-direction: row; align-items: center; gap: 12px; min-width: 0; }
header.top .side.right { flex-direction: row-reverse; }
header.top .side-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
header.top .side.right .side-txt { align-items: flex-end; text-align: right; }
header.top .team-logo {
  flex: none; height: 58px; width: auto; max-width: 132px;
  object-fit: contain;
  background: rgba(255, 255, 255, .93); border-radius: 10px; padding: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}
header.top .team-logo[hidden] { display: none; }
header.top .team-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
header.top .team-name { font-size: 19px; font-weight: 800; letter-spacing: 1px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
header.top .badge-role { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; }
header.top .squad { font-size: 12.5px; color: rgba(255, 255, 255, .88); display: flex; align-items: center; gap: 6px; }
header.top .squad select {
  background: rgba(0, 0, 0, .22); color: #fff; border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 6px; font-size: 12px; padding: 2px 22px 2px 6px; max-width: 150px;
}
header.top .phase {
  position: relative; z-index: 2; justify-self: center;
  background: rgba(8, 12, 20, .82);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px; padding: 4px 18px; text-align: center;
  backdrop-filter: blur(6px); min-width: 244px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
}
header.top .phase .plabel { font-size: 12px; color: var(--ink-2); letter-spacing: 3px; }
header.top .phase .ptime {
  font-size: 23px; font-weight: 800; font-family: Consolas, monospace; letter-spacing: 2px;
  line-height: 1.15; color: #fff;
}
header.top .phase .ptime.low { color: #ff8a8a; }
header.top .phase .ptime.paused { color: #f0c66b; }
header.top .phase .psub { font-size: 11px; color: var(--muted); letter-spacing: .5px; }

/* ---- 主区域 ---- */
main.board {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 244px minmax(0, 1fr) 244px;
  background: var(--bg);
}

aside.rail {
  display: flex; flex-direction: column; gap: 9px; padding: 10px 9px;
  overflow-y: auto; min-height: 0;
  background: linear-gradient(180deg, #0e1929, #0a0f18);
}
aside.rail.left { border-right: 1px solid #14203a; }
aside.rail.right { border-left: 1px solid #14203a; }

.slotbox {
  border: 1px solid var(--line); border-radius: 9px; background: #0c1421; padding: 6px 7px 7px;
  transition: .2s;
}
.slotbox h3 {
  margin: 0 0 6px; font-size: 11.5px; letter-spacing: 2px; color: var(--muted);
  display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 600;
}
.slotbox h3 .n { color: var(--dim); letter-spacing: 0; font-size: 10.5px; }
.slotbox[data-kind="ban"] h3 { color: #f2a3a3; }
.slotbox[data-kind="pick"] h3 { color: #9bd8f7; }
.slotbox.active { border-color: #5560d6; box-shadow: 0 0 0 2px rgba(85, 96, 214, .22), 0 0 22px rgba(85, 96, 214, .16); }
aside.rail.right .slotbox.active { border-color: #e6b32f; box-shadow: 0 0 0 2px rgba(230, 179, 47, .22), 0 0 22px rgba(230, 179, 47, .16); }

.slots { display: flex; flex-direction: column; gap: 4px; }
.slot {
  display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 5px;
  border: 1px dashed #1c2a42; border-radius: 6px; background: #0a1120;
  overflow: hidden;
}
.slot .ph {
  width: 34px; height: 34px; border-radius: 5px; border: 1px solid #1b2740;
  position: relative; flex: none; background: #0d1626;
}
.slot .ph::after {
  content: ""; position: absolute; left: 7px; right: 7px; top: 50%; height: 2px;
  background: #26364f; transform: rotate(-32deg);
}
.slot .nm { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .phsquad {
  width: 34px; height: 34px; border-radius: 5px; flex: none; display: grid; place-items: center;
  background: #3a1a1e; border: 1px solid #5c2626; color: #f0b0b0; font-size: 12px; letter-spacing: 1px;
}
.slot.filled { border-style: solid; border-color: #24344f; background: #101b2d; }
.slot.filled .nm { color: var(--ink-2); }
.slot.filled img { width: 34px; height: 34px; border-radius: 5px; flex: none; object-fit: cover; }
.slot.ban { border-color: #5c2626; background: #1b1013; }
.slot.ban .nm { color: #f0b0b0; }
.slot.pick { border-color: #1f4d63; background: #0b1a24; }
.slot.pick .nm { color: #a8dcf5; }
.slot.newest { animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(.9); filter: brightness(2.2); } 100% { transform: scale(1); } }

/* ---- 中央舞台 ---- */
section.stage {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  padding: 10px 12px 10px; gap: 9px; background: #0a0e17;
}
.turnbar { flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.turntext { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.turntext.mine { color: #b9f2cd; }
.turntext.wait { color: var(--muted); font-weight: 500; }
.turntext .hl { color: #fff; }
.flow { display: flex; gap: 3px; margin-left: auto; }
.fchip {
  width: 21px; height: 24px; border-radius: 4px; display: grid; place-items: center;
  font-size: 10.5px; border: 1px solid #1d2942; color: #4d5f7b; background: #0c1421;
  transition: .18s;
}
.fchip.l { border-color: #2d3580; color: #6d78c9; }
.fchip.r { border-color: #6e5316; color: #b08e35; }
.fchip.w2 { width: 29px; font-size: 9.5px; letter-spacing: 0; }
.fchip.done { background: #182238; color: #a9b8d2; border-color: #2b3b57; }
.fchip.done.l { background: #1b2158; color: #b9c0ff; border-color: #3a45a8; }
.fchip.done.r { background: #3b2f0e; color: #ffe08a; border-color: #7a5c15; }
.fchip.now { background: #fff; color: #0a0e17; border-color: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .55); }

.poolbar { flex: none; display: flex; align-items: center; gap: 7px; }
.poolbar .search { position: relative; flex: 1; max-width: 260px; }
.poolbar .search .input { padding: 6px 10px 6px 28px; font-size: 12.5px; }
.poolbar .search::before {
  content: "⌕"; position: absolute; left: 9px; top: 50%; transform: translateY(-52%);
  color: var(--dim); font-size: 15px;
}
.pool-stat { font-size: 11.5px; color: var(--dim); margin-left: auto; }

.pool { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 3px; }
.grp { border: 1px solid #172234; border-radius: 8px; overflow: hidden; flex: none; background: #0b1320; }
.grp-head {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 5px 10px;
  background: #101a2b; border: 0; color: #b9c7de; font-size: 12.5px; cursor: pointer; text-align: left;
  letter-spacing: 1px;
}
.grp-head:hover { background: #16233a; }
.grp-head .cnt { font-size: 10.5px; color: var(--dim); letter-spacing: 0; }
.grp-head .chev { margin-left: auto; color: var(--dim); font-size: 10px; transition: .18s; }
.grp.closed .chev { transform: rotate(-90deg); }
.grp.closed .grp-body { display: none; }
.grp-body {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 6px; padding: 7px;
}
.tile {
  position: relative; border: 1px solid #1b2740; border-radius: 6px; background: #101a2b;
  padding: 0; cursor: pointer; overflow: hidden; transition: .12s; display: block;
}
.tile img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #172236; }
.tile .tname {
  font-size: 10.5px; text-align: center; color: #a8b7cf; padding: 2px 2px 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pool.can-act .tile:hover { border-color: #7c86ee; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
.pool.can-act .tile:hover .tname { color: #fff; }
.tile.used { cursor: not-allowed; }
.tile.used img { filter: grayscale(1) brightness(.42); }
.tile.used .tname { color: #4e5f7a; }
.tile .mark {
  position: absolute; inset: 0 0 18px 0; display: grid; place-items: center;
  font-size: 19px; font-weight: 800; color: #fff; letter-spacing: 1px;
}
.tile.ban .mark { background: rgba(190, 40, 40, .42); }
.tile.pick .mark { background: rgba(30, 120, 170, .40); }
.tile .who {
  position: absolute; top: 2px; right: 2px; font-size: 9.5px; padding: 0 4px;
  border-radius: 3px; background: rgba(0, 0, 0, .6); color: #dbe6f7;
}

/* 观察者 */
.observer {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 10px;
  background: radial-gradient(600px 300px at 50% 40%, rgba(74, 86, 212, .12), transparent 70%);
}
.observer h1 { margin: 0; font-size: 34px; letter-spacing: 6px; font-weight: 800; color: #eef3ff; }
.observer p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.9; letter-spacing: .6px; }
.observer .obflow { margin-top: 4px; }
.observer .obcard {
  margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; background: #0d1522;
  padding: 10px 16px; font-size: 12.5px; color: var(--ink-2); min-width: 320px;
}
.observer .obcard b { color: #fff; }

.loglist {
  margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 5px;
  justify-content: center; max-width: 760px;
}
.loglist li {
  font-size: 11px; padding: 2px 7px; border-radius: 999px; border: 1px solid #1d2942;
  color: #9fb0c8; background: #0c1421;
}
.loglist li.b { border-color: #4a2326; color: #ecb0b0; }
.loglist li.p { border-color: #1d4457; color: #a5d7ef; }
.loglist li .no { color: #4d5f7b; margin-right: 4px; }

/* 守门 / 结束 */
.overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(6, 9, 15, .88); backdrop-filter: blur(3px);
}
.overlay .box {
  background: #101a2b; border: 1px solid var(--line-2); border-radius: 14px;
  padding: 26px 34px; text-align: center; max-width: 460px;
}
.overlay h2 { margin: 0 0 8px; font-size: 20px; }
.overlay p { color: var(--muted); margin: 0 0 18px; font-size: 13px; line-height: 1.8; }

/* ---- 底栏 ---- */
footer.bottom {
  flex: none; height: 34px; display: flex; align-items: center; gap: 14px;
  padding: 0 14px; border-top: 1px solid #131f33; background: #080c14;
  font-size: 11.5px; color: var(--dim); overflow: hidden;
}
footer.bottom .code { color: #b9c7de; letter-spacing: 2px; font-weight: 700; }
footer.bottom .members { display: flex; gap: 10px; overflow: hidden; }
footer.bottom .m { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
footer.bottom .m .d { width: 6px; height: 6px; border-radius: 50%; background: #33455f; }
footer.bottom .m.on .d { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
footer.bottom .m.ctl { color: #cfe0ff; }
footer.bottom .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
footer.bottom .conn { display: flex; align-items: center; gap: 5px; }
footer.bottom .conn i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
footer.bottom .conn.bad i { background: var(--ban); }

/* ============================================================ 主办方 */

body.admin { min-height: 100vh; background: var(--bg); padding: 22px; }

/* 登录 */
.login-wrap {
  min-height: calc(100vh - 44px);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: 100%; max-width: 380px;
  background: linear-gradient(180deg, rgba(20, 30, 48, .97), rgba(13, 20, 32, .99));
  border: 1px solid var(--line); border-radius: 16px;
  padding: 28px 26px 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.login-card h1 {
  font-size: 21px; margin: 0; letter-spacing: 3px;
  background: linear-gradient(90deg, #9fb0ff, #fff 50%, #f5cf6a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-card .sub { color: var(--muted); font-size: 12.5px; margin: 8px 0 22px; letter-spacing: .5px; }
.login-card .btn.primary { width: 100%; margin-top: 6px; padding: 11px; font-size: 15px; letter-spacing: 3px; }
.login-card .join-foot { margin-top: 16px; display: flex; justify-content: space-between; font-size: 11.5px; color: var(--dim); }
.login-card .join-foot a { color: var(--dim); text-decoration: none; }
.login-card .join-foot a:hover { color: #8ea2ff; }
.login-card .err { color: #f0a0a0; font-size: 12.5px; min-height: 18px; margin-top: 10px; text-align: center; }
.who { font-size: 11.5px; color: var(--muted); }

/* 赛道选择 */
.flabel { display: block; font-size: 11.5px; color: var(--muted); margin: 0 0 6px; }
.track-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.track-card {
  border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 8px; cursor: pointer;
  background: #0d1626; text-align: center; transition: .15s; color: var(--ink-2);
}
.track-card:hover { border-color: #3c4c6e; }
.track-card.sel {
  border-color: #7c86ee; background: linear-gradient(180deg, #1a2350, #0f1728);
  box-shadow: 0 0 0 3px rgba(124, 134, 238, .16);
}
.track-card .tc-name { font-size: 14px; font-weight: 700; letter-spacing: 1px; }
.track-card.sel .tc-name { color: #fff; }
.track-card .tc-cnt { font-size: 11px; color: var(--dim); margin-top: 3px; }

/* 分队按钮 */
.squad-btn { text-align: left; cursor: pointer; padding-right: 26px; position: relative; }
.squad-btn::after {
  content: "▾"; position: absolute; right: 10px; top: 50%; transform: translateY(-55%);
  color: var(--dim); font-size: 11px;
}
.squad-btn.picked { color: #e8eefb; }
.hint-line { font-size: 11.5px; color: var(--dim); line-height: 1.7; margin-top: 10px; }

.used-edit { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.used-edit .btn { text-align: left; font-size: 11px; padding: 3px 8px; border-radius: 6px; }
.admin-wrap { max-width: 1180px; margin: 0 auto; }
.addr-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  background: #0b1320; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 16px; margin-bottom: 16px;
}
.addr-card .ttl { font-size: 11.5px; color: var(--dim); letter-spacing: 2px; }
.addr-list { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.addr-row { display: flex; align-items: center; gap: 8px; }
.addr-row .k { font-size: 11px; color: var(--muted); letter-spacing: 1px; white-space: nowrap; }
.addr-row .v {
  font-family: Consolas, monospace; font-size: 12.5px; color: #b9f2cd;
  text-decoration: none; word-break: break-all;
}
.addr-row .v:hover { text-decoration: underline; }
.admin-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.admin-head h1 { font-size: 21px; margin: 0; letter-spacing: 2px; }
.admin-head .sp { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.admin-head .sp .input { width: 160px; padding: 6px 10px; font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 410px minmax(0, 1fr); gap: 16px; align-items: start; }
.card {
  background: #0e1624; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
}
.card h2 { margin: 0 0 14px; font-size: 15px; color: var(--ink); letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.card h2 .n { font-size: 11px; color: var(--dim); font-weight: 400; letter-spacing: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.form-row.full { grid-template-columns: 1fr; }
.form-row.quad { grid-template-columns: repeat(4, 1fr); }
.form-row label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.form-row .input, .form-row .select { padding: 7px 10px; font-size: 13px; }
.sec-label { font-size: 11.5px; color: var(--dim); letter-spacing: 1px; margin: 14px 0 8px; border-top: 1px dashed #1c2942; padding-top: 12px; }

.code-box {
  display: none; margin-top: 14px; padding: 14px; border-radius: 10px;
  background: linear-gradient(180deg, #142a1f, #0e1a14); border: 1px solid #2c6b45;
  text-align: center;
}
.code-box.show { display: block; }
.code-box .lb { font-size: 11.5px; color: #7fd8a4; letter-spacing: 2px; }
.code-box .cd { font-size: 33px; font-weight: 800; letter-spacing: 11px; color: #b9f2cd; margin: 6px 0 4px; font-family: Consolas, monospace; }
.code-box .lk { font-size: 11.5px; color: #8fb9a2; word-break: break-all; }

table.rooms { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.rooms th {
  text-align: left; font-weight: 500; color: var(--dim); font-size: 11px; letter-spacing: 1px;
  padding: 6px 8px; border-bottom: 1px solid var(--line);
}
table.rooms td { padding: 8px; border-bottom: 1px solid #141f31; vertical-align: top; }
table.rooms tr:hover td { background: #0b1320; }
table.rooms .c-code { font-family: Consolas, monospace; font-weight: 700; letter-spacing: 2px; color: #cfd9ea; cursor: pointer; }
table.rooms .c-code:hover { color: #fff; text-decoration: underline; }
table.rooms .sub { color: var(--dim); font-size: 11px; }
table.rooms .acts { display: flex; gap: 5px; flex-wrap: wrap; }
table.rooms .mem { display: flex; flex-direction: column; gap: 3px; }
table.rooms .mem .mm { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
table.rooms .mem .mm button { padding: 0 5px; font-size: 10px; border-radius: 4px; }
.empty-tip { color: var(--dim); font-size: 12.5px; padding: 18px 0; text-align: center; }

/* ---------------- 背景音乐 ---------------- */
.bgm-card {
  display: flex; flex-direction: column; gap: 8px;
  background: #0b1320; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 16px; margin-bottom: 16px;
}
.bgm-head { display: flex; align-items: center; gap: 12px; }
.bgm-head .ttl { font-size: 11.5px; color: var(--dim); letter-spacing: 2px; }
.bgm-title { font-size: 12.5px; color: #b9f2cd; letter-spacing: .5px; }
.bgm-state { font-size: 11.5px; color: var(--dim); }
.bgm-state.on { color: #7fd8a4; }
.bgm-ops { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bgm-vol { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.bgm-vol input { width: 110px; accent-color: #4f9e74; }
.bgm-tip { font-size: 11px; color: var(--dim); }
.bgm-btn.on { color: #7fd8a4; border-color: #2c6b45; }

/* ---------------- 备案号 ---------------- */
.icp { color: var(--dim); font-size: 11px; text-decoration: none; letter-spacing: .3px; }
.icp:hover { color: var(--muted); text-decoration: underline; }
.icp-line { margin-top: 12px; text-align: center; }
footer.bottom .icp { font-size: 10.5px; opacity: .9; white-space: nowrap; }

/* ---------------- 队徽 ---------------- */
.logo-edit { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.logo-edit .logo-thumb {
  width: 36px; height: 26px; object-fit: contain; flex: none;
  background: #fff; border: 1px solid var(--line); border-radius: 5px;
}
.logo-edit .logo-thumb.none { opacity: .22; }

@media (max-width: 1180px) {
  main.board { grid-template-columns: 210px minmax(0, 1fr) 210px; }
  header.top { grid-template-columns: 1fr 300px 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}
