/*
 * 联机层样式：房间浏览器、候场名册、房主控制。
 *
 * 和 game.css 的分工：那边是原版的竞技场与大堂皮肤（逐字节保留），这边只负责
 * "原版没有的那些屏幕"。配色沿用 game.css 的 CSS 变量，所以两边看起来是一套东西。
 */

:root{--ok:#56efd3;--warn:#ffc178;--danger:#ff8da9}

/* 原版的本地快速开打条在新版里没有意义了——开打只能由房主发起。 */
.quick-start{display:none!important}
body.rooms-open{overflow:auto;background:var(--bg)}

/* ---------- 房间浏览器 ---------- */
#rooms{position:relative;min-height:100dvh;padding:0 0 42px;background:
  radial-gradient(ellipse at 12% 0%,#17303d66 0,transparent 55%),
  radial-gradient(ellipse at 88% 12%,#2b1f4a44 0,transparent 52%),#0a0e17}
#rooms .rooms-bg{position:absolute;inset:0;pointer-events:none;opacity:.5;
  background-image:linear-gradient(#ffffff08 1px,transparent 1px),linear-gradient(90deg,#ffffff08 1px,transparent 1px);
  background-size:46px 46px;mask-image:radial-gradient(ellipse at 50% 0%,#000 0,transparent 78%)}
.rooms-head{position:relative;display:flex;align-items:center;justify-content:space-between;
  gap:18px;padding:20px 4%;border-bottom:1px solid var(--line);background:#0d1421cc;backdrop-filter:blur(16px)}
.rooms-brand{display:flex;align-items:center;gap:12px;font-weight:800;font-size:17px;letter-spacing:.5px}
.rooms-brand small{display:block;font-weight:600;font-size:9px;letter-spacing:1.6px;color:var(--muted)}
.rooms-id{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end}
.nick-field{display:flex;align-items:center;gap:8px;font-size:10px;color:var(--muted);
  background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:6px 10px}
.nick-field input{width:120px;background:transparent;border:0;outline:0;color:var(--text);font-size:12px;font-weight:600}
.conn-pill{display:flex;align-items:center;gap:7px;font-size:10px;color:var(--muted);
  border:1px solid var(--line);border-radius:999px;padding:6px 12px;background:var(--panel)}
.conn-pill i{width:7px;height:7px;border-radius:50%;background:var(--warn);box-shadow:0 0 8px var(--warn)}
.conn-pill.on i{background:var(--ok);box-shadow:0 0 10px var(--ok)}
.conn-pill.off i{background:var(--danger);box-shadow:0 0 10px var(--danger)}

.rooms-layout{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 316px;
  gap:22px;padding:26px 4% 0;max-width:1560px;margin:0 auto}
.rooms-main{min-width:0}
.rooms-bar{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;flex-wrap:wrap;margin-bottom:18px}
.rooms-bar h2{margin:8px 0 0;font-size:27px;line-height:1.15}
/* game.css 里的按钮默认 `width:100%`（它们本来长在一条竖直的侧栏里）。搬到横向
   工具条上如果不复位，每个按钮都会各占一行——"快速匹配 / 创建房间"会竖着摞起来。 */
.rooms-bar-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.rooms-bar-actions>*{width:auto;flex:0 0 auto}
.rooms-bar-actions .primary-button,.rooms-bar-actions .secondary-button{padding:11px 17px;border-radius:10px;font-size:13px;font-weight:800}
.rooms-bar-actions .secondary-button{background:#1d2b3d;color:var(--text);border:1px solid var(--line)}

.room-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(272px,1fr));gap:14px;min-height:120px}
.room-card{position:relative;display:flex;flex-direction:column;gap:11px;padding:16px;border-radius:14px;
  background:linear-gradient(160deg,#18283a,#111b29);border:1px solid var(--line);
  box-shadow:0 12px 28px #00000038;text-align:left;cursor:pointer;transition:transform .16s,border-color .16s}
.room-card:hover{transform:translateY(-2px);border-color:#56efd355}
.room-card header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.room-card h3{margin:0;font-size:15px;letter-spacing:.2px}
.room-card .room-host{font-size:9px;color:var(--muted);margin-top:5px}
.room-card .room-stats{display:flex;align-items:center;gap:9px;font-size:10px;color:var(--muted);flex-wrap:wrap}
.room-card .room-stats b{color:var(--text);font-size:12px}
.room-card .room-fill{height:4px;border-radius:3px;background:#ffffff12;overflow:hidden}
.room-card .room-fill i{display:block;height:100%;background:linear-gradient(90deg,var(--ok),var(--blue))}
.room-card .room-join{align-self:flex-start;font-size:10px;font-weight:800;letter-spacing:1px;color:var(--ok)}
.badge{display:inline-flex;align-items:center;gap:5px;border-radius:999px;padding:3px 9px;
  font-size:9px;font-weight:800;letter-spacing:.8px;border:1px solid var(--line);background:#ffffff0d;color:var(--muted)}
.badge.live{color:#0d1c1a;background:var(--ok);border-color:transparent}
.badge.over{color:#3a1420;background:var(--danger);border-color:transparent}
/* 房间列表是 auto-fill 网格，空态那一块得自己跨满整行，否则只占最左边一格。 */
.rooms-empty{grid-column:1/-1;padding:34px 16px;text-align:center;color:var(--muted);font-size:12px;
  border:1px dashed var(--line);border-radius:14px}

/* 血量数字是深色（设计成压在高亮血条上）。血少的时候条只填一小段，数字就
   变成"深色压深色"，1919 会被吃掉一半——改成浅色 + 描边，两种底色都读得清。 */
.health-track>span{color:#eafcff;text-shadow:0 1px 2px #04121ccc,0 0 7px #04121c99}
.rooms-note{margin:16px 0 0;font-size:10px;color:var(--muted)}
.rooms-error{color:var(--danger);font-weight:700}

.create-panel{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;
  padding:16px;margin-bottom:16px;border-radius:14px;background:#131f2f;border:1px solid #56efd333}
.create-panel label{display:flex;flex-direction:column;gap:6px;font-size:10px;color:var(--muted)}
.create-panel input,.create-panel select{background:#0c1522;border:1px solid var(--line);border-radius:9px;
  padding:10px 11px;color:var(--text);font-size:13px;font-family:inherit;outline:0}
.create-panel input:focus,.create-panel select:focus{border-color:#56efd388}
.create-panel .primary-button{padding:11px 16px;border-radius:10px;font-size:13px;font-weight:800}
.create-hint{grid-column:1/-1;margin:0;font-size:10px;color:var(--muted)}

.rooms-side{display:flex;flex-direction:column;gap:14px;min-width:0}
.side-panel{border-radius:14px;background:var(--panel);border:1px solid var(--line);padding:14px}
.side-panel-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;
  font-size:12px;font-weight:700;margin-bottom:11px}
.side-panel-head span{font-size:8px;letter-spacing:1.4px;color:var(--muted)}
.side-rows{display:flex;flex-direction:column;gap:7px}
.side-row{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11px;color:var(--text)}
.side-row i{font-style:normal;color:var(--muted);font-size:10px}
.side-steps{margin:0;padding-left:17px;font-size:11px;line-height:1.85;color:var(--muted)}

/* ---------- 候场：房间条 + 名册面板 ---------- */
.room-banner{position:sticky;top:0;z-index:16;display:flex;align-items:center;gap:12px;flex-wrap:wrap;
  padding:10px 4%;background:#0d1624d9;backdrop-filter:blur(14px);border-bottom:1px solid var(--line)}
.room-banner strong{font-size:14px}
.room-banner .room-code{font-size:11px;color:var(--cyan);letter-spacing:2px}
.room-banner .room-meta{font-size:10px;color:var(--muted)}
.room-banner .text-button{margin-left:auto;font-size:11px}
.phase-badge{font-size:9px;font-weight:800;letter-spacing:1px;border-radius:999px;padding:3px 10px;
  background:#ffffff12;color:var(--muted)}
.phase-badge.live{background:var(--ok);color:#0d1c1a}
.phase-badge.over{background:var(--danger);color:#3a1420}

.roster-panel{position:sticky;bottom:0;z-index:15;width:min(960px,94%);margin:0 auto 14px;
  border-radius:14px;background:#101b2bf2;border:1px solid var(--line);
  box-shadow:0 -8px 30px #00000055;backdrop-filter:blur(16px);padding:12px 16px}
.roster-top{display:flex;justify-content:space-between;font-size:11px;font-weight:700;margin-bottom:9px}
.roster-top b{font-size:8px;letter-spacing:1.4px;color:var(--muted);font-weight:600}
.roster-rows{display:flex;gap:9px;flex-wrap:wrap}
.roster-chip{display:flex;align-items:center;gap:8px;padding:6px 11px 6px 7px;border-radius:11px;
  background:#ffffff0a;border:1px solid var(--line);font-size:11px}
.roster-chip canvas{width:26px;height:26px;border-radius:7px;background:#0a1420}
.roster-chip.me{border-color:#56efd377}
.roster-chip.bot{opacity:.75;border-style:dashed}
.roster-chip small{display:block;font-size:8px;color:var(--muted);letter-spacing:.6px}
.roster-chip .host-crown{color:var(--warn);font-size:10px}
.roster-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:11px;flex-wrap:wrap}
.bot-stepper{display:flex;align-items:center;gap:9px;font-size:10px;color:var(--muted)}
.bot-stepper b{font-size:8px;letter-spacing:1.2px}
.bot-stepper button{width:26px;height:26px;border-radius:8px;background:#1d2b3d;color:var(--text);
  border:1px solid var(--line);font-size:14px;line-height:1;cursor:pointer}
.bot-stepper button:disabled{opacity:.35;cursor:not-allowed}
.bot-stepper>#botCount{min-width:22px;text-align:center;font-size:15px;font-weight:800;color:var(--text)}
.roster-note{font-size:10px;color:var(--muted)}
.roster-note.warn{color:var(--warn)}

@media(max-width:1000px){
  .rooms-layout{grid-template-columns:minmax(0,1fr);gap:16px}
  .rooms-side{flex-direction:row;flex-wrap:wrap}
  .rooms-side .side-panel{flex:1 1 240px}
}

/*
 * 矮屏兜底（实测 1440×900 / 1600×950 / 1280×800 都会中）：
 * 原版把候场页锁成 `height:100dvh; overflow:hidden`，而右侧 loadout 面板本身就比
 * 可视区高，于是面板底部的「出发，开打」会掉到视口外、被 absolute 的页脚盖住——
 * 表现是"按钮看得见，点不动"。这里不改原版一行，只把这一页改成可滚动，
 * 让页脚变成 sticky（贴在视口底部而不是内容底部）。
 */
@media(min-width:901px){
  #lobby{height:auto;min-height:100dvh;overflow:visible;padding-bottom:0}
  .lobby-content{height:auto;min-height:calc(100dvh - 165px);padding-bottom:74px}
  .lobby-footer{position:sticky;bottom:0;background:#0b101ae6;backdrop-filter:blur(14px)}
}

@media(max-width:700px){
  .rooms-bar h2{font-size:20px}
  .rooms-head{position:static;flex-direction:column;align-items:flex-start}
  .rooms-id{justify-content:flex-start}
  .room-banner{padding:9px 5%}
  .room-banner .room-meta{display:none}
  .roster-panel{width:96%;padding:11px 12px}
}
