/**
 * U5红中麻将 · V3 皇家青玉回纹流金 3D 俯视麻将桌大厅独立样式表 (lobby.css)
 * - 轻量化纯 CSS 硬件加速绘制，0 额外大图开销，职责单一不扎堆
 */

.lobby-view {
  position: absolute;
  inset: 0;
  z-index: 65;
  display: none;
  flex-direction: column;
  padding-top: max(8px, env(safe-area-inset-top));
  padding-bottom: max(0px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 15%, rgba(28, 108, 84, 0.35), transparent 60%),
    linear-gradient(180deg, #06231c 0%, #093026 48%, #051e17 100%);
  color: #f7eed6;
  user-select: none;
  overflow: hidden;
}

#app.in-lobby .lobby-view {
  display: flex;
}

#app.in-lobby > .topbar,
#app.in-lobby > .stage,
#app.in-lobby > .bottom-nav {
  visibility: hidden;
  pointer-events: none;
}

/* ============================================================================
   1. 顶栏：左上头像筹码 + 中央「红中麻将」青玉金匾 + 右侧建房/加入按钮
   ============================================================================ */
.lt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 8px;
  gap: 6px;
  flex: 0 0 auto;
}

.lt-user-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(16, 62, 49, 0.92), rgba(7, 33, 25, 0.95));
  border: 1.2px solid #d5b25e;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.55);
}

.lt-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #f2d279;
  overflow: hidden;
  background: #134a3a;
  flex-shrink: 0;
}

.lt-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lt-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.lt-user-meta b {
  font-size: 12px;
  color: #fff6df;
  font-weight: 700;
}

.lt-user-meta span {
  font-size: 11px;
  color: #ffd96a;
  font-weight: 800;
}

.lt-user-meta span i {
  color: #f5b935;
  font-style: normal;
}

.lt-brand-plaque {
  padding: 6px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #1b6b54 0%, #0d4334 100%);
  border: 2px solid #ecc96e;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 0 2px #092c22,
    0 5px 14px rgba(0, 0, 0, 0.65);
  text-align: center;
  flex-shrink: 0;
}

.lt-brand-plaque span {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: linear-gradient(180deg, #fff6d1 0%, #f1c359 60%, #c89128 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6));
}

.lt-top-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.lt-top-btn {
  padding: 6px 9px;
  border-radius: 999px;
  border: 1.3px solid #e2be66;
  background: linear-gradient(180deg, #1b6550 0%, #0d3d2f 100%);
  color: #f8e5a6;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.lt-top-btn:active {
  transform: scale(0.96);
}

/* ============================================================================
   2. 双层分类筛选栏（底分场次 Tab + 四人/三人模式 + 仅看空位 + 快速入座）
   ============================================================================ */
.lt-tier-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 10px 6px;
  padding: 3px 5px;
  border-radius: 999px;
  background: rgba(6, 30, 23, 0.85);
  border: 1px solid rgba(215, 179, 96, 0.38);
  flex: 0 0 auto;
}

.lt-tier-tab {
  flex: 1;
  padding: 5px 4px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #d6c89f;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.lt-tier-tab.active {
  background: linear-gradient(180deg, #fae29c 0%, #d8a642 100%);
  color: #261703;
  box-shadow: 0 2px 8px rgba(235, 187, 82, 0.45);
}

.lt-sub-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 6px;
  gap: 8px;
  flex: 0 0 auto;
}

.lt-mode-pills {
  display: flex;
  gap: 6px;
}

.lt-mode-pill {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(212, 176, 94, 0.45);
  background: rgba(13, 52, 41, 0.78);
  color: #dfd0a8;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.lt-mode-pill.active {
  border-color: #f3cf73;
  background: linear-gradient(180deg, #24785e, #124838);
  color: #ffe89e;
  box-shadow: 0 0 8px rgba(84, 224, 172, 0.3);
}

.lt-vacant-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #dfd0a8;
  cursor: pointer;
}

.lt-vacant-check input {
  accent-color: #e6b84f;
  width: 14px;
  height: 14px;
}

.lt-quick-btn {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1.2px solid #fff0b8;
  background: linear-gradient(180deg, #fbe298 0%, #d49c35 100%);
  color: #291802;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.45);
}

/* ============================================================================
   3. 主视区：2列 × 多行可滚动的「青玉护角 + 24K 回纹流金 3D 俯视麻将桌」网格
   ============================================================================ */
.lt-grid-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px 18px;
  scrollbar-width: thin;
  scrollbar-color: #d9b158 rgba(8, 36, 28, 0.5);
}

.lt-grid-scroll::-webkit-scrollbar {
  width: 5px;
}

.lt-grid-scroll::-webkit-scrollbar-track {
  background: rgba(8, 36, 28, 0.4);
  border-radius: 4px;
}

.lt-grid-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #f3d27a, #b88728);
  border-radius: 4px;
}

.lt-table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 26px;
  padding: 6px 4px;
}

.lt-card {
  position: relative;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  transition: transform 0.16s ease;
}

.lt-card:active {
  transform: scale(0.97);
}

/* 青玉护角 + 24K 回纹流金麻将桌主体 */
.lt-table-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  padding: 10px;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(120, 82, 16, 0.22) 0px,
      rgba(120, 82, 16, 0.22) 4px,
      transparent 4px,
      transparent 8px
    ),
    linear-gradient(135deg, #f5d680 0%, #c89636 50%, #e8c367 100%);
  border: 2px solid #fbe39c;
  box-shadow:
    inset 0 0 0 2px #7a5310,
    0 10px 20px rgba(0, 0, 0, 0.65);
}

/* 四角温润青玉雕花包角 */
.lt-jade-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  background: radial-gradient(circle at 40% 40%, #9be3c2 0%, #4ca984 55%, #276c51 100%);
  border: 1.5px solid #f2d278;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), 0 2px 4px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.lt-jade-corner.jc-tl { top: -2px; left: -2px; border-radius: 20px 4px 12px 4px; }
.lt-jade-corner.jc-tr { top: -2px; right: -2px; border-radius: 4px 20px 4px 12px; }
.lt-jade-corner.jc-bl { bottom: -2px; left: -2px; border-radius: 4px 12px 4px 20px; }
.lt-jade-corner.jc-br { bottom: -2px; right: -2px; border-radius: 12px 4px 20px 4px; }

/* 丝绒皇家翡翠桌面 */
.lt-felt {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 50%, #145341 0%, #093024 75%, #052018 100%);
  border: 1.5px solid #967026;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 桌面四方微缩双层翠绿麻将牌墙 */
.lt-mini-walls {
  position: absolute;
  inset: 7px;
  pointer-events: none;
}

.lt-mw {
  position: absolute;
  display: flex;
  gap: 1px;
}

.lt-mw i {
  display: block;
  background: linear-gradient(180deg, #43b579 0%, #247c4e 68%, #d9eadf 70%, #206b43 100%);
  border: 0.5px solid rgba(15, 55, 35, 0.85);
  border-radius: 1.5px;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.55);
}

.lt-mw-n,
.lt-mw-s {
  left: 16%;
  right: 16%;
  justify-content: center;
}

.lt-mw-n { top: 2px; }
.lt-mw-s { bottom: 2px; }

.lt-mw-n i,
.lt-mw-s i {
  width: 11px;
  height: 8px;
}

.lt-mw-w,
.lt-mw-e {
  top: 16%;
  bottom: 16%;
  flex-direction: column;
  justify-content: center;
}

.lt-mw-w { left: 2px; }
.lt-mw-e { right: 2px; }

.lt-mw-w i,
.lt-mw-e i {
  width: 8px;
  height: 11px;
}

.lt-mini-die {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
  background: radial-gradient(circle at 30% 30%, #fff7d6, #d9a73c);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.lt-die-tr { top: 15px; right: 17px; }
.lt-die-bl { bottom: 15px; left: 17px; }

/* 桌心流金翡翠罗盘底座 */
.lt-compass {
  position: relative;
  z-index: 2;
  width: 74%;
  padding: 7px 4px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 25%, rgba(44, 138, 108, 0.45), transparent 70%),
    linear-gradient(180deg, rgba(8, 38, 29, 0.95), rgba(4, 23, 18, 0.98));
  border: 2px solid #e6c165;
  box-shadow:
    inset 0 0 8px rgba(242, 206, 114, 0.25),
    0 4px 12px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}

.lt-room-no {
  font-size: 13px;
  font-weight: 800;
  color: #fff6dc;
  letter-spacing: 0.3px;
}

.lt-room-rule {
  font-size: 10.5px;
  color: #ebd59d;
  font-weight: 600;
  white-space: nowrap;
}

.lt-room-status {
  margin-top: 2px;
  padding: 1.5px 8px;
  border-radius: 999px;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.lt-room-status.pill-vacant {
  background: linear-gradient(180deg, #217b5d, #114c38);
  border: 1px solid #66d9ae;
  color: #d6ffef;
}

.lt-room-status.pill-playing {
  background: linear-gradient(180deg, #983228, #5e1912);
  border: 1px solid #f08a7b;
  color: #ffe2dc;
}

/* ============================================================================
   4. 四条边正中央（上/下/左/右）的圆形人物头像与「+」号入座圆槽
   ============================================================================ */
.lt-side-seat {
  position: absolute;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.lt-side-top {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
}

.lt-side-bottom {
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
}

.lt-side-left {
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
}

.lt-side-right {
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
}

.lt-side-seat.is-occupied .lt-avatar-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #f6d57a;
  background: #144d3c;
  box-shadow:
    0 0 0 1.5px #092b21,
    0 4px 8px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.lt-side-seat.is-occupied img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lt-online-dot {
  position: absolute;
  right: -1px;
  bottom: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #35f28b;
  border: 1.5px solid #06241b;
  box-shadow: 0 0 5px #35f28b;
}

.lt-side-seat.is-vacant {
  border: 1.5px solid rgba(232, 194, 103, 0.72);
  background: radial-gradient(circle at 50% 35%, rgba(22, 85, 66, 0.92), rgba(7, 36, 28, 0.96));
  color: #f3ce71;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.lt-side-seat.is-vacant:hover {
  border-color: #ffe89e;
  transform: scale(1.06);
}

.lt-side-top.is-vacant:hover,
.lt-side-bottom.is-vacant:hover {
  transform: translateX(-50%) scale(1.06);
}

.lt-side-left.is-vacant:hover,
.lt-side-right.is-vacant:hover {
  transform: translateY(-50%) scale(1.06);
}

.lt-plus-icon {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

/* ============================================================================
   5. 底部五格青玉流金导航栏 & 弹窗按钮辅助
   ============================================================================ */
.lt-bottom-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 56px;
  flex: 0 0 56px;
  background: linear-gradient(180deg, #124838 0%, #07261d 100%);
  border-top: 2px solid #dfba61;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.65);
}

.lt-nav-item {
  border: none;
  background: transparent;
  color: #d6c598;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
}

.lt-nav-item .lt-ico {
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  color: #ecc668;
}

.lt-nav-item span {
  font-size: 11px;
  font-weight: 700;
}

.lt-nav-item.active {
  background: radial-gradient(circle at 50% 100%, rgba(242, 204, 107, 0.28), transparent 70%);
  color: #fff2c2;
}

.lt-modal-submit {
  width: 100%;
  margin-top: 14px;
  padding: 11px;
  border-radius: 999px;
  border: 1.5px solid #fff0b8;
  background: linear-gradient(180deg, #fbe298 0%, #d49c35 100%);
  color: #291802;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.lt-code-input {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #dfba61;
  background: rgba(5, 25, 19, 0.9);
  color: #fff4cf;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 4px;
  text-align: center;
}

.lt-empty-tip {
  grid-column: 1 / -1;
  padding: 36px 16px;
  text-align: center;
  color: #cbb98a;
  font-size: 13px;
}
