:root {
  --bg: #0f1720;
  --panel: #1a2530;
  --panel-2: #223141;
  --ink: #e8eef5;
  --muted: #93a4b5;
  --accent: #2e9e6b;
  --accent-2: #3b82f6;
  --danger: #e0524d;
  --gold: #e7b94f;
  --felt: #14532d;
  --felt-2: #0f3d20;
  --card-red: #d23b3b;
  --card-black: #1a1a1a;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid #00000033;
}
.brand { font-weight: 700; font-size: 18px; letter-spacing: .5px; }
.conn-status { font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.conn-status.online { background: #1f6f43; color: #d6ffe7; }
.conn-status.offline { background: #5a2730; color: #ffd9dc; }

.container { max-width: 980px; margin: 0 auto; padding: 20px; }

.view.hidden, .hidden { display: none !important; }

/* ---------- 大厅 ---------- */
.lobby-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 680px) { .lobby-grid { grid-template-columns: 1fr; } }
.card {
  background: var(--panel); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 14px; font-size: 18px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input[type=text], input[type=number] {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #ffffff22;
  background: var(--panel-2); color: var(--ink); font-size: 15px;
}
.blind-set { border: 1px solid #ffffff22; border-radius: 8px; margin: 14px 0; padding: 8px 12px; }
.blind-set legend { font-size: 12px; color: var(--muted); padding: 0 6px; }
.blind-set label { display: inline-block; width: 30%; margin: 6px 1%; }
.hint { color: var(--muted); font-size: 13px; text-align: center; margin-top: 18px; }

button {
  cursor: pointer; border: none; border-radius: 8px; font-size: 15px;
  padding: 10px 16px; font-weight: 600; transition: filter .15s, transform .05s;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: not-allowed; }
.primary { background: var(--accent); color: #fff; width: 100%; margin-top: 14px; }
.primary:hover { filter: brightness(1.08); }
.ghost { background: var(--panel-2); color: var(--ink); }
.ghost.danger { color: #ffb4b0; }
.result-box {
  margin-top: 14px; padding: 12px; background: var(--panel-2);
  border-radius: 8px; font-size: 14px; line-height: 1.6;
}
.result-box code {
  background: #00000055; padding: 2px 8px; border-radius: 6px; font-size: 18px;
  letter-spacing: 2px; color: var(--gold); font-weight: 700;
}

/* ---------- 牌桌 ---------- */
.table-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.room-chip { background: var(--panel); padding: 8px 14px; border-radius: 999px; font-size: 14px; }
.room-chip b { color: var(--gold); letter-spacing: 2px; }

.players-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.seat {
  background: var(--panel); border-radius: 10px; padding: 10px 12px; min-width: 130px;
  border: 2px solid transparent; position: relative;
}
.seat.turn { border-color: var(--gold); box-shadow: 0 0 0 3px #e7b94f33; }
.seat.folded { opacity: .45; }
.seat.allin { border-color: var(--danger); }
.seat.me { background: var(--panel-2); }
.seat .name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.seat .chips { color: var(--gold); font-size: 14px; margin-top: 4px; }
.seat .bet { color: var(--muted); font-size: 12px; margin-top: 2px; }
.badge {
  font-size: 11px; padding: 1px 6px; border-radius: 6px; font-weight: 700;
}
.badge.d { background: var(--gold); color: #000; }
.badge.sb { background: #4b6584; color: #fff; }
.badge.bb { background: #3867a8; color: #fff; }
.badge.ai { background: var(--danger); color: #fff; }
.badge.host { background: #6b4ea8; color: #fff; }

.felt {
  background: radial-gradient(ellipse at center, var(--felt) 0%, var(--felt-2) 100%);
  border-radius: 20px; padding: 22px; min-height: 240px; box-shadow: inset 0 0 40px #00000066, var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.board-row { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.street-label { color: #cfe9d8; font-size: 13px; letter-spacing: 1px; }
.community { display: flex; gap: 8px; min-height: 96px; }
.pot {
  background: #00000055; color: var(--gold); padding: 6px 18px; border-radius: 999px;
  font-weight: 700; font-size: 15px;
}
.my-hand { display: flex; gap: 8px; min-height: 96px; }

/* 扑克牌 */
.card-face {
  width: 62px; height: 88px; border-radius: 8px; background: #fff; color: var(--card-black);
  display: flex; flex-direction: column; justify-content: space-between; padding: 6px 8px;
  font-weight: 800; box-shadow: var(--shadow); position: relative; user-select: none;
}
.card-face .corner { font-size: 16px; line-height: 1; }
.card-face .pip { font-size: 30px; text-align: center; }
.card-face.red { color: var(--card-red); }
.card-face.back {
  background: repeating-linear-gradient(45deg, #2a4d8f, #2a4d8f 8px, #3b6fc4 8px, #3b6fc4 16px);
  color: transparent;
}

/* 操作条 */
.controls { margin-top: 16px; }
.host-controls { display: flex; gap: 12px; }
.host-controls .primary { width: auto; margin-top: 0; }
.action-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--panel); padding: 14px; border-radius: var(--radius);
}
.action { min-width: 110px; }
.action.fold { background: #5a2730; color: #ffd9dc; }
.action.call { background: var(--accent-2); color: #fff; }
.action.raise { background: var(--gold); color: #000; }
.raise-box { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 240px; }
.raise-box input[type=range] { flex: 1; }
.raise-amount { color: var(--gold); font-weight: 700; min-width: 54px; text-align: right; }

.result-banner {
  margin-top: 14px; padding: 14px; border-radius: var(--radius);
  background: var(--panel-2); text-align: center; font-size: 15px; line-height: 1.7;
}
.result-banner .winner { color: var(--gold); font-weight: 800; }

/* 聊天 */
.chat { margin-top: 16px; background: var(--panel); border-radius: var(--radius); padding: 12px; }
.chat-log { height: 110px; overflow-y: auto; font-size: 14px; line-height: 1.6; }
.chat-log .who { color: var(--accent-2); font-weight: 700; }
.chat-input-row { display: flex; gap: 8px; margin-top: 8px; }
.chat-input-row input { flex: 1; }

.log-box { margin-top: 14px; background: var(--panel); border-radius: var(--radius); padding: 10px 14px; }
.log-box summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.log-box ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); line-height: 1.7; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: #000000cc; color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; box-shadow: var(--shadow); z-index: 50; max-width: 90vw;
}
