/* 游戏大厅样式：浅蓝色调，和游戏里的界面保持一致；手机和电脑都能用。 */
:root {
  --bg-a: #8fd0ff;
  --bg-b: #e6f4ff;
  --panel: #ffffff;
  --panel-soft: #f0f7ff;
  --line: #b9d8f7;
  --text: #17325c;
  --muted: #5a7399;
  --blue: #3b7bd8;
  --blue-dark: #2a5fb0;
  --gold-a: #ffc94d;
  --gold-b: #ff9a2e;
  --danger: #d8504a;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-a) 0%, var(--bg-b) 55%, #ffffff 100%) fixed;
}

.app { min-height: 100vh; padding: 0 16px 40px; max-width: 1180px; margin: 0 auto; }
.loading { text-align: center; padding-top: 30vh; color: var(--muted); }

/* ---------- 顶栏 ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 10px; flex-wrap: wrap; }
.brand { font-size: 26px; font-weight: 800; letter-spacing: 2px; color: var(--blue-dark); }
.brand small { display: block; font-size: 11px; font-weight: 600; letter-spacing: 3px; color: var(--muted); }
.account { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }

/* ---------- 按钮 ---------- */
button, .btn {
  font: inherit; font-size: 14px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); color: var(--blue-dark);
  padding: 7px 14px; transition: transform 0.08s, box-shadow 0.15s;
}
button:hover:not(:disabled), .btn:hover { box-shadow: 0 2px 10px rgba(59, 123, 216, 0.3); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: default; }
button.primary, .btn.primary { background: linear-gradient(180deg, var(--gold-a), var(--gold-b)); border-color: #f0a030; color: #5a2e00; font-weight: 700; }
button.big { padding: 11px 22px; font-size: 16px; width: 100%; }

/* ---------- 登录框 ---------- */
.login-wrap { display: flex; flex-direction: column; align-items: center; padding-top: 12vh; }
.login-wrap .brand { font-size: 34px; text-align: center; margin-bottom: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 8px 30px rgba(60, 120, 200, 0.2); }
.login-panel { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; }
.login-panel h1 { margin: 0; font-size: 20px; }
.login-panel .hint { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input {
  font: inherit; font-size: 15px; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--text);
}
input:focus { outline: 2px solid rgba(59, 123, 216, 0.45); border-color: var(--blue); }
.error { margin: 0; font-size: 13px; color: var(--danger); }

/* ---------- 游戏卡片 ---------- */
.section-title { margin: 14px 0 12px; font-size: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: 0 6px 22px rgba(60, 120, 200, 0.18); transition: transform 0.15s, box-shadow 0.15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(60, 120, 200, 0.32); }
.card .cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #6db5ff, #b5e0ff); display: flex; align-items: center; justify-content: center; font-size: 46px; overflow: hidden; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; font-size: 18px; }
.card p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--muted); flex: 1; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--panel-soft); border: 1px solid var(--line); color: var(--blue-dark); }
.card .go { align-self: flex-start; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }

/* ---------- 在线玩家 ---------- */
/* 游戏大厅：左边游戏列表、右边在线玩家 */
.lobby-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; align-items: start; }
.lobby-games .section-title { margin-top: 14px; }
.lobby-side { position: sticky; top: 16px; margin-top: 14px; }
.online-panel { padding: 16px 18px; }
.online-panel .section-title { margin: 0 0 10px; }
.online-count { font-size: 14px; font-weight: 600; color: var(--muted); }
.online-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.online-chip { display: flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; background: var(--panel-soft); border: 1px solid var(--line); font-size: 14px; }
.online-chip i { width: 9px; height: 9px; border-radius: 50%; background: #3fbf6a; box-shadow: 0 0 6px rgba(63, 191, 106, 0.8); }
.online-chip.waiting i { background: #f0a030; box-shadow: 0 0 6px rgba(240, 160, 48, 0.8); }
.online-chip.playing i { background: #d8504a; box-shadow: 0 0 6px rgba(216, 80, 74, 0.8); }
.online-chip small { margin-left: auto; color: var(--muted); font-size: 12px; }
.empty-small { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- 弹窗（修改密码） ---------- */
.mask { position: fixed; inset: 0; background: rgba(20, 50, 100, 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.dialog { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; }
.dialog h3 { margin: 0; }
.row { display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 520px) {
  .brand { font-size: 22px; }
  .login-wrap { padding-top: 6vh; }
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .lobby-layout { grid-template-columns: 1fr; }
  .lobby-side { position: static; order: 2; }
  .online-list { max-height: none; }
}
