:root {
  --bg: #04101f;
  --felt1: #1d4f7c;
  --felt2: #0d2a4a;
  --felt3: #081a30;
  --gold: #f2b84b;
  --gold2: #d98a1c;
  --text: #eaf2ff;
  --muted: #8ea6c4;
  --red: #d8323c;
  --green: #38c172;
  --panel: #0f2c4c;
  --panel2: #12365d;
  --line: rgba(255, 255, 255, 0.1);
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --content-top: var(--tg-content-safe-area-inset-top, 0px);
  --vh: var(--tg-viewport-stable-height, 100dvh);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  touch-action: manipulation;
}

input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app {
  position: relative;
  max-width: 520px;
  height: 100dvh;
  min-height: var(--vh);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: calc(var(--safe-top) + var(--content-top));
  padding-bottom: var(--safe-bottom);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 14px, transparent 14px 28px),
    radial-gradient(ellipse at 50% 38%, var(--felt1) 0%, var(--felt2) 55%, var(--felt3) 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.04);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

/* ---------- 顶部 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 4px;
  white-space: nowrap;
  flex: none;
  min-width: 0;
}

.levels,
.roominfo {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
  min-width: 0;
  align-items: center;
}

.roominfo span {
  font-size: 12px;
  color: var(--gold);
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  font-weight: 700;
}

.pill {
  flex: none;
  height: 30px;
  padding: 0 10px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(4, 16, 31, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cfe0f5;
  white-space: nowrap;
}

.pill.small {
  height: 26px;
  padding: 0 8px;
}

.pill.level {
  padding: 0 8px;
}

.pill.level.active {
  background: linear-gradient(180deg, #ffd27a, var(--gold2));
  color: #3a2200;
  border-color: transparent;
}

.pill:disabled {
  opacity: 0.45;
}

.statsbar {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  padding: 2px 8px 4px;
  white-space: nowrap;
  flex: none;
  overflow: hidden;
}

.statsbar b {
  color: var(--gold);
  font-size: 13px;
}

/* ---------- 牌桌 ---------- */
.table {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto 1fr 1fr;
  grid-template-areas:
    'l1 top r1'
    'l1 center r1'
    'l2 center r2';
  padding: 2px 6px;
  gap: 2px;
  position: relative;
}

.pos-top {
  grid-area: top;
}
.pos-l1 {
  grid-area: l1;
  align-self: center;
}
.pos-r1 {
  grid-area: r1;
  align-self: center;
}
.pos-l2 {
  grid-area: l2;
}
.pos-r2 {
  grid-area: r2;
}

.center {
  grid-area: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  min-width: 0;
}

.phase {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  line-height: 1.3;
}

.phase.big {
  font-size: 22px;
  color: var(--gold);
}

.pot {
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
  min-height: 16px;
}

.timer {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  background: conic-gradient(var(--gold) var(--p, 100%), rgba(255, 255, 255, 0.12) 0);
  position: relative;
}

.timer::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #0b2440;
}

.timer span {
  position: relative;
}

.timer.warn span {
  color: #ff6b6b;
}

/* 座位 */
.seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  position: relative;
}

.seat.empty {
  visibility: hidden;
}

.seat .who {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  position: relative;
  flex: none;
  background: linear-gradient(160deg, #4a7bd8, #27407f);
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.big {
  width: 52px;
  height: 52px;
  font-size: 22px;
}

.avatar.c0 { background: linear-gradient(160deg, #4a7bd8, #2a3f8f); }
.avatar.c1 { background: linear-gradient(160deg, #e0508a, #8f1f4f); }
.avatar.c2 { background: linear-gradient(160deg, #3dbb93, #17705a); }
.avatar.c3 { background: linear-gradient(160deg, #d79a3b, #8a5a12); }
.avatar.c4 { background: linear-gradient(160deg, #a65ad8, #5b2a8f); }
.avatar.c5 { background: linear-gradient(160deg, #b6a33a, #6f6212); }

.avatar.banker::after {
  content: '庄';
  position: absolute;
  right: -2px;
  top: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  color: #4a2a00;
  font-size: 11px;
  display: grid;
  place-items: center;
  border: 1px solid #fff4d6;
}

.who.banker .avatar,
.me-info.banker .avatar {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(242, 184, 75, 0.45), 0 3px 8px rgba(0, 0, 0, 0.45);
}

.crown {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--gold);
  color: #4a2a00;
  font-size: 10px;
  font-weight: 900;
  border-radius: 9px;
  padding: 1px 5px;
  border: 1px solid #fff4d6;
  z-index: 2;
}

.seat .name,
.me-info .name {
  font-size: 11px;
  color: #d7e6fa;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bal {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 8px;
  border-radius: 9px;
  min-width: 44px;
  text-align: center;
}

.hand {
  font-size: 13px;
  font-weight: 900;
  min-height: 16px;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}

.hand.good {
  color: var(--gold);
}

.change {
  font-size: 12px;
  font-weight: 900;
  min-height: 14px;
}

.change.win {
  color: #5ee08f;
}

.change.lose {
  color: #ff7b7b;
}

.tag {
  font-size: 10px;
  color: #cfe0f5;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  padding: 0 6px;
  min-height: 14px;
}

.chip {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  background: radial-gradient(circle, #2c6fd6 55%, #fff 56%, #fff 62%, #2c6fd6 63%);
  border: 2px dashed rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.chip.red {
  background: radial-gradient(circle, #d2343e 55%, #fff 56%, #fff 62%, #d2343e 63%);
}

/* 气泡：向下弹 */
.bubble {
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #13325a;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
  z-index: 5;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  animation: bubbleDown 0.28s ease-out;
  pointer-events: none;
}

.bubble::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top: 0;
  border-bottom-color: #fff;
}

@keyframes bubbleDown {
  from {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.85);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

/* ---------- 扑克牌 ---------- */
.cards {
  display: flex;
  justify-content: center;
  min-height: 34px;
}

.card {
  width: 24px;
  height: 34px;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffffff, #e9eef5);
  color: #111;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  border: 1px solid #c9d3df;
  flex: none;
  font-weight: 800;
  overflow: hidden;
}

.cards:not(.big) .card + .card {
  margin-left: -9px;
}

.card .r {
  position: absolute;
  left: 2px;
  top: 1px;
  font-size: 10px;
  line-height: 1;
  letter-spacing: -1px;
}

.card .s {
  position: absolute;
  left: 2px;
  top: 12px;
  font-size: 9px;
  line-height: 1;
}

.card .S {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 12px;
  line-height: 1;
}

.card.red {
  color: var(--red);
}

.card.back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.16) 0 3px, transparent 3px 6px),
    linear-gradient(160deg, #2f6fd0, #173c7a);
  border: 1px solid #a8c4ee;
}

.card.back > * {
  display: none;
}

.card.grp {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.cards.big {
  gap: 5px;
  min-height: 80px;
}

.cards.big .card {
  width: 54px;
  height: 78px;
  border-radius: 6px;
  transition: transform 0.15s;
}

.cards.big .card .r {
  font-size: 19px;
  left: 4px;
  top: 3px;
}

.cards.big .card .s {
  font-size: 15px;
  left: 5px;
  top: 24px;
}

.cards.big .card .S {
  font-size: 26px;
  right: 4px;
  bottom: 3px;
}

.cards.big .card.sel {
  transform: translateY(-10px);
  border-color: #3d8bff;
  box-shadow: 0 0 0 2px #3d8bff, 0 6px 10px rgba(0, 0, 0, 0.4);
}

.deal {
  animation: deal 0.38s cubic-bezier(0.2, 0.8, 0.3, 1) both;
  animation-delay: var(--d, 0ms);
}

@keyframes deal {
  from {
    opacity: 0;
    transform: translate(var(--dx, 0), var(--dy, -120px)) rotate(-25deg) scale(0.6);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.flip {
  animation: flip 0.42s ease both;
  animation-delay: var(--d, 0ms);
}

@keyframes flip {
  0% {
    transform: rotateY(90deg);
  }
  100% {
    transform: rotateY(0);
  }
}

/* ---------- 我的区域 ---------- */
.me {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 4px 8px 4px;
}

.me-info {
  width: 64px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
}

.me-cards {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.me-hand {
  font-size: 13px;
  font-weight: 800;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(242, 184, 75, 0.35);
  border-radius: 12px;
  padding: 2px 10px;
  min-height: 22px;
}

.me-hand:empty {
  visibility: hidden;
}

/* ---------- 操作区 ---------- */
.actions {
  flex: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  min-height: 56px;
  flex-wrap: nowrap;
}

.btn {
  height: 42px;
  padding: 0 14px;
  border-radius: 21px;
  font-weight: 900;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(180deg, #3f86e8, #1f56b0);
  box-shadow: 0 3px 0 #133a78, 0 6px 12px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 0;
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #133a78;
}

.btn.gold {
  background: linear-gradient(180deg, #ffd27a, var(--gold2));
  color: #3a2200;
  box-shadow: 0 3px 0 #8a5300, 0 6px 12px rgba(0, 0, 0, 0.35);
}

.btn.gray {
  background: linear-gradient(180deg, #6b7c93, #46566c);
  box-shadow: 0 3px 0 #2c3848;
}

.btn.wide {
  min-width: 180px;
}

.btn.sm {
  height: 38px;
  padding: 0 10px;
  font-size: 14px;
  flex: 1 1 0;
  max-width: 72px;
}

.btn:disabled {
  opacity: 0.5;
}

/* ---------- 底部导航 ---------- */
.tabs {
  flex: none;
  display: flex;
  border-top: 1px solid var(--line);
  background: rgba(3, 12, 24, 0.75);
}

.tab {
  flex: 1;
  height: 42px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.tab.active {
  color: var(--gold);
}

/* ---------- 弹层 ---------- */
.sheet,
.modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(0, 6, 14, 0.6);
  display: flex;
}

.sheet {
  align-items: flex-end;
}

.sheet-panel {
  width: 100%;
  max-height: 86%;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom);
  animation: up 0.22s ease-out;
}

@keyframes up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}

.sheet-head {
  display: flex;
  align-items: center;
  padding: 12px 14px 6px;
}

.sheet-head h2,
.modal h2 {
  margin: 0;
  font-size: 18px;
  color: var(--gold);
  flex: 1;
}

.x {
  font-size: 26px;
  line-height: 1;
  width: 36px;
  height: 36px;
  color: var(--muted);
}

.sheet-body {
  overflow-y: auto;
  padding: 4px 14px 16px;
  -webkit-overflow-scrolling: touch;
}

.modal {
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-panel {
  width: 100%;
  max-width: 420px;
  max-height: 86%;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border-radius: 16px;
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
}

.modal-body {
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.65;
  color: #d8e6f8;
}

.modal-panel > .btn {
  align-self: center;
  min-width: 150px;
}

.modal-body table,
.list table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.modal-body th,
.modal-body td {
  text-align: left;
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
}

.modal-body th {
  color: var(--gold);
}

.modal-body td:last-child,
.modal-body th:last-child {
  text-align: right;
}

.modal-body ul {
  padding-left: 18px;
  margin: 6px 0;
}

.toast {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translateX(-50%);
  z-index: 40;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  max-width: 84%;
  text-align: center;
  pointer-events: none;
}

.loading {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--muted);
  font-size: 15px;
}

.boot-state {
  max-width: 300px;
  padding: 16px;
  text-align: center;
  line-height: 1.6;
}

.boot-state .btn {
  margin-top: 12px;
}

/* 列表 / 表单 */
.card-row {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.row > * {
  min-width: 0;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.gold {
  color: var(--gold);
}

.win {
  color: #5ee08f;
}

.lose {
  color: #ff7b7b;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
  font-size: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0;
  font-size: 13px;
  color: var(--muted);
}

.field input,
.field select {
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  padding: 0 12px;
  font-size: 16px;
  width: 100%;
}

.seg {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}

.seg button {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.25);
  font-weight: 800;
  font-size: 13px;
  min-width: 0;
}

.seg button.on {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(242, 184, 75, 0.12);
}

.seg button:disabled {
  opacity: 0.4;
}

.copy {
  flex: none;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 700;
}

.subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.subtabs button {
  flex: 1;
  height: 34px;
  border-radius: 17px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.subtabs button.on {
  color: #3a2200;
  background: linear-gradient(180deg, #ffd27a, var(--gold2));
}

.mini-cards {
  display: inline-flex;
  gap: 2px;
  font-size: 12px;
  font-weight: 800;
}

.mini-cards i {
  font-style: normal;
  background: #fff;
  color: #111;
  border-radius: 3px;
  padding: 0 3px;
}

.mini-cards i.red {
  color: var(--red);
}

.empty-tip {
  text-align: center;
  color: var(--muted);
  padding: 24px 0;
  font-size: 13px;
}

@media (max-height: 700px) {
  .avatar {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }
  .avatar.big {
    width: 44px;
    height: 44px;
  }
  .cards.big .card {
    width: 50px;
    height: 70px;
  }
  .cards.big {
    min-height: 72px;
  }
  .statsbar {
    padding-bottom: 0;
  }
  .actions {
    min-height: 50px;
    padding: 4px 8px;
  }
  .tab {
    height: 38px;
  }
}

@media (max-width: 360px) {
  .pill {
    padding: 0 7px;
    font-size: 11px;
  }
  .pill.level {
    padding: 0 6px;
  }
  .cards.big .card {
    width: 48px;
    height: 68px;
  }
  .statsbar {
    gap: 8px;
  }
}

/* ---------- 大厅 ---------- */
.lobby {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 10px 10px;
  -webkit-overflow-scrolling: touch;
}

.lobby-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(4, 16, 31, 0.55);
  border: 1px solid rgba(242, 184, 75, 0.25);
}

.lobby-user .lu-main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.lobby-user .lu-main b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-user .lu-points {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 12px;
}

.lobby-user .lu-points b {
  font-size: 17px;
}

.lobby-user .btn.sm {
  flex: none;
  max-width: none;
}

.lobby-title {
  margin: 14px 2px 8px;
  font-weight: 800;
  font-size: 14px;
  color: var(--gold);
}

.lobby-title .muted {
  font-weight: 400;
  font-size: 12px;
  margin-left: 4px;
}

.lobby-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lobby-levels .lv {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  border-radius: 14px;
  background: linear-gradient(180deg, #2a64b4, #163c74);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 3px 0 #0d2a52;
  min-width: 0;
}

.lobby-levels .lv b {
  font-size: 15px;
  color: #fff;
}

.lobby-levels .lv span {
  font-size: 12px;
  color: var(--gold);
}

.lobby-levels .lv em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

.lobby-levels .lv.low {
  filter: saturate(0.4);
  opacity: 0.75;
}

.lobby-join {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.lobby-join input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border-radius: 19px;
  border: 1px solid var(--line);
  background: rgba(4, 16, 31, 0.6);
  color: var(--text);
  padding: 0 14px;
  text-transform: uppercase;
}

.lobby-join .btn.sm {
  flex: none;
  max-width: none;
}

.lobby-note {
  font-size: 12px;
  color: var(--gold);
  background: rgba(242, 184, 75, 0.1);
  border: 1px solid rgba(242, 184, 75, 0.3);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.room-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(4, 16, 31, 0.5);
  border: 1px solid var(--line);
  font-size: 13px;
}

.room-row .rr-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.room-row .rr-main .muted {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-row .rr-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: none;
}

.room-row .rr-btns .btn.sm {
  height: 32px;
  font-size: 13px;
  max-width: none;
  min-width: 84px;
  flex: none;
}

.app[data-mode='lobby'] .table,
.app[data-mode='lobby'] .me,
.app[data-mode='lobby'] .actions {
  display: none;
}

/* ---------- 观战 ---------- */
.me.spectate .me-info {
  opacity: 0.9;
}

.watch-badge {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: rgba(216, 50, 60, 0.85);
  border-radius: 10px;
  padding: 3px 8px;
}

.need-tip {
  font-size: 12px;
  color: var(--gold);
  white-space: normal;
  line-height: 1.3;
  min-width: 0;
  flex: 1 1 auto;
}

.actions > .muted {
  font-size: 12px;
  white-space: normal;
  text-align: center;
}
