* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; color: #e8edf7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #0a0f1e 0%, #141b30 45%, #10182a 100%);
}
.topbar {
  height: 58px; display: flex; align-items: center; gap: 18px; padding: 0 24px;
  border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(10,15,30,.72);
  position: sticky; top: 0; z-index: 5;
}
.topbar a { color: #aab6cc; text-decoration: none; font-size: 14px; }
.topbar .brand { flex: 1; font-weight: 700; color: #ed9f64; }
.topbar button, .btn {
  font: inherit; cursor: pointer; border-radius: 8px; padding: 9px 16px;
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: #e8edf7;
}
.topbar button:hover, .btn:hover { background: rgba(255,255,255,.12); }
.btn.primary { background: #ed9f64; color: #17202f; border-color: #ed9f64; font-weight: 700; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.wrap { box-sizing: border-box; width: min(var(--page-max), calc(100% - var(--page-gutter))); margin: 26px auto; padding: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-head h1 { font-size: 24px; margin: 0; color: #f4e6c4; }
.page-head p { margin: 6px 0 0; color: #9aa6bb; font-size: 13px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); border-radius: 999px; padding: 8px 18px; color: #b9c6da; cursor: pointer; }
.tabs button.active { background: rgba(237,159,100,.18); border-color: #ed9f64; color: #ffd2a8; }
.section { margin-bottom: 26px; }
.section h2 { font-size: 16px; color: #f0d78c; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.section h2 .count { font-size: 12px; color: #9aa6bb; background: rgba(255,255,255,.07); padding: 2px 8px; border-radius: 999px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.card .row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #96a3b9; }
.card .players { display: flex; justify-content: space-between; font-size: 15px; font-weight: 600; }
.card .players .vs { color: #71809a; font-weight: 400; }
.card .tag { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: rgba(237,159,100,.16); color: #ffd2a8; }
.card .tag.waiting { background: rgba(255,255,255,.08); color: #aab6cc; }
.card .tag.finished { background: rgba(120,160,255,.12); color: #b8ccff; }
.card .actions { display: flex; gap: 8px; margin-top: 2px; }
.card .actions .btn { flex: 1; padding: 7px 10px; font-size: 13px; }
.empty { color: #7f8da5; font-size: 13px; padding: 22px; text-align: center; border: 1px dashed rgba(255,255,255,.1); border-radius: 12px; }
.notice {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 20px;
  border-radius: 12px; background: rgba(237,159,100,.08); border: 1px solid rgba(237,159,100,.22);
}
.notice img { width: 74px; height: 74px; object-fit: cover; border-radius: 8px; background: #fff; }
.notice .txt { flex: 1; font-size: 13px; color: #cbd6e8; line-height: 1.7; }
.notice .txt b { color: #ffd2a8; }
.mask {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.72); z-index: 20;
}
.mask.show { display: flex; }
.mask-card {
  width: 560px; max-width: 92vw; max-height: 88vh; overflow: auto;
  background: #182238; border: 1px solid rgba(237,159,100,.3); border-radius: 16px; padding: 24px;
}
.mask-card h3 { margin: 0 0 14px; color: #f0d78c; }
.field { margin: 12px 0; font-size: 13px; }
.field label { display: block; color: #9aa6bb; margin-bottom: 6px; }
.field select, .field input {
  width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.25); color: #fff;
}
.radio-row { display: flex; gap: 12px; }
.radio-item { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 7px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); }
.radio-item input { width: auto; accent-color: #ed9f64; }
.byoyomi-row { display: flex; align-items: center; gap: 10px; }
.byoyomi-row select { flex: 1; }
.byoyomi-row span { color: #9aa6bb; }
.follow-hint { color: #c9a77a; font-size: 12px; line-height: 1.6; }
.mask-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.qr-line { display: flex; gap: 14px; align-items: center; margin-top: 16px; font-size: 12px; color: #9aa6bb; }
.qr-line img { width: 72px; height: 72px; border-radius: 6px; background: #fff; }
.login-hint { color: #9aa6bb; font-size: 13px; }
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); display: none; z-index: 40;
  background: rgba(20,30,48,.96); border: 1px solid rgba(237,159,100,.4); padding: 10px 18px; border-radius: 10px;
}
.room-panel { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 22px; }
.room-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.room-title b { color: #ed9f64; letter-spacing: 2px; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.side-box { border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 16px; background: rgba(0,0,0,.16); }
.side-box h3 { margin: 0 0 10px; font-size: 15px; color: #f0d78c; }
.side-box .member { font-size: 14px; padding: 7px 0; border-bottom: 1px dashed rgba(255,255,255,.07); }
.side-box .member:last-child { border-bottom: 0; }
.side-box .btn { width: 100%; margin-top: 12px; }
.room-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
@media (max-width: 700px) { .sides { grid-template-columns: 1fr; } .page-head { flex-direction: column; align-items: flex-start; gap: 12px; } }
