/* ---------- 在线版补充 ---------- */
/* 设计：单一的"海图 + 羊皮纸"世界，深海蓝底、羊皮纸卡片、金色强调；只用一套配色（游戏场景本身是固定的白天海面） */
:root { color-scheme: dark; --display: "ZCOOL KuaiLe", "Microsoft YaHei", "PingFang SC", sans-serif; }
html, body { height: 100%; }
body { background: #0d4f7a; color: #fff; }
.banner h1, .card h2, #over h1, #roomTitle { font-family: var(--display); font-weight: 400; }
.screen { position: fixed; inset: 0; overflow-y: auto; padding: calc(18px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(70px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: radial-gradient(ellipse at 50% 120%, #2a8fc7 0%, #0d4f7a 55%, #072c45 100%); z-index: 4; }
.screen .banner h1 { font-size: clamp(38px, 9vw, 60px); letter-spacing: 4px; }
.card { min-width: 0; max-width: 100%; }
.card.wide { width: 560px; }
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 10px; color: #4a3010; }
#connDot { width: 10px; height: 10px; border-radius: 50%; background: #2fa84a; box-shadow: 0 0 0 2px #2fa84a44; }
#connDot.off { background: #c9302c; box-shadow: 0 0 0 2px #c9302c44; }
#offlineNote { font-size: 13px; background: #fff3d0; border: 1px dashed #b08a50; border-radius: 8px; padding: 8px 10px; margin-top: 10px; line-height: 1.5; color: var(--ink); }
.btn2 { display: block; width: 100%; margin-top: 12px; padding: 10px; font-size: 16px; font-weight: 800; border-radius: 10px; border: 2px solid var(--wood); background: var(--gold); color: var(--ink); }
.row { display: flex; gap: 8px; margin-top: 8px; }
.row input { flex: 1; min-width: 0; padding: 9px 10px; border-radius: 8px; border: 2px solid #b08a50; background: #fffaf0; font-family: inherit; font-size: 15px; color: var(--ink); }
.row button { flex: 0 0 auto; padding: 0 16px; border-radius: 8px; border: 2px solid #3a200b; background: linear-gradient(#e0553d, #9a2a18); color: #fff; font-weight: 800; font-size: 15px; }
.row button:disabled { filter: grayscale(.8); opacity: .6; }
.lbl { font-size: 13px; font-weight: 700; margin-top: 14px; }
#roomList { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
#roomList .empty { font-size: 14px; color: #6b4a1a; margin: 6px 0; line-height: 1.5; }
.roomCard { display: flex; align-items: center; gap: 10px; background: #fffaf0; border: 2px solid #c9a866; border-radius: 10px; padding: 8px 10px; }
.rc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rc-main b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-main small { font-size: 12px; color: #6b4a1a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill.wait { background: #d8f2dc; color: #1f6a2f; } .pill.play { background: #ffe1d6; color: #8a2a14; }
.roomCard .join { border: 2px solid #3a200b; background: var(--gold); color: var(--ink); font-weight: 800; border-radius: 8px; padding: 6px 14px; font-size: 14px; }
#homeMsg { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: rgba(30,18,8,.92); border: 2px solid var(--gold); border-radius: 12px; padding: 10px 18px; font-size: 15px; z-index: 9; max-width: calc(100vw - 32px); }
.roomHead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; max-width: 1180px; margin: 0 auto 16px; }
#roomTitle { margin: 0; font-size: clamp(26px, 6vw, 40px); color: var(--gold); text-shadow: 0 3px 0 #8a5a10; }
.codeBox { display: flex; align-items: center; gap: 8px; background: var(--parch); color: var(--ink); border: 3px solid var(--wood); border-radius: 12px; padding: 4px 6px 4px 12px; }
.codeBox small { font-size: 12px; }
#roomCode { font-size: 22px; font-weight: 900; letter-spacing: 3px; user-select: text; -webkit-user-select: text; font-variant-numeric: tabular-nums; }
.codeBox button, #btnLeaveRoom { border: 2px solid #3a200b; border-radius: 8px; padding: 6px 12px; font-weight: 800; font-size: 14px; }
.codeBox button { background: var(--gold); color: var(--ink); }
#btnLeaveRoom { background: linear-gradient(#a8692f, #6b3f1d); color: #fff; }
#spectNote { font-size: 13px; color: #6b4a1a; margin-top: 8px; }
#portraitTip.hidden { display: none; }
#btnLeave2 { display: block; width: 100%; margin-top: 10px; padding: 10px; border-radius: 12px; border: 2px solid var(--wood); background: transparent; color: var(--ink); font-weight: 700; font-size: 15px; }
#minimap { left: calc(12px + env(safe-area-inset-left, 0px)); }
#teams { right: calc(12px + env(safe-area-inset-right, 0px)); }
#sidebtns { right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
#weapons { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
#over { max-width: calc(100vw - 32px); min-width: min(360px, calc(100vw - 32px)); }
#help { max-width: calc(100vw - 24px); max-height: calc(100% - 24px); overflow-y: auto; }
body.inlobby #chat { display: block; left: auto; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(320px, calc(100vw - 32px)); z-index: 5; }
body.inlobby #chat:not(.inroom) { display: none; }
@media (max-width: 900px), (max-height: 520px) {
  #minimap { left: calc(8px + env(safe-area-inset-left, 0px)); }
  #teams { right: calc(8px + env(safe-area-inset-right, 0px)); }
  #weapons { left: calc(8px + env(safe-area-inset-left, 0px)); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 90px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); }
  #sidebtns { right: calc(8px + env(safe-area-inset-right, 0px)); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .card, .card.wide { width: 100%; }
  .screen .banner .sub { font-size: 12px; }
  body.inlobby #chat.inroom { position: static; width: 100%; margin: 14px auto 0; max-width: 560px; }
}
#errBar { display: none; position: fixed; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 50; background: #fff3d0; color: #6b1a0c; border: 2px solid #c9302c; border-radius: 10px; padding: 10px 14px; font-size: 14px; line-height: 1.5; box-shadow: 0 8px 24px #0006; }

#home .tip { font-size: 13px; color: #6b4a1a; line-height: 1.6; margin: 10px 0 0; }
#lobby #plist li.off { opacity: .45; }
#homeMsg.hidden { display: none; }
#conn.hidden { display: none; }
