/* 斗地主 H5 · 与 App 端同一套蓝金色板 */
[hidden] { display: none !important; }

body.ddz-body {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

.ddz-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(30, 120, 200, .55), rgba(8, 62, 120, .78));
  border-bottom: 1px solid rgba(255, 194, 46, .22);
  backdrop-filter: blur(18px) saturate(1.2);
}

.ddz-back {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--text, #f4f9ff);
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .16);
  text-decoration: none;
}

.ddz-title { flex: 1; min-width: 0; }
.ddz-title h1 {
  margin: 0;
  font-size: 17px;
  letter-spacing: .04em;
  font-family: 'SmileySans', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
.ddz-title p { margin: 2px 0 0; font-size: 11px; color: #bfe0fa; }

.ddz-wallet {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 10.5px;
  color: #8bbcdf;
}
.ddz-wallet b {
  font-size: 16px;
  color: #ffc22e;
  font-variant-numeric: tabular-nums;
  font-family: 'SmileySans', -apple-system, 'PingFang SC', sans-serif;
}

.ddz-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 0;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── 桌面 ───────────────────────────────────────────── */
.ddz-table {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.ddz-opponents {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ddz-seat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .03)), rgba(9, 46, 86, .86);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
}

.ddz-seat.is-turn {
  border-color: rgba(255, 194, 46, .85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 1px rgba(255, 194, 46, .35), 0 0 18px rgba(255, 194, 46, .3);
}

.ddz-avatar {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: #57380a;
  background: linear-gradient(160deg, #ffe79a, #ffc22e 52%, #ef9f00);
  border: 1.5px solid #ffe79a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 6px 14px rgba(255, 194, 46, .25);
  overflow: hidden;
}
.ddz-avatar.small { width: 30px; height: 30px; font-size: 13px; }
.ddz-avatar img { width: 100%; height: 100%; object-fit: cover; }

.ddz-seat-meta { min-width: 0; flex: 1; }
.ddz-seat-meta b {
  display: block;
  font-size: 12.5px;
  color: #f4f9ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ddz-seat-meta small { font-size: 10.5px; color: #8bbcdf; }

.ddz-cardback {
  position: relative;
  width: 26px;
  height: 34px;
  flex: none;
  border-radius: 5px;
  background: linear-gradient(150deg, #e5412d, #7d1414);
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18), 0 3px 8px rgba(0, 20, 45, .45);
  display: grid;
  place-items: center;
}
.ddz-cardback i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(160deg, #ffe79a, #ef9f00);
  transform: rotate(45deg);
}
.ddz-cardback em {
  position: absolute;
  right: -6px;
  bottom: -6px;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  color: #04234a;
  background: #ffc22e;
  border-radius: 999px;
  padding: 0 4px;
  line-height: 15px;
  min-width: 15px;
  text-align: center;
}

.ddz-center {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 0;
  padding: 8px;
  border-radius: 16px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(18, 118, 207, .45), rgba(4, 35, 74, .55)),
    rgba(4, 35, 74, .3);
  border: 1px solid rgba(255, 255, 255, .10);
  overflow: hidden;
}

/* 桌面水印：空白区域不至于像一块纯色板 */
.ddz-center::before {
  content: '';
  position: absolute;
  inset: 10% 7%;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, .12);
  box-shadow:
    inset 0 0 70px rgba(2, 20, 46, .45),
    0 0 0 6px rgba(255, 255, 255, .02);
  pointer-events: none;
  z-index: 0;
}

.ddz-center::after {
  content: '金 局';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: 'SmileySans', -apple-system, 'PingFang SC', sans-serif;
  font-size: 46px;
  letter-spacing: .28em;
  color: rgba(255, 255, 255, .045);
  pointer-events: none;
  z-index: 0;
}

.ddz-last { display: flex; gap: 4px; min-height: 44px; align-items: center; z-index: 1; }
.ddz-hint { font-size: 11.5px; color: #bfe0fa; }
.ddz-timer {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #ffc22e;
  background: conic-gradient(#ffc22e var(--p, 100%), rgba(255, 255, 255, .12) 0);
  position: relative;
}
.ddz-timer::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #08355f;
}

.ddz-mine { display: flex; flex-direction: column; gap: 8px; }
.ddz-me-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #f4f9ff; }
.ddz-role {
  font-size: 10px;
  font-weight: 800;
  color: #57380a;
  background: linear-gradient(180deg, #ffe79a, #ffc22e);
  border-radius: 999px;
  padding: 1px 8px;
}

.ddz-hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 92px;
  padding: 0 2px 6px;
}

/* ── 扑克牌（.pcard，避免和 theme.css 的 .card 面板冲突）── */
.pcard {
  position: relative;
  width: 44px;
  height: 64px;
  margin-left: calc(var(--step, 26px) - 44px);
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff, #eef4fb);
  border: 1px solid rgba(4, 35, 74, .22);
  box-shadow: 0 4px 10px rgba(0, 20, 45, .35), inset 0 1px 0 rgba(255, 255, 255, .9);
  color: #0d2135;
  font-family: 'SmileySans', -apple-system, 'PingFang SC', sans-serif;
  transition: transform .16s cubic-bezier(.22, .61, .36, 1), box-shadow .16s;
  cursor: pointer;
  user-select: none;
  flex: none;
}
.pcard:first-child { margin-left: 0; }

/* 左上角：点数在上、花色在下，叠牌时露出的窄条也能看全 */
.pcard .corner {
  position: absolute;
  top: 2px;
  left: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.pcard .corner b { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.pcard .corner i { font-style: normal; font-size: 10.5px; margin-top: 1px; }
.pcard .pip {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font-size: 17px;
  line-height: 1;
  opacity: .9;
}
.pcard.red { color: #d32b2b; }
.pcard.joker { background: linear-gradient(180deg, #fff8e2, #ffe9b8); }
.pcard.joker .corner b { font-size: 13px; }
.pcard.joker .corner i { font-size: 13px; color: #c1963d; }
.pcard.sel {
  transform: translateY(-14px);
  box-shadow: 0 10px 18px rgba(0, 20, 45, .5), 0 0 0 2px #ffc22e;
}
.pcard.mini { width: 30px; height: 42px; margin-left: -12px; cursor: default; }
.pcard.mini .corner b { font-size: 11px; }
.pcard.mini .corner i { font-size: 8px; }
.pcard.mini .pip { display: none; }
.pcard.mini:first-child { margin-left: 0; }

/* ── 大厅 / 按钮 ────────────────────────────────────── */
.ddz-lobby { display: flex; flex-direction: column; gap: 12px; }

.ddz-card-panel {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .028)), rgba(9, 46, 86, .88);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 18px 40px rgba(0, 16, 40, .32);
}

.ddz-card-panel h2 {
  margin: 0 0 6px;
  font-size: 17px;
  font-family: 'SmileySans', -apple-system, 'PingFang SC', sans-serif;
  letter-spacing: .03em;
}

.ddz-note, .ddz-status { margin: 0; font-size: 11.5px; color: #bfe0fa; line-height: 1.55; }
.ddz-status { margin-top: 10px; min-height: 16px; }

.ddz-bases { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 14px; }

.ddz-bases button {
  flex: 1 1 22%;
  min-width: 68px;
  height: 44px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #d7ecff;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
}
.ddz-bases button[aria-pressed="true"] {
  color: #57380a;
  background: linear-gradient(180deg, #ffe79a, #ffc22e 52%, #ef9f00);
  border-color: #ffe79a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 8px 20px rgba(255, 194, 46, .28);
}
.ddz-bases button:disabled { opacity: .38; }

.ddz-primary, .ddz-ghost {
  height: 50px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
  width: 100%;
}

.ddz-primary {
  color: #4a2f04;
  background: linear-gradient(180deg, #ffd76a 0%, #ffc22e 52%, #ef9f00 100%);
  border: 1px solid #ffe79a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 10px 24px rgba(255, 194, 46, .28);
}
.ddz-primary:disabled { filter: saturate(.4) brightness(.8); }

.ddz-ghost {
  color: #e8f4ff;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .18);
}

.ddz-rules { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: #bfe0fa; line-height: 1.85; }

.ddz-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(4, 35, 74, .96), rgba(4, 35, 74, .72));
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, .10);
}
.ddz-actions .ddz-primary, .ddz-actions .ddz-ghost { flex: 1; height: 46px; font-size: 14px; }

.ddz-result {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 18, 38, .68);
  backdrop-filter: blur(6px);
}
.ddz-result-card {
  width: 100%;
  max-width: 320px;
  padding: 22px 18px;
  border-radius: 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03)), rgba(9, 46, 86, .96);
  border: 1px solid rgba(255, 194, 46, .38);
  box-shadow: 0 28px 60px rgba(0, 10, 26, .6);
}
.ddz-result-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  color: #ffc22e;
  font-family: 'SmileySans', -apple-system, 'PingFang SC', sans-serif;
}
.ddz-result-card p { margin: 0 0 16px; font-size: 12.5px; color: #d5ebff; line-height: 1.6; }
.ddz-result-card .ddz-ghost { margin-top: 8px; }
