* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #12131a;
  color: #f2f2f5;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
#app { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; min-height: 100%; }

h1 { font-size: 30px; text-align: center; margin: 14px 0 4px; }
.sub { text-align: center; color: #9aa0b0; font-size: 13px; margin-bottom: 18px; }
h2 { font-size: 20px; margin: 12px 0 10px; text-align: center; }

input {
  width: 100%; padding: 15px; font-size: 19px; border-radius: 12px;
  border: 1px solid #2c2f3f; background: #1b1d28; color: #fff;
  margin-bottom: 12px; text-align: center; outline: none;
}
button {
  width: 100%; padding: 15px; font-size: 19px; border: none; border-radius: 12px;
  background: #f5b942; color: #231c07; font-weight: 700; margin-bottom: 10px;
}
button.sec { background: #2c2f3f; color: #e8eaf2; }
button.dan { background: #d9534f; color: #fff; }
button:disabled { opacity: .35; }
.row { display: flex; gap: 10px; }
.row button { margin-bottom: 0; }

.box { background: #1b1d28; border: 1px solid #2c2f3f; border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.err { color: #ff8080; text-align: center; margin-bottom: 10px; font-size: 14px; }
.mut { color: #9aa0b0; font-size: 13px; }
.center { text-align: center; }

/* 大厅 */
.roomcode { font-size: 44px; font-weight: 800; letter-spacing: 8px; text-align: center; color: #f5b942; margin: 4px 0 2px; }
.qr { display: block; width: 190px; height: 190px; margin: 10px auto; border-radius: 10px; background: #fff; padding: 6px; }
.plist { list-style: none; }
.plist li {
  display: flex; align-items: center; gap: 8px; padding: 9px 4px;
  border-bottom: 1px solid #262a3a; font-size: 17px;
}
.plist li:last-child { border-bottom: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #3ad06e; flex: none; }
.dot.off { background: #555; }
.me { color: #f5b942; font-size: 13px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid button { margin: 0; padding: 18px 6px; font-size: 18px; }

/* 扑克牌 */
.card {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 54px; height: 76px; background: #fff; color: #16161d; border-radius: 8px;
  margin: 3px; box-shadow: 0 2px 6px rgba(0,0,0,.5); font-weight: 800; flex: none;
}
.card b { font-size: 21px; line-height: 1.1; }
.card i { font-style: normal; font-size: 19px; }
.card.red { color: #d33; }
.card.back {
  background: repeating-linear-gradient(45deg, #3b4a8c, #3b4a8c 6px, #2e3a6e 6px, #2e3a6e 12px);
  color: #ffd76e; font-size: 24px;
}
.card.xl { width: 110px; height: 154px; border-radius: 14px; }
.card.xl b { font-size: 44px; }
.card.xl i { font-size: 38px; }
.cards { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }

/* 小姐牌 */
.rule { font-size: 20px; line-height: 1.6; text-align: center; margin: 12px 0; color: #ffd76e; }
.turn { text-align: center; font-size: 17px; margin: 8px 0 12px; }
.turn b { color: #f5b942; }

/* 横幅结果 */
.banner {
  background: linear-gradient(135deg, #f5b942, #e8890c); color: #231c07;
  font-size: 21px; font-weight: 800; text-align: center;
  border-radius: 14px; padding: 14px; margin: 12px 0;
}
.banner.red { background: linear-gradient(135deg, #e74c3c, #c0392b); color: #fff; }

/* 玩家行（游戏内） */
.prow {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 4px; border-bottom: 1px solid #262a3a; font-size: 16px;
}
.prow:last-child { border-bottom: none; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 8px; background: #2c2f3f; color: #9aa0b0; }
.tag.gold { background: #f5b942; color: #231c07; font-weight: 700; }
.tag.red { background: #d9534f; color: #fff; font-weight: 700; }
.tag.green { background: #2e7d4f; color: #fff; }
.tag.drink { background: #5a3a12; color: #f5b942; font-weight: 700; }

/* 摊牌排名行：名字+牌型固定一列，牌缩到与行同高并纵向对齐，方便对比 */
.rrow { display: flex; align-items: center; gap: 8px; padding: 9px 2px;
  border-bottom: 1px solid #262a3a; font-size: 16px; }
.rrow:last-child { border-bottom: none; }
.rhead { flex: 0 0 88px; display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; }
.rhead .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rhead .tag { flex: none; }
.rankcards { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.rright { flex: 0 1 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; }
.rrow > .tag.drink { flex: none; }
.card.rk { width: 26px; height: 36px; border-radius: 5px; margin: 0; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.card.rk b { font-size: 12px; line-height: 1.05; }
.card.rk i { font-size: 11px; line-height: 1.05; }

/* 转盘 */
.wheelwrap { position: relative; width: 290px; height: 290px; margin: 16px auto; }
.pointer {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  z-index: 3; color: #f5b942; font-size: 30px; filter: drop-shadow(0 2px 2px #000);
}
.wheel {
  position: absolute; inset: 0; border-radius: 50%; border: 6px solid #f5b942;
  overflow: hidden; transition: transform 4.2s cubic-bezier(.12,.8,.16,1);
  background: conic-gradient(#e74c3c 0 30deg,#f39c12 30deg 60deg,#2ecc71 60deg 90deg,#3498db 90deg 120deg,#9b59b6 120deg 150deg,#e67e22 150deg 180deg,#1abc9c 180deg 210deg,#e74c3c 210deg 240deg,#f1c40f 240deg 270deg,#3498db 270deg 300deg,#e91e63 300deg 330deg,#8e44ad 330deg 360deg);
}
.wheel .wl { position: absolute; inset: 0; display: flex; justify-content: center; }
.wheel .wl span { margin-top: 12px; font-size: 14px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px #000; }
.hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 56px; height: 56px; border-radius: 50%; background: #1b1d28;
  border: 3px solid #f5b942; z-index: 2; display: flex; align-items: center;
  justify-content: center; font-size: 24px;
}

/* 真心话 */
.qcard {
  background: #23263a; border: 1px solid #3a3f5c; border-radius: 14px;
  padding: 22px 16px; font-size: 22px; line-height: 1.6; text-align: center; margin: 14px 0;
}
.pickname { font-size: 34px; font-weight: 800; text-align: center; color: #f5b942; margin: 10px 0; }

/* 底部导航条 */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.topbar .t { font-size: 17px; font-weight: 700; }
.topbar button { width: auto; padding: 7px 14px; font-size: 14px; margin: 0; }

/* 德州发牌动画 */
@keyframes flipIn { from { transform: perspective(500px) rotateY(90deg); opacity: .3; } to { transform: none; opacity: 1; } }
.deal { animation: flipIn .35s both; display: inline-flex; }
/* 切牌：牌背从上方牌堆落进下方切牌区 */
@keyframes burnFly {
  0% { opacity: 0; transform: translate(0, -54px) rotate(-5deg) scale(.95); }
  20% { opacity: 1; }
  80% { opacity: 1; transform: translate(30px, 58px) rotate(7deg) scale(.62); }
  100% { opacity: 0; transform: translate(30px, 58px) rotate(7deg) scale(.62); }
}
.burnfly { position: absolute; left: 50%; top: 50%; margin: -38px 0 0 -27px; z-index: 5; animation: burnFly .7s both; pointer-events: none; }
.miniback { display: inline-block; width: 16px; height: 22px; border-radius: 3px; margin-left: -7px; vertical-align: middle;
  background: repeating-linear-gradient(45deg, #3b4a8c, #3b4a8c 3px, #2e3a6e 3px, #2e3a6e 6px); border: 1px solid #1d2547; }
.burnrow { margin-top: 8px; font-size: 12px; color: #9aa0b0; }
.rel { position: relative; }

/* 公共牌槽位与发牌动画 */
.slot { display: inline-block; width: 54px; height: 76px; border: 2px dashed #3a3f5c; border-radius: 8px; box-sizing: border-box; }
.dealwrap { position: relative; display: inline-flex; }
/* 发牌：牌背在槽位原地淡入、停顿、翻走 */
@keyframes slideHold {
  0% { transform: none; opacity: 0; }
  14% { opacity: 1; }
  70% { transform: perspective(500px) rotateY(0deg); opacity: 1; }
  90% { transform: perspective(500px) rotateY(90deg); opacity: 1; }
  100% { transform: perspective(500px) rotateY(90deg); opacity: 0; }
}
.dealback { position: absolute; inset: 0; border-radius: 8px; z-index: 2; opacity: 0;
  background: repeating-linear-gradient(45deg, #3b4a8c, #3b4a8c 6px, #2e3a6e 6px, #2e3a6e 12px);
  animation: slideHold 1.4s both; animation-delay: var(--d, 0s); }
@keyframes flipInFront {
  0% { transform: perspective(500px) rotateY(-90deg); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.dealwrap .card { animation: flipInFront .4s both; animation-delay: calc(var(--d, 0s) + 1.0s); }

/* 水鱼选中高亮 */
.card.selected { outline: 3px solid #ffd54f; box-shadow: 0 0 12px #ffd54f; }

/* 水鱼中号牌：一行4张不超出手机屏幕 */
.card.sy { width: 60px; height: 84px; margin: 0 2px; }
.card.sy b { font-size: 22px; }
.card.sy i { font-size: 20px; }

/* 炸金花扇形手牌 */
.fanhand { display: flex; justify-content: center; align-items: flex-end; height: 118px; margin: 10px 0 2px; }
.fanhand .card { width: 66px; height: 92px; border-radius: 9px; margin: 0 -15px; position: relative;
  box-shadow: 0 4px 14px rgba(0,0,0,.55); transform-origin: 50% 135%; }
.fanhand .card b { font-size: 26px; }
.fanhand .card i { font-size: 24px; }
.fanhand .card:nth-child(1) { transform: rotate(-16deg) translateY(10px); z-index: 1; }
.fanhand .card:nth-child(2) { transform: rotate(0deg) translateY(-5px); z-index: 2; }
.fanhand .card:nth-child(3) { transform: rotate(16deg) translateY(10px); z-index: 3; }
.fanhand .card:active { transform: translateY(-14px) scale(1.06); z-index: 9; }
.fanhand .card:nth-child(1):active { transform: rotate(-16deg) translateY(-8px) scale(1.06); }
.fanhand .card:nth-child(3):active { transform: rotate(16deg) translateY(-8px) scale(1.06); }

/* 梦幻金花：鬼牌/广告牌/幻想牌 */
.card.joker { background: linear-gradient(160deg, #fff8e1, #ffe082); border: 2px solid #ffb300; color: #6d4c00; }
.card.joker b { color: #d84315; }
.card.ad { background: #fff; overflow: hidden; padding: 0; }
.card.ad img { width: 100%; height: 72%; object-fit: cover; display: block; }
.card.ad b { display: block; text-align: center; color: #c62828; font-size: 13px; line-height: 1.4; }
.card.dreamback { background: linear-gradient(135deg, #7b1fa2, #e91e63, #ff9800); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700;
  border: 2px dashed rgba(255,255,255,.8); animation: dreamGlow 1.6s ease-in-out infinite; }
@keyframes dreamGlow { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
.dctag { display: inline-block; margin-left: 6px; font-size: 12px; color: #ce93d8; }

/* 梦幻金花对战 */
.bout { border-top: 1px dashed rgba(255,255,255,.15); padding: 10px 0; }
.boutRow { display: flex; align-items: center; justify-content: space-around; gap: 8px; }
.boutSide { text-align: center; flex: 1; }
.boutName { font-weight: 700; margin-bottom: 4px; }
.boutCat { color: #ffd54f; font-weight: 700; margin-top: 4px; }
.boutVs { font-size: 20px; font-weight: 900; color: #ff7043; }
.boutPub { text-align: center; margin-top: 8px; color: #b0bec5; font-size: 13px; }
.boutPub .card { width: 34px; height: 46px; vertical-align: middle; }
.boutPub .card b { font-size: 14px; } .boutPub .card i { font-size: 13px; }
.boutPub .tag { vertical-align: middle; margin-left: 4px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btnrow .dan { flex: 1; min-width: 100px; }

/* 德州下注按钮：手机上要一屏放下（3列网格，弃牌独占一行） */
.betgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.betgrid button { margin: 0; padding: 12px 4px; font-size: 15px; border-radius: 10px; line-height: 1.2; }
.betgrid .wide { grid-column: 1 / -1; padding: 9px 4px; font-size: 14px; }
button.btn-s { padding: 10px; font-size: 15px; }
@media (max-width: 390px) {
  .betgrid { gap: 6px; }
  .betgrid button { font-size: 13.5px; padding: 11px 2px; }
  .betgrid .wide { font-size: 13px; }
}
@media (max-width: 340px) {
  .betgrid button { font-size: 12.5px; padding: 10px 1px; }
}

