/* ============================================================
   大厅 + 登录注册 样式层
   ============================================================ */

/* ---------------- 登录 / 注册 ---------------- */
.gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
  overflow-y: auto;
}

.auth-shell {
  width: 100%;
  max-width: 860px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--panel);
  backdrop-filter: blur(24px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: popIn 0.45s var(--ease);
}

/* 左：品牌区 */
.auth-brand {
  position: relative;
  padding: 44px 38px;
  background: linear-gradient(160deg, rgba(77, 141, 255, 0.16), rgba(34, 211, 238, 0.08) 50%, transparent);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

/* 装饰：右上斜切光带 */
.auth-brand::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(77, 141, 255, 0.3), transparent 70%);
  filter: blur(40px);
}

.brand-mark {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), #2f6bff);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px var(--accent-glow);
  position: relative;
  z-index: 1;
}

.brand-mark-inner {
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}

.brand-name {
  margin: 20px 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
}

.brand-slogan {
  margin: 0 0 26px;
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
}

.brand-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
  position: relative;
  z-index: 1;
}

.brand-points li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.bp-ico {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  flex: 0 0 auto;
  display: inline-block;
  position: relative;
}

/* 四个功能点用纯 CSS 画小图标，避免依赖外部图标库 */
.bp-live {
  background: rgba(77, 141, 255, 0.2);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.bp-live::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  animation: pulseDot 1.6s ease-in-out infinite;
}

@keyframes pulseDot {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--accent-glow);
  }
  50% {
    box-shadow: 0 0 0 5px transparent;
  }
}

.bp-eye {
  background: rgba(34, 211, 238, 0.18);
  box-shadow: inset 0 0 0 1.5px var(--accent-2);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.bp-stat {
  background: rgba(52, 217, 155, 0.16);
  box-shadow: inset 0 0 0 1.5px var(--win);
}
.bp-stat::after {
  content: '';
  position: absolute;
  left: 5px;
  bottom: 5px;
  width: 3px;
  height: 8px;
  background: var(--win);
  box-shadow: 6px 0 0 var(--win), 3px -4px 0 var(--win);
}

.bp-bot {
  background: rgba(255, 201, 77, 0.16);
  box-shadow: inset 0 0 0 1.5px var(--gold);
  border-radius: 6px;
}
.bp-bot::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  border-top-color: transparent;
}

.brand-foot {
  margin-top: auto;
  padding-top: 28px;
  font-size: 11.5px;
  color: var(--ink-3);
  position: relative;
  z-index: 1;
}

/* 右：表单区 */
.auth-panel {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(7, 11, 22, 0.5);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 26px;
}

.auth-tab {
  flex: 1;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  padding: 9px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.auth-tab.active {
  background: linear-gradient(135deg, var(--accent), #2f6bff);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.fld {
  display: block;
  margin-bottom: 18px;
}

.fld-label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.fld-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.fld-prefix {
  position: absolute;
  left: 14px;
  font-size: 14px;
  color: var(--ink-3);
  pointer-events: none;
  font-weight: 500;
}

.fld-wrap input {
  padding-left: 52px;
}

.fld-dice {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--ink-3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.fld-dice:hover {
  color: var(--accent);
  background: rgba(77, 141, 255, 0.12);
  transform: rotate(-12deg);
}

.auth-tip {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--lose);
  min-height: 20px;
}

.auth-note {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
}

.auth-note svg {
  flex: 0 0 auto;
  color: var(--win);
}

/* ---------------- 大厅 ---------------- */
.lobby {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 22px;
  background: rgba(11, 16, 32, 0.78);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-mark-sm {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #2f6bff);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.brand-title {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* 顶栏房间号搜索 */
.topbar-search {
  flex: 1;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 0 13px;
  background: rgba(7, 11, 22, 0.55);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink-3);
  transition: all 0.18s var(--ease);
}

.topbar-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(77, 141, 255, 0.14);
}

.topbar-search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 0;
  font-size: 14px;
  letter-spacing: 1px;
}

.topbar-search input:focus {
  box-shadow: none;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.me-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 14px 5px 5px;
  background: rgba(7, 11, 22, 0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.me-ava {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.me-name {
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 22px 70px;
}

/* 数据概览条 */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
  margin-bottom: 32px;
}

.stat-card {
  position: relative;
  padding: 17px 20px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s var(--ease);
}

.stat-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

/* 卡片左侧竖向霓虹条 */
.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.stat-card:nth-child(2)::before {
  background: var(--win);
}
.stat-card:nth-child(3)::before {
  background: var(--accent-2);
}
.stat-card:nth-child(4)::before {
  background: var(--gold);
}

.stat-num {
  display: block;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.stat-num.win {
  color: var(--win);
}
.stat-num.rate {
  color: var(--accent-2);
}
.stat-num.streak {
  color: var(--gold);
}

.stat-lbl {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--ink-3);
}

/* 区块标题 */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sec-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 9px;
}

/* 标题左侧发光竖条 */
.sec-title::before {
  content: '';
  width: 4px;
  height: 17px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent-glow);
}

.sec-more {
  font-size: 12.5px;
  color: var(--ink-3);
}

/* 游戏卡片 */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 34px;
}

.game-card {
  position: relative;
  padding: 20px 19px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.24s var(--ease);
  text-align: left;
  font-family: inherit;
  color: inherit;
  overflow: hidden;
}

/* 悬停时从卡片主题色透出的光晕 */
.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--card-glow, transparent), transparent 65%);
  opacity: 0;
  transition: opacity 0.24s var(--ease);
  pointer-events: none;
}

.game-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.game-card:hover::before {
  opacity: 1;
}

.game-card.locked {
  cursor: not-allowed;
  opacity: 0.62;
}

.game-card.locked:hover {
  transform: none;
  box-shadow: none;
}

.game-icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 13px;
  position: relative;
  z-index: 1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.game-name {
  font-size: 15.5px;
  font-weight: 700;
  margin-bottom: 5px;
  position: relative;
  z-index: 1;
}

.game-desc {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.55;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  min-height: 38px;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.gm-tag {
  font-size: 11px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 6px;
}

.gm-tag.soon {
  color: var(--gold);
  border-color: rgba(255, 201, 77, 0.35);
  background: rgba(255, 201, 77, 0.1);
}

.gm-tag.hot {
  color: var(--accent-2);
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.1);
}

/* 广告位 */
.ad-slot {
  position: relative;
  height: 116px;
  margin-bottom: 34px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.014),
    rgba(255, 255, 255, 0.014) 12px,
    transparent 12px,
    transparent 24px
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.ad-tag {
  font-size: 13.5px;
  color: var(--ink-3);
  letter-spacing: 5px;
}

.ad-sub {
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 3px;
  opacity: 0.6;
}

/* 排行榜 */
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 13px;
}

.tab {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-hi);
  color: var(--ink-2);
  font-size: 13px;
  font-family: inherit;
  padding: 7px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.tab:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.tab.active {
  background: rgba(77, 141, 255, 0.16);
  border-color: var(--accent);
  color: var(--accent);
}

.board-panel {
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.board-row {
  display: grid;
  grid-template-columns: 46px 1fr 58px 58px 58px;
  gap: 10px;
  padding: 12px 18px;
  font-size: 13.5px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  align-items: center;
  transition: background 0.15s ease;
}

.board-row:last-child {
  border-bottom: none;
}

.board-row:not(.head):hover {
  background: rgba(255, 255, 255, 0.035);
}

.board-row.head {
  background: rgba(7, 11, 22, 0.4);
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.5px;
}

.board-row .rank {
  font-weight: 800;
  font-size: 15px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.board-row .rank.top1 {
  color: var(--gold);
}
.board-row .rank.top2 {
  color: #cfd8e8;
}
.board-row .rank.top3 {
  color: #e09a5f;
}

.board-row .val {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.board-row .val.w {
  color: var(--win);
}

.board-row .val.l {
  color: var(--lose);
}

.board-empty {
  padding: 30px 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-3);
}

/* 战绩弹层行 */
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-row .g {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14.5px;
  color: var(--ink);
  font-weight: 500;
}

.stat-row .g-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex: 0 0 auto;
}

.stat-row .nums {
  display: flex;
  gap: 13px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.stat-row .nums .w {
  color: var(--win);
  font-weight: 600;
}

.stat-row .nums .l {
  color: var(--lose);
  font-weight: 600;
}

/* 房间列表 */
.room-list {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 34px;
}

.room-row {
  display: grid;
  grid-template-columns: 42px 90px 1fr 74px 110px 70px;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-2);
  transition: background 0.15s ease;
}

.room-row:last-child {
  border-bottom: none;
}

.room-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.room-game-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.room-cell-id b {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-size: 14px;
}

.room-cell-players {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-status {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 6px;
  text-align: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}

.room-status.playing {
  color: var(--win);
  border-color: rgba(52, 217, 155, 0.35);
  background: rgba(52, 217, 155, 0.1);
}

.room-spec {
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
}

.room-spec.off {
  color: var(--lose);
}

.room-row .btn {
  grid-column: auto;
}

/* 观战开关 */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  background: rgba(7, 11, 22, 0.4);
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  margin-bottom: 16px;
}

.switch-title {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}

.switch-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 3px;
}

.switch {
  appearance: none;
  width: 44px;
  height: 25px;
  background: rgba(108, 125, 158, 0.4);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex: 0 0 auto;
}

.switch::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s var(--ease);
}

.switch:checked {
  background: linear-gradient(135deg, var(--accent), #2f6bff);
}

.switch:checked::after {
  transform: translateX(19px);
}

/* 建房弹窗窄一点 */
.create-card {
  max-width: 430px;
}

@media (max-width: 760px) {
  .room-row {
    grid-template-columns: 36px 72px 1fr 60px;
  }

  .room-spec {
    display: none;
  }

  .room-row .btn {
    grid-column: span 1;
  }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 820px) {
  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .auth-brand {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 32px 28px 26px;
  }

  .brand-points {
    display: none;
  }

  .brand-foot {
    padding-top: 16px;
  }

  .auth-panel {
    padding: 30px 28px;
  }

  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .board-row {
    grid-template-columns: 36px 1fr 44px 44px 44px;
    font-size: 12.5px;
    padding: 11px 14px;
  }
}
