:root {
  --bg1: #0b1512;
  --bg2: #16241d;
  --felt1: #1f6b4a;
  --felt2: #0e3a28;
  --wood1: #8a5a2b;
  --wood2: #4a2e14;
  --gold: #e8c15a;
  --text: #eef2ef;
  --muted: #9db3a8;
  --panel: rgba(255,255,255,.06);
  --panel-border: rgba(255,255,255,.12);
  --tile1: #fdfbf5;
  --tile2: #e8dfc9;
  --tile-border: #c3b795;
  --wan: #c0392b;
  --tiao: #1e7a3c;
  --tong: #1f5fa8;
  --zhong: #b8860b;
  --back1: #2f7a58;
  --back2: #194a33;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body {
  font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  background: radial-gradient(circle at 50% 0%, #16241d, var(--bg1) 62%);
  min-height: 100vh;
  color: var(--text);
  padding: 12px;
}
.gc { max-width: 1180px; margin: 0 auto; padding: 12px 12px 0; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
h1 { font-size: 22px; letter-spacing: 6px; color: var(--gold); font-weight: 700; }
.gi { display: flex; gap: 16px; font-size: 13px; color: var(--muted); align-items: center; }
.gi b { color: var(--text); }
.baopi { color: #ff8f6b; font-weight: 700; }

.log-btn {
  padding: 5px 14px; border: 1px solid var(--panel-border); border-radius: 8px;
  background: var(--panel); color: var(--muted); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.log-btn:hover { background: rgba(255,255,255,.12); color: var(--text); border-color: var(--gold); }
.log-btn:active { transform: scale(.95); }

.log-mdl { max-height: 80vh; display: flex; flex-direction: column; }
.log-mdl .lp { flex: 1; max-height: 55vh; overflow-y: auto; margin-bottom: 14px; text-align: left; }

.rules-mdl { max-height: 80vh; display: flex; flex-direction: column; }
.rules-content { flex: 1; max-height: 60vh; overflow-y: auto; margin-bottom: 14px; text-align: left; }
.rules-content h3 { color: var(--gold); font-size: 15px; margin: 18px 0 8px; letter-spacing: 1px; }
.rules-content h3:first-child { margin-top: 0; }
.rules-content p { margin: 0 0 8px; line-height: 1.7; color: #ccc; font-size: 14px; }
.rules-content ul { margin: 0 0 10px; padding-left: 20px; }
.rules-content li { margin-bottom: 6px; line-height: 1.6; color: #ccc; font-size: 14px; }
.rules-content b { color: var(--gold); }
.rules-hint { background: rgba(39,174,96,.15); border-left: 3px solid #27ae60; padding: 8px 12px; margin: 10px 0; border-radius: 0 6px 6px 0; font-size: 13px; color: #8fd3b0; }
.rules-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 13px; }
.rules-table th { text-align: left; padding: 6px 10px; background: rgba(255,255,255,.06); color: var(--gold); border-bottom: 1px solid var(--panel-border); font-weight: 600; }
.rules-table td { padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,.06); color: #ccc; }
.rules-table tr:last-child td { border-bottom: none; }

.sb { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.si {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 10px; padding: 6px 12px; font-size: 12px;
}
.si .name { color: var(--muted); }
.si.me { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.si.me .name { color: var(--gold); font-weight: 700; }
.si .score { font-size: 16px; font-weight: 700; }

.sbt { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 10px; min-height: 20px; }
.sbt .cp { color: var(--gold); font-weight: 700; }

/* ===== 牌桌 ===== */
.table {
  display: grid;
  grid-template-columns: 152px 1fr 152px;
  grid-template-rows: auto 640px auto;
  grid-template-areas:
    "top top top"
    "left center right"
    "bottom bottom bottom";
  gap: 8px;
  padding: 14px;
  border-radius: 26px;
  background: radial-gradient(ellipse at center, var(--felt1), var(--felt2) 72%);
  border: 8px solid var(--wood2);
  box-shadow:
    inset 0 0 70px rgba(0,0,0,.55),
    0 14px 40px rgba(0,0,0,.55),
    0 0 0 3px var(--wood1);
}
.seat {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 8px;
}
.seat-top { grid-area: top; }
.seat-left { grid-area: left; }
.seat-right { grid-area: right; }
.seat-left, .seat-right { overflow: visible; }
.seat-bottom { grid-area: bottom; background: rgba(0,0,0,.28); padding: 10px 14px; position: relative; }
.seat.active { outline: 2px solid var(--gold); outline-offset: -2px; box-shadow: 0 0 14px rgba(232,193,90,.35); }
.seat.ting { outline: 3px solid #ff5a5a; outline-offset: -3px; animation: ting-pulse 1.1s ease-in-out infinite; }
@keyframes ting-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255,90,90,.45); }
  50% { box-shadow: 0 0 24px rgba(255,90,90,.95); }
}

.seat-head { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 6px; }
.pn { color: var(--gold); font-weight: 700; font-size: 13px; }
.pr { min-height: 14px; font-size: 11px; }
.ti { display: inline-block; background: #c0392b; color: #fff; padding: 1px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.ting-tiles { display: inline-block; margin-left: 6px; color: #8fd3b0; font-size: 11px; font-weight: 600; }

.ph { position: relative; display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; min-height: 24px; margin-bottom: 4px; }
.dealer-die {
  font-size: 17px; line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.7));
  animation: die-bounce 1.4s ease-in-out infinite;
}
.seat-left .dealer-die, .seat-right .dealer-die { }
@keyframes die-bounce { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-3px) rotate(8deg); } }
.pm { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-bottom: 2px; }
.pa { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; min-height: 32px; }
.meld { display: flex; gap: 1px; padding: 1px; border-radius: 4px; background: rgba(255,255,255,.05); }

/* ===== 麻将牌 ===== */
.tile {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 48px; border-radius: 6px;
  user-select: none;
  background: transparent;
  box-shadow: 0 2px 4px rgba(0,0,0,.4);
  transition: transform .15s, box-shadow .15s;
}
.tile .face-img { width: 100%; height: 100%; display: block; pointer-events: none; }
.tile.folded {
  background: linear-gradient(180deg, var(--back1), var(--back2));
  border: 1px solid #123524;
  box-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.tile.folded::after {
  content: ''; position: absolute; inset: 20%;
  border-radius: 4px; border: 1px solid rgba(255,255,255,.18);
}
.tile.clickable { cursor: pointer; }
.tile.clickable:hover { transform: translateY(-6px); box-shadow: 0 10px 16px rgba(0,0,0,.5); }
.tile.ting-target { outline: 3px solid var(--gold); outline-offset: 1px; box-shadow: 0 0 12px rgba(232,193,90,.7); }
.tile.latest { outline: 3px solid #ff6b4a; outline-offset: 1px; box-shadow: 0 0 12px rgba(255,107,74,.8); }
.tile.sideways { transform: rotate(90deg); margin: 0 8px; }

/* 和牌条件提示卡片 */
.hints { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 8px; min-height: 26px; }
.hint-title { font-size: 12px; font-weight: 700; color: var(--gold); }
.hint { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid; }
.hint.ok { color: #8fd3b0; border-color: rgba(143,211,176,.5); background: rgba(143,211,176,.08); }
.hint.no { color: #ff9a9a; border-color: rgba(255,154,154,.5); background: rgba(255,154,154,.08); }
.hint.neutral { color: var(--muted); border-color: var(--panel-border); background: rgba(255,255,255,.04); }
.hint-tip { font-size: 11px; color: #ffd479; }

/* 各座位牌尺寸 — 统一：副露在左，手牌在右 */
/* 通用 seat-body */
.seat-top .seat-body,
.seat-bottom .seat-body {
  display: flex; flex-direction: row; justify-content: center; align-items: flex-end; gap: 4px;
}
.seat-left .seat-body {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
}
.seat-right .seat-body {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
}

/* 上家：横排，居中 */
.seat-top .ph { flex-wrap: wrap; gap: 0; justify-content: center; align-items: flex-end; }
.seat-top .ph .tile {
  width: 36px;
  height: 48px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--back1), var(--back2));
  border: 1px solid #123524;
  box-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.seat-top .ph .tile::after {
  content: ''; position: absolute; inset: 20%;
  border-radius: 4px; border: 1px solid rgba(255,255,255,.18);
}
.seat-top .pm { display: flex; gap: 0; align-items: flex-end; }
.seat-top .pm .tile { width: 34px; height: 46px; }
.seat-top .pm .meld { gap: 0; padding: 0; margin-right: 2px; }
.seat-top .pm .meld:last-child { margin-right: 0; }

/* 左右家：竖排 */
.seat-left .ph, .seat-right .ph { flex-direction: column; flex-wrap: nowrap; align-items: center; gap: 0; }
.seat-left .pm, .seat-right .pm { flex-direction: column; align-items: center; gap: 3px; }
.seat-left .pm .meld, .seat-right .pm .meld { flex-direction: column; gap: 1px; padding: 1px; }
.seat-left .tile, .seat-right .tile { width: 36px; height: 48px; }
.seat-left .tile { transform: rotate(90deg); }
.seat-right .tile { transform: rotate(-90deg); }
.seat-left .tile.sideways, .seat-right .tile.sideways { transform: rotate(180deg); }
.seat-left .ph .tile, .seat-right .ph .tile { margin-bottom: -10px; }
.seat-left .ph .tile:last-child, .seat-right .ph .tile:last-child { margin-bottom: 0; }
.seat-left .pm .tile, .seat-right .pm .tile { width: 34px; height: 46px; margin-bottom: -8px; }
.seat-left .pm .meld .tile:last-child, .seat-right .pm .meld .tile:last-child { margin-bottom: 0; }

/* 我：最大 */
.seat-bottom .tile { width: 56px; height: 76px; border-radius: 8px; }
.seat-bottom .pm { display: flex; gap: 0; align-items: flex-end; }
.seat-bottom .pm .tile { width: 42px; height: 56px; }
.seat-bottom .pm .meld { gap: 0; padding: 0; margin-right: 3px; }
.seat-bottom .pm .meld:last-child { margin-right: 0; }
.seat-bottom .ph { gap: 2px; min-height: 76px; }

/* ===== 中央区域 ===== */
.center {
  grid-area: center;
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 220px; padding: 8px;
}
.center-mid { display: flex; align-items: center; justify-content: center; gap: 10px; }
.disc { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; align-content: flex-start; }
.disc-row { min-height: 56px; }
.disc-col { width: 204px; max-height: 272px; overflow: hidden; }
.disc .tile { width: 40px; height: 54px; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.disc-col .tile { width: 34px; height: 46px; }
.disc .tile.claimed { outline: 2px dashed #6db3ff; outline-offset: -1px; opacity: .55; }
.disc .tile.claimed::after { content: ''; position: absolute; inset: 0; background: rgba(80,150,255,.28); }
.wall-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wall-count { font-size: 12px; color: var(--gold); font-weight: 700; letter-spacing: 1px; }
.wall { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; max-width: 220px; min-height: 34px; }
.wt { width: 16px; height: 22px; border-radius: 3px; background: linear-gradient(180deg, var(--back1), var(--back2)); border: 1px solid #123524; }

/* 可响应时的中央放大提示 */
.claim-reminder {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.5); opacity: 0;
  pointer-events: none; transition: transform .22s, opacity .22s;
  display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 6;
}
.claim-reminder.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.claim-reminder .tile.big {
  width: 80px; height: 108px; font-size: 32px; border-radius: 10px;
  box-shadow: 0 0 26px rgba(232,193,90,.95), 0 10px 20px rgba(0,0,0,.55);
}
.reminder-label { font-size: 12px; font-weight: 700; color: var(--gold); text-shadow: 0 1px 4px #000; }

/* ===== 操作按钮（悬浮大圆形 + 外环特效） ===== */
.pa {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%; transform: translateX(-50%);
  display: flex; gap: 20px; justify-content: center; align-items: center;
  z-index: 20;
  padding: 12px 24px;
  background: radial-gradient(ellipse at center, rgba(10,20,15,.88), rgba(10,20,15,.6) 70%, transparent 100%);
  border-radius: 60px;
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
  transition: opacity .2s ease, visibility .2s ease;
}
.pa.hide {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.ab {
  position: relative;
  width: 100px; height: 100px;
  border: none; border-radius: 50%;
  font-size: 26px; font-weight: 900; letter-spacing: 2px;
  cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), filter .2s ease;
  animation: ab-pop .35s cubic-bezier(.34,1.56,.64,1) both;
  overflow: visible;
  flex-shrink: 0;
}
/* 外环旋转光圈 */
.ab::before {
  content: ''; position: absolute;
  inset: -6px; border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: rgba(255,255,255,.5);
  border-right-color: rgba(255,255,255,.2);
  animation: ring-spin 2.2s linear infinite;
  pointer-events: none;
}
/* 顶部高光 */
.ab::after {
  content: ''; position: absolute;
  top: 4px; left: 18%; right: 18%; height: 30%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.35), transparent);
  pointer-events: none;
}
@keyframes ring-spin {
  to { transform: rotate(360deg); }
}
.ab:hover {
  transform: scale(1.18);
  filter: brightness(1.2) drop-shadow(0 0 20px currentColor);
}
.ab:active {
  transform: scale(.92);
  filter: brightness(.9);
}
.ab:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 4px;
}
@keyframes ab-pop {
  0% { opacity: 0; transform: scale(0) translateY(20px); }
  60% { opacity: 1; transform: scale(1.15) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* 吃 - 红色 + 旋转红环 */
.ab.chi {
  background: radial-gradient(circle at 38% 28%, #ff8a80, #d64545 55%, #9b1b1b);
  box-shadow: 0 4px 12px rgba(214,69,69,.6), 0 0 30px rgba(214,69,69,.25), inset 0 -4px 12px rgba(0,0,0,.3);
  color: #fff;
}
.ab.chi::before {
  border-top-color: rgba(255,150,150,.7);
  border-right-color: rgba(255,100,100,.3);
  animation-duration: 1.8s;
}
.ab.chi:hover {
  box-shadow: 0 4px 12px rgba(214,69,69,.7), 0 0 50px rgba(255,80,80,.45), inset 0 -4px 12px rgba(0,0,0,.3);
}

/* 碰 - 橙色 + 旋转橙环 */
.ab.peng {
  background: radial-gradient(circle at 38% 28%, #ffc56e, #e08a1e 55%, #9a5c0a);
  box-shadow: 0 4px 12px rgba(224,138,30,.6), 0 0 30px rgba(224,138,30,.25), inset 0 -4px 12px rgba(0,0,0,.3);
  color: #fff;
}
.ab.peng::before {
  border-top-color: rgba(255,200,100,.7);
  border-right-color: rgba(255,180,60,.3);
  animation-duration: 2s;
}
.ab.peng:hover {
  box-shadow: 0 4px 12px rgba(224,138,30,.7), 0 0 50px rgba(255,180,60,.45), inset 0 -4px 12px rgba(0,0,0,.3);
}

/* 杠 - 紫色 + 旋转紫环 */
.ab.kong {
  background: radial-gradient(circle at 38% 28%, #cb8eff, #8e44ad 55%, #5a2080);
  box-shadow: 0 4px 12px rgba(142,68,173,.6), 0 0 30px rgba(142,68,173,.25), inset 0 -4px 12px rgba(0,0,0,.3);
  color: #fff;
}
.ab.kong::before {
  border-top-color: rgba(200,140,255,.7);
  border-right-color: rgba(180,100,255,.3);
  animation-duration: 2.4s;
}
.ab.kong:hover {
  box-shadow: 0 4px 12px rgba(142,68,173,.7), 0 0 50px rgba(180,100,255,.45), inset 0 -4px 12px rgba(0,0,0,.3);
}

/* 胡 - 大红 + 脉冲光晕 + 双环 */
.ab.hu {
  width: 120px; height: 120px;
  font-size: 34px; letter-spacing: 4px;
  background: radial-gradient(circle at 38% 28%, #ff9a8b, #e74c3c 50%, #962d22);
  box-shadow: 0 4px 16px rgba(231,76,60,.7), 0 0 40px rgba(231,76,60,.35), inset 0 -5px 16px rgba(0,0,0,.35);
  color: #fff;
  animation: ab-pop .35s cubic-bezier(.34,1.56,.64,1) both, hu-pulse 1.6s ease-in-out infinite;
}
.ab.hu::before {
  inset: -8px;
  border-width: 4px;
  border-top-color: rgba(255,140,120,.8);
  border-right-color: rgba(255,100,80,.35);
  border-bottom-color: rgba(255,100,80,.15);
  animation: ring-spin 1.5s linear infinite;
}
/* 胡 - 第二外环 */
.ab.hu .ring2 {
  position: absolute; inset: -16px; border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(255,200,180,.35);
  border-left-color: rgba(255,150,120,.15);
  animation: ring-spin 3s linear infinite reverse;
  pointer-events: none;
}
.ab.hu:hover {
  box-shadow: 0 4px 16px rgba(231,76,60,.8), 0 0 70px rgba(255,60,40,.55), inset 0 -5px 16px rgba(0,0,0,.35);
}
@keyframes hu-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(231,76,60,.7), 0 0 30px rgba(255,80,80,.3), inset 0 -5px 16px rgba(0,0,0,.35); }
  50% { box-shadow: 0 4px 16px rgba(231,76,60,.7), 0 0 60px rgba(255,80,80,.6), inset 0 -5px 16px rgba(0,0,0,.35); }
}

/* 听 - 金色 + 旋转金环 */
.ab.ting {
  background: radial-gradient(circle at 38% 28%, #ffe88a, #c9a227 55%, #7a5c10);
  box-shadow: 0 4px 12px rgba(201,162,39,.6), 0 0 30px rgba(201,162,39,.25), inset 0 -4px 12px rgba(0,0,0,.3);
  color: #3d2e00;
}
.ab.ting::before {
  border-top-color: rgba(255,230,120,.7);
  border-right-color: rgba(255,220,80,.3);
  animation-duration: 2s;
}
.ab.ting:hover {
  box-shadow: 0 4px 12px rgba(201,162,39,.7), 0 0 50px rgba(255,224,100,.45), inset 0 -4px 12px rgba(0,0,0,.3);
}

/* 过 - 灰色小按钮 */
.ab.pass {
  width: 64px; height: 64px;
  font-size: 18px;
  background: radial-gradient(circle at 38% 28%, #8a9a90, #5b6b63 55%, #3a4a42);
  box-shadow: 0 3px 8px rgba(91,107,99,.5), 0 0 16px rgba(91,107,99,.15), inset 0 -3px 8px rgba(0,0,0,.25);
  color: #ccc;
}
.ab.pass::before {
  border-top-color: rgba(180,200,190,.4);
  border-right-color: rgba(160,180,170,.15);
  animation-duration: 3s;
}
.ab.pass:hover {
  box-shadow: 0 3px 8px rgba(91,107,99,.6), 0 0 30px rgba(140,160,150,.3), inset 0 -3px 8px rgba(0,0,0,.25);
}

/* 动画延迟，让按钮依次弹出 */
.ab:nth-child(1) { animation-delay: 0s; }
.ab:nth-child(2) { animation-delay: .07s; }
.ab:nth-child(3) { animation-delay: .14s; }
.ab:nth-child(4) { animation-delay: .21s; }
.ab:nth-child(5) { animation-delay: .28s; }

.start-wrap { text-align: center; margin-top: 14px; }
.sb2b {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 44px;
  font-size: 17px; font-weight: 800; letter-spacing: 4px; color: #fff;
  border: 1px solid rgba(255,255,255,.35); border-radius: 999px;
  cursor: pointer; text-shadow: 0 1px 3px rgba(0,0,0,.35);
  background:
    linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,0) 44%),
    linear-gradient(180deg, #34d67a, #1f9e57 55%, #17864a);
  box-shadow:
    0 6px 0 #0f5c33,
    0 10px 22px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.sb2b::before {
  content: ''; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent);
  transform: skewX(-20deg); transition: left .5s ease;
}
.sb2b:hover {
  transform: translateY(-2px); filter: brightness(1.06);
  box-shadow: 0 8px 0 #0f5c33, 0 14px 26px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.55);
}
.sb2b:hover::before { left: 120%; }
.sb2b:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #0f5c33, 0 5px 12px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.4);
}
.sb2b:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(232,193,90,.55), 0 6px 0 #0f5c33, 0 10px 22px rgba(0,0,0,.45);
}
.sb2b.stop {
  background:
    linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,0) 44%),
    linear-gradient(180deg, #ff7a6b, #e5432f 55%, #c9351f);
  box-shadow: 0 6px 0 #8f2413, 0 10px 22px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.5);
}
.sb2b.stop:hover {
  box-shadow: 0 8px 0 #8f2413, 0 14px 26px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.55);
}
.sb2b.stop:active {
  box-shadow: 0 2px 0 #8f2413, 0 5px 12px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.4);
}

.lp {
  background: rgba(0,0,0,.35); border: 1px solid var(--panel-border);
  border-radius: 10px; padding: 10px; overflow-y: auto;
  font-size: 12px; color: var(--muted);
}
.le { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.le .hl { color: #8fd3b0; }

/* ===== 弹窗 ===== */
.mo { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 100; justify-content: center; align-items: center; }
.mo.show { display: flex; }
/* 胡牌手牌横幅显示时，结算弹窗下移，避免与横幅重叠 */
.mo.win-open { align-items: flex-start; overflow-y: auto; padding-top: var(--win-offset, 120px); }
.mo.win-open .mdl { margin-top: auto; margin-bottom: auto; }
.mdl {
  background: linear-gradient(180deg, #1b2b23, #12201a);
  border: 2px solid var(--gold); border-radius: 18px; padding: 28px 34px; text-align: center;
  min-width: 320px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.mdl h2 { color: var(--gold); margin-bottom: 14px; letter-spacing: 3px; }
.mdl .rt { font-size: 17px; margin-bottom: 8px; }
.mdl .st { font-size: 15px; color: #8fd3b0; margin-bottom: 6px; }
.mdl .dt { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.mdl button { padding: 10px 26px; border: none; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; background: #27ae60; color: #fff; }
.mdl button:hover { filter: brightness(1.08); }

/* 结算分数明细 */
.m-breakdown { display: none; margin-bottom: 18px; }
.m-breakdown.show { display: block; }
.m-breakdown .bd-head,
.m-breakdown .bd-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; align-items: center; padding: 5px 10px; border-radius: 8px; }
.m-breakdown .bd-head { font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--panel-border); margin-bottom: 2px; }
.m-breakdown .bd-row { font-size: 14px; background: rgba(255,255,255,.04); margin-bottom: 4px; }
.m-breakdown .bd-row.me { background: rgba(232,193,90,.12); box-shadow: 0 0 0 1px rgba(232,193,90,.45) inset; }
.m-breakdown .bd-name { text-align: left; color: var(--text); }
.m-breakdown .bd-delta { font-weight: 700; }
.m-breakdown .bd-total { font-weight: 700; color: var(--gold); }

/* ================= 手机 / 平板适配 ================= */
@media (max-width: 760px) {
  body { padding: 6px; }
  .gc { max-width: 100%; padding: 6px 6px 0; }
  .topbar { margin-bottom: 6px; gap: 6px; }
  h1 { font-size: 17px; letter-spacing: 3px; }
  .gi { font-size: 11px; gap: 6px; }
  .log-btn { padding: 4px 10px; font-size: 10px; }
  .sb { gap: 4px; margin-bottom: 6px; }
  .si { padding: 4px 7px; font-size: 10px; border-radius: 7px; }
  .si .score { font-size: 13px; }
  .sbt { font-size: 11px; margin-bottom: 6px; min-height: 16px; }

  .table {
    grid-template-columns: 74px 1fr 74px;
    grid-template-rows: auto 400px auto;
    gap: 4px;
    padding: 7px;
    border-width: 5px;
    border-radius: 16px;
  }
  .seat { padding: 4px; border-radius: 8px; }
  .seat-bottom { padding: 6px 8px; }
  .seat-head { gap: 4px; margin-bottom: 3px; }
  .pn { font-size: 10px; }
  .pr { font-size: 9px; min-height: 10px; }
  .ti { font-size: 8px; padding: 0 4px; }
  .ting-tiles { font-size: 9px; margin-left: 3px; }

  /* 上家 */
  .seat-top .seat-body { gap: 0; }
  .seat-top .ph { gap: 1px; }
  .seat-top .ph .tile { width: 22px; height: 30px; }
  .seat-top .pm { gap: 0; }
  .seat-top .pm .tile { width: 22px; height: 30px; margin-left: -4px; box-shadow: none; border: none; }
  .seat-top .pm .tile:first-child { margin-left: 0; }
  .seat-top .pm .meld { gap: 0; padding: 0; background: none; border-radius: 0; margin-right: 2px; }
  .seat-top .pm .meld:last-child { margin-right: 0; }
  .seat-top .pm .tile.sideways { transform: rotate(90deg); margin: 0; }

  /* 左右家 */
  .seat-left .seat-body, .seat-right .seat-body { gap: 0; }
  .seat-left .tile, .seat-right .tile { width: 24px; height: 32px; }
  .seat-left .ph .tile, .seat-right .ph .tile { margin-bottom: -7px; }
  .seat-left .pm, .seat-right .pm { gap: 0; }
  .seat-left .pm .tile, .seat-right .pm .tile { width: 19px; height: 26px; margin-bottom: -5px; }
  .seat-left .pm .meld, .seat-right .pm .meld { gap: 0; padding: 0; background: none; border-radius: 0; }

  /* 我 */
  .seat-bottom .tile { width: 34px; height: 46px; border-radius: 6px; }
  .seat-bottom .pm { gap: 0; }
  .seat-bottom .pm .tile { width: 26px; height: 36px; margin-left: -4px; box-shadow: none; border: none; }
  .seat-bottom .pm .tile:first-child { margin-left: 0; }
  .seat-bottom .pm .meld { gap: 0; padding: 0; background: none; border-radius: 0; margin-right: 2px; }
  .seat-bottom .pm .meld:last-child { margin-right: 0; }
  .seat-bottom .pm .tile.sideways { transform: rotate(90deg); margin: 0; }
  .seat-bottom .ph { gap: 2px; min-height: 46px; }
  .seat-bottom .seat-head { margin-bottom: 2px; }

  /* 中央 */
  .center { min-height: 150px; padding: 3px; gap: 3px; }
  .center-mid { gap: 4px; }
  .disc-row { min-height: 30px; }
  .disc { gap: 2px; }
  .disc .tile, .disc-col .tile { width: 21px; height: 28px; border-radius: 3px; }
  .disc-col { width: 92px; max-height: 172px; }
  .wall-wrap { gap: 2px; }
  .wall-count { font-size: 10px; }
  .wall { max-width: 96px; min-height: 22px; gap: 1px; }
  .wt { width: 10px; height: 14px; }

  /* 悬浮按钮 */
  .pa { gap: 12px; padding: 8px 16px; border-radius: 44px; }
  .ab { width: 68px; height: 68px; font-size: 18px; }
  .ab.hu { width: 82px; height: 82px; font-size: 24px; letter-spacing: 2px; }
  .ab.pass { width: 46px; height: 46px; font-size: 14px; }
  .hints { gap: 3px; margin-top: 4px; min-height: 18px; }
  .hint-title { font-size: 10px; }
  .hint { font-size: 9px; padding: 1px 6px; }
  .hint-tip { font-size: 9px; }
  .pm { gap: 4px; }

  .lp { font-size: 10px; max-height: 80px; padding: 6px; margin-top: 6px; }
  .start-wrap { margin-top: 8px; }
  .sb2b { font-size: 14px; padding: 10px 28px; letter-spacing: 3px; }

  /* 弹窗 / 结算 */
  .mdl { min-width: 0; width: 90vw; padding: 18px 16px; }
  .mdl h2 { font-size: 20px; }
  .sum-card { width: 94vw; padding: 16px 14px; }
  .sum-card h2 { font-size: 20px; }
  .sum-meta b { font-size: 18px; }
  .sum-meta span { font-size: 10px; }
  .sum-row { font-size: 13px; }
  .sum-stats span { font-size: 11px; padding: 3px 9px; }
  .sum-actions button { padding: 9px 16px; font-size: 13px; }

  .fx-label { font-size: 30px; }
}

@media (max-width: 430px) {
  .pa { gap: 8px; padding: 6px 12px; border-radius: 36px; }
  .ab { width: 56px; height: 56px; font-size: 15px; }
  .ab.hu { width: 68px; height: 68px; font-size: 20px; letter-spacing: 1px; }
  .ab.pass { width: 40px; height: 40px; font-size: 12px; }
  .table { grid-template-columns: 64px 1fr 64px; grid-template-rows: auto 400px auto; }
  .seat-left .seat-body, .seat-right .seat-body { gap: 3px; }
  .seat-left .tile, .seat-right .tile { width: 22px; height: 30px; }
  .seat-left .ph .tile, .seat-right .ph .tile { margin-bottom: -6px; }
  .seat-left .pm, .seat-right .pm { gap: 1px; }
  .seat-left .pm .tile, .seat-right .pm .tile { width: 17px; height: 24px; margin-bottom: -4px; }
  .seat-left .pm .meld, .seat-right .pm .meld { gap: 0; padding: 0; }
  .seat-top .ph .tile { width: 22px; height: 30px; }
  .seat-top .pm { gap: 0; }
  .seat-top .pm .tile { width: 20px; height: 26px; }
  .seat-top .pm .meld { gap: 0; padding: 0; }
  .seat-bottom .tile { width: 30px; height: 41px; }
  .seat-bottom .pm { gap: 2px; }
  .seat-bottom .pm .tile { width: 23px; height: 32px; }
  .seat-bottom .pm .meld { gap: 0; padding: 1px; }
  .disc-col { width: 78px; max-height: 156px; }
  .disc .tile, .disc-col .tile { width: 19px; height: 25px; }
  .wall { max-width: 78px; }
  h1 { font-size: 15px; }
  .si .score { font-size: 12px; }
}

/* ===== 宝牌横幅 ===== */
.dora-banner {
  position: fixed; top: 8px; left: 50%; transform: translate(-50%, 0);
  display: none; align-items: center; gap: 10px; z-index: 110;
  padding: 8px 18px 8px 14px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(35,24,8,.96), rgba(70,48,12,.94));
  border: 2px solid var(--gold);
  box-shadow: 0 0 26px rgba(232,193,90,.55);
}
.dora-banner.show { display: flex; animation: dora-in .35s ease-out; }
.dora-banner .dora-label { color: var(--gold); font-weight: 800; font-size: 14px; letter-spacing: 3px; }
.dora-banner .dora-tile .face-img { width: 46px; height: 62px; display: block; border-radius: 6px; box-shadow: 0 0 16px rgba(232,193,90,.9); }
@keyframes dora-in { from { opacity: 0; transform: translate(-50%, -22px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

/* ===== 胡牌手牌横幅（页面中间上方） ===== */
.win-banner {
  position: fixed; top: 92px; left: 50%; transform: translate(-50%, 0);
  display: none; flex-direction: column; align-items: center; gap: 6px;
  z-index: 120; padding: 8px 14px; border-radius: 14px;
  max-width: 92vw;
  background: linear-gradient(180deg, rgba(22,34,27,.97), rgba(10,20,15,.97));
  border: 2px solid var(--gold);
  box-shadow: 0 0 30px rgba(232,193,90,.5), 0 14px 34px rgba(0,0,0,.6);
}
.win-banner.show { display: flex; animation: win-in .35s ease-out; }
.win-banner .wb-head { color: var(--gold); font-weight: 800; font-size: 14px; letter-spacing: 2px; white-space: nowrap; }
.win-banner .wb-tiles { display: flex; align-items: center; justify-content: center; gap: 3px; flex-wrap: wrap; }
.win-banner .wb-meld { display: flex; gap: 2px; padding: 2px; border-radius: 6px; background: rgba(255,255,255,.06); }
.win-banner .wb-sep { width: 2px; height: 43px; margin: 0 5px; border-radius: 2px; background: rgba(255,255,255,.25); }
.win-banner .tile { width: 32px; height: 43px; }
.win-banner .tile.wb-win {
  outline: 3px solid #ffd34d; outline-offset: 1px;
  box-shadow: 0 0 16px rgba(255,211,77,.95);
  transform: translateY(-4px);
}
@keyframes win-in { from { opacity: 0; transform: translate(-50%, -20px) scale(.94); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

/* ===== 胡牌特效 ===== */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 200; display: none; }
.fx-layer.show { display: block; }
.fx-layer.show::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,220,130,.28), transparent 62%);
  animation: fx-flash .7s ease-out forwards;
}
.fx-layer.gold.show::before { background: radial-gradient(circle at 50% 50%, rgba(255,200,60,.5), transparent 68%); }
.fx-particle {
  position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle, #fff, #9fe6c0 40%, transparent 72%);
  transform: translate(-50%, -50%);
  animation: fx-burst .95s cubic-bezier(.2,.7,.3,1) forwards;
}
.fx-particle.gold { width: 14px; height: 14px; background: radial-gradient(circle, #fff, #f5c542 38%, transparent 72%); }
.fx-ring {
  position: absolute; left: 50%; top: 50%; width: 80px; height: 80px; margin: -40px 0 0 -40px;
  border-radius: 50%; border: 4px solid var(--gold);
  animation: fx-ring 1s ease-out forwards;
}
.fx-label {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%);
  font-size: 44px; font-weight: 900; letter-spacing: 4px;
  color: #fff; text-shadow: 0 0 18px #f5c542, 0 0 44px #f5a623;
  animation: fx-label 1.25s ease-out forwards;
}
@keyframes fx-burst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.4); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.3); }
}
@keyframes fx-flash { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fx-ring { 0% { opacity: 1; transform: scale(.3); } 100% { opacity: 0; transform: scale(3.2); } }
@keyframes fx-label {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
}

/* ===== 整局结算 ===== */
.summary {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.78);
  z-index: 300; justify-content: center; align-items: center; padding: 20px;
}
.summary.show { display: flex; }
.sum-card {
  width: min(520px, 94vw); max-height: 92vh; overflow-y: auto;
  background: linear-gradient(180deg, #1b2b23, #101d17);
  border: 2px solid var(--gold); border-radius: 20px; padding: 24px 26px;
  box-shadow: 0 24px 70px rgba(0,0,0,.7); text-align: center;
}
.sum-card h2 { color: var(--gold); letter-spacing: 4px; margin-bottom: 18px; font-size: 24px; }
.sum-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.sum-meta > div { background: rgba(255,255,255,.06); border-radius: 10px; padding: 10px 4px; }
.sum-meta b { display: block; font-size: 24px; color: #fff; }
.sum-meta span { font-size: 11px; color: var(--muted); }
.sum-scores { margin-bottom: 16px; }
.sum-head, .sum-row { display: grid; grid-template-columns: 1.5fr repeat(4, .72fr) 1fr; gap: 3px; align-items: center; padding: 8px 10px; border-radius: 8px; text-align: center; }
.sum-head span:first-child, .sum-row .sum-name { text-align: left; }
.sum-head { font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--panel-border); margin-bottom: 4px; }
.sum-row { background: rgba(255,255,255,.04); margin-bottom: 5px; font-size: 15px; }
.sum-row.me { background: rgba(232,193,90,.14); box-shadow: 0 0 0 1px rgba(232,193,90,.45) inset; }
.sum-name { text-align: left; }
.sum-score { font-weight: 800; text-align: right; }
.sum-stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }
.sum-stats span { font-size: 12px; color: var(--muted); background: rgba(255,255,255,.05); border-radius: 999px; padding: 4px 12px; }
.sum-stats b { color: var(--gold); }
.sum-actions { display: flex; gap: 10px; justify-content: center; }
.sum-actions button { padding: 10px 22px; border: none; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; }
#sum-download { background: linear-gradient(180deg, #2ecc71, #27ae60); color: #fff; }
#sum-close { background: #4a5a52; color: #fff; }

/* 触屏优化 */
html { -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
.tile, .ab, .sb2b, .sum-actions button, .mdl button { touch-action: manipulation; }
.tile.clickable:active { transform: translateY(-4px); box-shadow: 0 6px 12px rgba(0,0,0,.5); }

@media (max-width: 760px) {
  .dealer-die { font-size: 13px; }

  /* 宝牌横幅 */
  .dora-banner { top: 4px; padding: 5px 10px 5px 8px; gap: 6px; border-radius: 10px; }
  .dora-banner .dora-label { font-size: 11px; letter-spacing: 1px; }
  .dora-banner .dora-tile .face-img { width: 32px; height: 44px; }

  /* 胡牌手牌横幅 */
  .win-banner { top: 64px; padding: 6px 10px; gap: 4px; border-radius: 10px; max-width: 94vw; }
  .win-banner .wb-head { font-size: 11px; letter-spacing: 1px; }
  .win-banner .wb-tiles { gap: 2px; }
  .win-banner .tile { width: 22px; height: 29px; border-radius: 4px; }
  .win-banner .wb-sep { height: 29px; margin: 0 3px; }
}
