* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: #12161d;
  color: #dfe6ee;
  font: 14px/1.5 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
button { font-family: inherit; border: 0; cursor: pointer; background: none; color: inherit; }
button:disabled { cursor: default; opacity: .5; }
input {
  font-family: inherit; outline: 0;
  border: 1px solid #2a3442; background: #141a22; color: #dfe6ee;
  border-radius: 4px; padding: 10px 12px;
}
input:focus { border-color: #f5b942; }

/* ===== 顶栏 ===== */
.top {
  display: flex; align-items: center; gap: 14px;
  height: 52px; padding: 0 16px;
  border-bottom: 1px solid #222b37;
  position: sticky; top: 0; background: #12161d; z-index: 5;
}
.logo { font-weight: 700; font-size: 15px; color: #f5b942; white-space: nowrap; }
.hist { flex: 1; display: flex; gap: 6px; overflow: hidden; }
.hist i {
  flex: none; font-style: normal; font-size: 12px;
  padding: 2px 7px; border-radius: 3px;
  background: #1b2330; color: #7d8b9d;
}
.hist i.hi { color: #43d477; }
.hist i.lo { color: #e05555; }
.wallet { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.wallet .coin { width: 13px; height: 13px; border-radius: 50%; background: #f5b942; }
.wallet b { color: #f5b942; }
.logout { color: #68758a; font-size: 12px; }

/* ===== 布局 ===== */
.wrap {
  display: flex; gap: 14px; align-items: flex-start;
  max-width: 1080px; margin: 0 auto; padding: 14px;
}
.stage-col { flex: 1; min-width: 0; }
.side { width: 300px; flex: none; display: flex; flex-direction: column; gap: 14px; }

/* ===== 舞台 ===== */
.stage {
  position: relative; height: 400px;
  background: #0d1117; border: 1px solid #222b37; border-radius: 6px;
  overflow: hidden;
}
.stage canvas { display: block; width: 100%; height: 100%; }
.mult {
  position: absolute; left: 0; right: 0; top: 32%;
  text-align: center; font-size: 56px; font-weight: 800; color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
  pointer-events: none; font-variant-numeric: tabular-nums;
}
.mult.crash { color: #e05555; }
.tip {
  position: absolute; left: 0; right: 0; top: calc(32% + 72px);
  text-align: center; color: #9aa7b8; font-size: 15px; pointer-events: none;
}
.tip .big { font-size: 34px; font-weight: 700; color: #fff; }
.tip .big.danger { color: #e05555; }
.float {
  position: absolute; left: 0; right: 0; top: 18%;
  text-align: center; font-size: 22px; font-weight: 700; color: #43d477;
  opacity: 0; pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
}
.float.go { animation: rise 1.4s ease-out; }
@keyframes rise {
  0%   { opacity: 0; transform: translateY(14px); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-34px); }
}

/* ===== 本局玩家 ===== */
.players {
  margin-top: 14px; padding: 10px 12px;
  background: #171d26; border: 1px solid #222b37; border-radius: 6px;
}
.phead, .prow { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.phead { color: #68758a; font-size: 12px; border-bottom: 1px solid #222b37; }
.pname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pamt { width: 84px; text-align: right; color: #c6d0dd; }
.pst { width: 118px; text-align: right; font-weight: 700; }
.pst.win { color: #43d477; }
.pst.lose { color: #e05555; }
.pst.fly { color: #f5b942; font-weight: 400; }
.empty { color: #5d6a7d; text-align: center; padding: 12px 0; }

/* ===== 右侧面板 ===== */
.panel {
  background: #171d26; border: 1px solid #222b37;
  border-radius: 6px; padding: 14px;
}
.pt { font-size: 13px; color: #8b98a9; margin-bottom: 10px; }
.panel input[type=number] { width: 100%; font-size: 16px; font-weight: 700; }
.chips { display: flex; gap: 6px; margin-top: 8px; }
.chips button {
  flex: 1; padding: 6px 0; border-radius: 4px;
  background: #20293a; color: #b9c4d4; font-size: 12px;
}
.chips button:hover { background: #283349; }
.btn-main {
  width: 100%; margin-top: 12px; padding: 12px 0;
  font-size: 16px; font-weight: 700; border-radius: 4px;
  background: #f5b942; color: #201806;
}
.btn-main:active { transform: translateY(1px); }
.btn-main.cash { background: #2fbf67; color: #07230f; }
.hint { margin-top: 10px; font-size: 12px; color: #68758a; min-height: 16px; line-height: 1.6; }
.hint.err { color: #e05555; }

.mh-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; color: #9aa7b8; }
.mh-row .win { color: #43d477; }
.mh-row .lose { color: #e05555; }

/* ===== 登录层 ===== */
.auth-mask {
  position: fixed; inset: 0; z-index: 10;
  background: #12161d;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.auth-box {
  width: 320px; max-width: 100%;
  background: #171d26; border: 1px solid #242e3b; border-radius: 8px;
  padding: 26px 24px;
}
.auth-title { font-size: 20px; font-weight: 800; color: #f5b942; text-align: center; }
.auth-sub { color: #8b98a9; font-size: 13px; text-align: center; margin: 8px 0 18px; }
.auth-box input { width: 100%; margin-bottom: 10px; }
.auth-row { display: flex; gap: 8px; margin-top: 10px; }
.auth-row button {
  flex: 1; padding: 9px 0; border-radius: 4px;
  background: #20293a; color: #b9c4d4; font-size: 13px;
}
.a-msg { margin-top: 10px; color: #e05555; font-size: 13px; min-height: 18px; text-align: center; }

/* ===== 响应式 ===== */
@media (max-width: 880px) {
  .wrap { flex-direction: column; padding: 10px; gap: 10px; }
  .side { width: 100%; flex-direction: row; }
  .side .panel { flex: 1; }
  .stage { height: 300px; }
  .mult { font-size: 44px; }
  .tip { top: calc(32% + 60px); }
  .top { gap: 10px; padding: 0 12px; }
  .hist { overflow-x: auto; scrollbar-width: none; }
  .hist::-webkit-scrollbar { display: none; }
  .players { max-height: 200px; overflow-y: auto; margin-top: 10px; }
}
@media (max-width: 560px) {
  .side { flex-direction: column; }
  .stage { height: 240px; }
  .mult { font-size: 40px; }
  .top { height: 46px; }
  .players { max-height: 150px; }
  .btn-main { margin-top: 10px; padding: 11px 0; }
  .chips button { padding: 8px 0; }
  .panel { padding: 12px; }
  .pamt { width: 64px; }
  .pst { width: 96px; }
}
