/* =========================================================
   斗地主 · table
   ========================================================= */
.ddz-screen { background: #041b15; }
.ddz-body { overflow: hidden; }
.ddz-arena {
  position: absolute;
  inset: 0;
  z-index: 2;
  isolation: isolate;
}
.ddz-arena::before {
  content: "";
  position: absolute;
  inset: 14px 22px 0;
  border-radius: 48% 48% 12% 12% / 27% 27% 8% 8%;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(38, 139, 104, .35), transparent 66%),
    radial-gradient(ellipse at 50% 90%, rgba(1, 15, 11, .52), transparent 56%),
    linear-gradient(160deg, #0d4032 0%, #0a362a 48%, #07271f 100%);
  border: 7px solid #4b2f1c;
  box-shadow:
    0 0 0 2px rgba(166, 124, 63, .65),
    0 0 0 3px rgba(63, 37, 15, .75),
    inset 0 0 120px rgba(0, 0, 0, .38),
    inset 0 0 30px rgba(0, 0, 0, .25);
}
.ddz-arena::after {
  content: "";
  position: absolute;
  inset: 31px 38px 11px;
  border-radius: inherit;
  border: 1px solid rgba(235, 201, 132, .14);
  box-shadow: inset 0 0 85px rgba(0, 0, 0, .18);
  pointer-events: none;
}
.ddz-screen .felt::before {
  background-size: 100% 100%, 100% 100%, 38px 38px, 38px 38px;
  opacity: .9;
}
.ddz-screen .felt::after { opacity: .08; }

/* decorative side glows */
.ddz-arena .table-center-mark { top: 48%; width: min(22vw, 250px); opacity: .48; }
.ddz-arena .table-center-mark span { font-size: clamp(50px, 7vw, 92px); opacity: .8; }

/* =========================================================
   Top info
   ========================================================= */
.ddz-top-center {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.ddz-bottom-box {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 8px;
  border-radius: 12px;
  border: 1px solid rgba(232, 198, 128, .25);
  background:
    linear-gradient(180deg, rgba(13, 56, 44, .85), rgba(3, 26, 20, .91));
  box-shadow: 0 5px 18px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 245, 210, .06);
  backdrop-filter: blur(7px);
}
.ddz-bottom-label {
  writing-mode: vertical-rl;
  font-family: var(--font-kai);
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(235, 209, 150, .7);
  border-right: 1px solid rgba(231, 196, 125, .16);
  padding-right: 7px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ddz-bottom-cards { display: flex; align-items: center; gap: 3px; height: 48px; }
.ddz-bottom-cards .pcard { --cw: 34px; border-radius: 4px; box-shadow: 0 3px 7px rgba(0, 0, 0, .36); transform-origin: bottom center; }
.ddz-bottom-cards .pcard .card-corner .rank { font-size: calc(var(--cw) * .24); }
.ddz-bottom-cards .pcard .card-field { inset: calc(var(--cw) * .22) calc(var(--cw) * .15); }
.ddz-bottom-cards .pcard .court { display: none; }
.ddz-bottom-cards .pcard .ace-center .ace-suit { font-size: calc(var(--cw) * .5); }
.ddz-bottom-cards .bottom-card-back:nth-child(1) { transform: rotate(-4deg) translateY(1px); }
.ddz-bottom-cards .bottom-card-back:nth-child(2) { transform: translateY(-2px); }
.ddz-bottom-cards .bottom-card-back:nth-child(3) { transform: rotate(4deg) translateY(1px); }
.ddz-bottom-cards .bottom-card-face { animation: bottomFlip .45s var(--ease-spring) both; }
.ddz-bottom-cards .bottom-card-face:nth-child(1) { transform: rotate(-3deg); }
.ddz-bottom-cards .bottom-card-face:nth-child(2) { transform: translateY(-1px); }
.ddz-bottom-cards .bottom-card-face:nth-child(3) { transform: rotate(3deg); }
@keyframes bottomFlip {
  from { opacity: 0; transform: rotateY(90deg) translateY(-7px) scale(.85); }
  to { opacity: 1; transform: rotateY(0) translateY(0) scale(1); }
}
.ddz-bottom-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 7.5px;
  color: rgba(193, 184, 159, .43);
  letter-spacing: .3px;
}
.ddz-bottom-meta b { color: rgba(236, 207, 143, .76); font-weight: 500; }
.ddz-bottom-meta .dot { width: 2px; height: 2px; background: rgba(214, 190, 140, .4); border-radius: 50%; }
.ddz-bottom-cards.revealed { filter: drop-shadow(0 0 8px rgba(242, 205, 122, .16)); }

/* status / bidding prompt */
.turntable-status {
  position: absolute;
  top: 101px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 34;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  padding: 5px 14px;
  border-radius: 12px;
  background: rgba(5, 30, 24, .62);
  border: 1px solid rgba(230, 195, 125, .14);
  color: rgba(230, 215, 183, .7);
  font-size: 8.5px;
  letter-spacing: .4px;
  backdrop-filter: blur(5px);
  white-space: nowrap;
  pointer-events: none;
}
.turntable-status i { width: 4px; height: 4px; border-radius: 50%; background: #68d5a9; box-shadow: 0 0 6px rgba(104, 213, 169, .6); animation: pulseDot 1.8s infinite; }
.turntable-status.your-turn { color: #ffe0a0; border-color: rgba(241, 202, 124, .32); background: rgba(38, 43, 23, .5); }
.turntable-status.your-turn i { background: #f4cf7e; box-shadow: 0 0 8px #f4cf7e; }
.turntable-status.thinking i { background: #d7b66c; }
.turntable-status.landlord { color: #f6d99a; }

.ddz-bid-center {
  position: absolute;
  top: 35.5%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 33;
  width: 290px;
  min-height: 146px;
  padding: 17px 24px 15px;
  border-radius: 16px;
  border: 1px solid rgba(235, 200, 129, .22);
  background:
    radial-gradient(ellipse at 50% -20%, rgba(94, 153, 116, .3), transparent 56%),
    linear-gradient(180deg, rgba(13, 59, 46, .8), rgba(4, 28, 22, .72));
  box-shadow: 0 18px 38px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 246, 211, .06);
  backdrop-filter: blur(9px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: opacity .25s, transform .25s;
}
.ddz-bid-center::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 11px;
  border: 1px solid rgba(232, 197, 127, .08);
  pointer-events: none;
}
.ddz-bid-seal {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 25px;
  color: #4e2d08;
  background: radial-gradient(circle at 35% 27%, #fff6d3, #f2d48c 38%, #d3a244 74%, #a06b23);
  border: 1px solid rgba(255, 244, 203, .6);
  box-shadow: 0 0 0 4px rgba(238, 202, 125, .05), 0 6px 13px rgba(0, 0, 0, .28);
  margin-bottom: 8px;
}
.ddz-bid-center h3 {
  font-family: var(--font-kai);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 4px;
  color: #f6e3bb;
  text-indent: 4px;
}
.ddz-bid-center p { font-size: 8.5px; color: rgba(201, 189, 164, .52); margin-top: 5px; letter-spacing: .4px; line-height: 1.5; }

/* =========================================================
   Opponents
   ========================================================= */
.ddz-opponent {
  position: absolute;
  z-index: 31;
  top: 11%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 7px 9px 7px 7px;
  border-radius: 42px 12px 12px 42px;
  background: linear-gradient(90deg, rgba(3, 28, 22, .36), rgba(3, 28, 22, 0));
}
.ddz-opponent-left { left: 3.4%; }
.ddz-opponent-right { right: 3.4%; flex-direction: row-reverse; padding: 7px 7px 7px 9px; border-radius: 12px 42px 42px 12px; background: linear-gradient(270deg, rgba(3, 28, 22, .36), rgba(3, 28, 22, 0)); text-align: right; }
.ddz-opponent .seat-avatar-wrap { width: 72px; height: 72px; }
.ddz-opponent .seat-avatar { border-width: 2px; }
.ddz-opponent .seat-info { padding-top: 7px; }
.ddz-opponent-right .seat-info { align-items: flex-end; }
.ddz-opponent-left .seat-info { align-items: flex-start; }
.ddz-opponent .seat-name { font-size: 12px; max-width: 92px; }
.ddz-opponent .seat-meta { font-size: 8px; gap: 4px; }
.ddz-opponent .seat-meta .opp-count { color: rgba(229, 204, 153, .65); padding-left: 2px; }
.ddz-opponent .seat-name-row { gap: 4px; }
.ddz-opponent .seat-badge { font-size: 6.5px; padding: 2px 4px; }
.ddz-opponent .seat-badge.landlord { background: linear-gradient(180deg, #f8df9f, #ce9b42); color: #4c2b08; border-color: rgba(255, 238, 188, .6); font-weight: 700; }
.ddz-opponent .opponent-stack { width: 50px; height: 76px; margin-left: 2px; opacity: .9; transform: scale(.82); transform-origin: left center; }
.ddz-opponent-right .opponent-stack { transform-origin: right center; order: 3; }
.ddz-opponent .back-stack { top: 2px; }
.ddz-opponent .back-stack .pcard { --cw: 31px; }
.ddz-opponent .back-stack .pcard:nth-child(1) { left: -4px; }
.ddz-opponent .back-stack .pcard:nth-child(2) { left: 8px; }
.ddz-opponent .back-stack .pcard:nth-child(3) { left: 20px; }
.ddz-opponent .back-stack .pcard:nth-child(4) { left: 31px; }
.ddz-opponent .seat-bubble-slot {
  position: absolute;
  z-index: 60;
  width: 190px;
  pointer-events: none;
  left: 91px;
  top: 69px;
}
.ddz-opponent-right .seat-bubble-slot { left: auto; right: 91px; display: flex; justify-content: flex-end; }
.ddz-opponent .ddz-speech { position: relative; display: inline-block; }
.ddz-opponent-right .ddz-speech { text-align: right; border-radius: 10px 10px 2px 10px; }
.ddz-opponent-right .ddz-speech::after { left: auto; right: 0; border-width: 0 0 7px 8px; border-color: transparent transparent transparent #e9dbb9; }
.ddz-opponent-left .ddz-speech::after { left: 0; right: auto; }
.ddz-opponent.is-turn { background: linear-gradient(90deg, rgba(49, 70, 32, .3), rgba(3, 28, 22, 0)); }
.ddz-opponent-right.is-turn { background: linear-gradient(270deg, rgba(49, 70, 32, .3), rgba(3, 28, 22, 0)); }
.ddz-opponent.is-landlord-seat .seat-name { color: #ffe2a5; }

/* =========================================================
   Played areas
   ========================================================= */
.ddz-play-slot {
  position: absolute;
  z-index: 28;
  min-width: 96px;
  min-height: 65px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ddz-play-slot.left { left: 22.5%; top: 38%; transform: translate(-50%, -50%); }
.ddz-play-slot.right { right: 22.5%; top: 38%; transform: translate(50%, -50%); }
.ddz-play-slot.bottom { left: 50%; bottom: 220px; transform: translateX(-50%); }
.ddz-slot-cards { min-height: 1px; display: flex; align-items: center; justify-content: center; }
.ddz-slot-label {
  margin-bottom: 5px;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(4, 27, 21, .38);
  font-size: 8.5px;
  letter-spacing: .5px;
  color: rgba(239, 221, 183, .64);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  white-space: nowrap;
  opacity: .95;
}
.ddz-play-slot .played-cards { --cw: 60px; }
.ddz-play-slot .played-cards .pcard { --cw: 60px; }
.ddz-play-slot .played-cards.small { --cw: 46px; }
.ddz-play-slot .played-cards.small .pcard { --cw: 46px; }
.ddz-play-slot .played-cards .pcard { border-color: rgba(118, 96, 60, .55); }
.ddz-play-slot .played-cards .pcard .card-corner .rank { font-size: calc(var(--cw) * .23); }
.ddz-play-slot .played-cards .pcard .card-field { inset: calc(var(--cw) * .22) calc(var(--cw) * .14); }
.ddz-play-slot .played-cards .pcard .court { display: none; }
.ddz-play-slot .played-cards .pcard .ace-center .ace-suit { font-size: calc(var(--cw) * .47); }
.ddz-play-slot.is-pass { min-height: 54px; }
.ddz-pass-stamp {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: 2px solid rgba(202, 158, 85, .3);
  display: grid;
  place-items: center;
  font-family: var(--font-kai);
  font-size: 15px;
  letter-spacing: 2px;
  text-indent: 2px;
  color: rgba(235, 209, 158, .48);
  background: rgba(1, 18, 13, .18);
  transform: rotate(-8deg);
  box-shadow: inset 0 0 0 3px rgba(203, 159, 87, .04);
  animation: passStamp .25s var(--ease-out) both;
}
@keyframes passStamp { from { opacity: 0; transform: scale(1.3) rotate(-15deg); } to { opacity: 1; transform: scale(1) rotate(-8deg); } }
.ddz-play-slot.bomb-slot .ddz-slot-label { color: #f1cb7f; }

/* =========================================================
   Bottom user & hand
   ========================================================= */
.ddz-user-seat {
  position: absolute;
  left: 19px;
  bottom: 16px;
  z-index: 44;
  min-width: 166px;
  padding: 3px 10px 3px 3px;
  border-radius: 42px 12px 12px 42px;
  transition: background .25s;
}
.ddz-user-seat .seat-avatar-wrap { width: 61px; height: 61px; }
.ddz-user-seat .seat-info { padding-top: 3px; gap: 3px; }
.ddz-user-seat .seat-name { font-size: 10.5px; max-width: 108px; }
.ddz-user-seat .seat-meta { font-size: 7.5px; }
.ddz-user-seat .seat-name-row { gap: 4px; }
.ddz-user-seat .seat-badge { font-size: 6.5px; padding: 2px 4px; }
.ddz-user-seat .seat-badge.landlord { background: linear-gradient(180deg, #f6dc9a, #c9953d); color: #4b2b08; border-color: rgba(255, 239, 190, .65); font-weight: 700; }
.ddz-user-seat .seat-user-count { color: rgba(227, 201, 147, .55); }
.ddz-user-seat .seat-bubble-slot {
  position: absolute;
  z-index: 70;
  left: 3px;
  bottom: 73px;
  width: 205px;
  pointer-events: none;
}
.ddz-user-seat.is-turn { background: linear-gradient(90deg, rgba(72, 75, 36, .22), transparent); }
.ddz-user-seat.is-landlord-seat .seat-name { color: #ffe4ad; }

.ddz-hand-wrap {
  position: absolute;
  z-index: 40;
  left: 180px;
  right: 156px;
  bottom: 0;
  height: calc(var(--cw, 90px) * 1.4 + 36px);
  --cw: clamp(66px, 6.5vw, 94px);
}
.ddz-hand { height: 100%; --cw: clamp(66px, 6.5vw, 94px); }
.ddz-hand .hand-inner { bottom: 2px; }
.ddz-hand.is-locked .pcard { pointer-events: none; }
.ddz-hand.is-locked .pcard:hover { --hover-lift: 0px; }
.ddz-hand:not(.is-locked) .hand-inner::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 8px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(245, 210, 137, .16), transparent 70%);
  filter: blur(3px);
  z-index: -1;
  pointer-events: none;
}
.ddz-hand-tools {
  position: absolute;
  right: 22px;
  bottom: 13px;
  z-index: 43;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.hand-sort-btn {
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 12px;
  padding: 0 8px;
  font-size: 8px;
  color: rgba(220, 206, 175, .6);
  border: 1px solid rgba(228, 194, 124, .14);
  background: rgba(4, 27, 21, .56);
  transition: .2s;
}
.hand-sort-btn:hover { color: #f1dfb9; border-color: rgba(228, 194, 124, .35); }
.hand-sort-btn svg { width: 10px; height: 10px; }
.ddz-hand-count {
  font-size: 7.5px;
  color: rgba(209, 195, 163, .36);
  letter-spacing: .4px;
  padding-right: 4px;
}

/* actions */
.ddz-actions {
  position: absolute;
  z-index: 55;
  left: 50%;
  bottom: 174px;
  transform: translateX(-50%);
  display: none;
}
.ddz-actions.visible { display: block; }
.ddz-actions .game-actionbar {
  position: static;
  transform: none;
  gap: 8px;
}
.ddz-actions .action-timer { margin-right: 2px; }
.ddz-actionbar .action-btn { min-width: 82px; height: 39px; }
.ddz-actionbar .action-btn.primary { min-width: 104px; }
.bid-spark { color: #9a631d; font-size: 10px; opacity: .7; }
.ddz-actions .countdown-warning { color: #ffb18f; }

/* bubble text */
.ddz-speech { max-width: 205px; font-family: var(--font-body); font-size: 10px; }

/* recent log (subtle) */
.ddz-recent { display: none; }

/* =========================================================
   Effects
   ========================================================= */
.ddz-mult-pop {
  position: absolute;
  z-index: 90;
  top: 43%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  animation: multPop 1.45s var(--ease-out) both;
}
.ddz-mult-pop span {
  display: block;
  font-family: var(--font-kai);
  font-size: 22px;
  letter-spacing: 2px;
  color: #f7dda5;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.ddz-mult-pop b {
  display: block;
  margin-top: 2px;
  font-family: "Georgia", serif;
  font-size: 42px;
  color: #ffd477;
  text-shadow: 0 0 26px rgba(244, 192, 91, .55), 0 3px 0 #674012;
}
@keyframes multPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  30% { transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; transform: translate(-50%, -50%) scale(1) translateY(-4px); }
  100% { opacity: 0; transform: translate(-50%, -72%) scale(.94); }
}
.ddz-bomb-fx {
  position: absolute;
  inset: 0;
  z-index: 85;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: bombFade 1.4s ease both;
}
.ddz-bomb-rays {
  position: absolute;
  width: min(760px, 80vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(248, 211, 120, .12) 0deg 6deg, transparent 6deg 19deg);
  mask-image: radial-gradient(circle, #000 5%, transparent 67%);
  animation: bombRays 1.2s var(--ease-out);
}
.ddz-bomb-fx span {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(62px, 10vw, 124px);
  letter-spacing: 10px;
  color: #ffe9ae;
  text-shadow: 0 0 34px rgba(255, 177, 76, .8), 0 4px 0 #8f4b15, 0 10px 30px rgba(0, 0, 0, .55);
  animation: bombTitle 1.3s var(--ease-spring) both;
}
.ddz-bomb-fx b {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  padding: 4px 14px;
  border-radius: 12px;
  color: #ffe3a0;
  border: 1px solid rgba(246, 205, 117, .34);
  background: rgba(68, 30, 10, .55);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  animation: bombSub 1.3s ease both;
}
@keyframes bombFade { 0% { opacity: 0; } 10% { opacity: 1; } 76% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bombRays { from { transform: scale(.4) rotate(0); opacity: 0; } 25% { opacity: 1; } to { transform: scale(1.18) rotate(20deg); opacity: 0; } }
@keyframes bombTitle { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 22% { transform: scale(1.08) rotate(2deg); opacity: 1; } 40% { transform: scale(1) rotate(0); } 100% { transform: scale(1.02); opacity: 1; } }
@keyframes bombSub { 0%, 20% { opacity: 0; transform: translateY(8px); } 35%, 85% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; } }

/* top sound icon + mute */
.ddz-screen .icon-sound-off { display: none; }
body.is-muted .ddz-screen .icon-sound-on { display: none; }
body.is-muted .ddz-screen .icon-sound-off { display: block; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1180px) {
  .ddz-hand-wrap { left: 158px; right: 116px; }
  .ddz-user-seat { left: 12px; min-width: 146px; }
  .ddz-user-seat .seat-avatar-wrap { width: 54px; height: 54px; }
  .ddz-user-seat .seat-name { max-width: 92px; font-size: 9.5px; }
  .ddz-opponent { top: 9.5%; }
  .ddz-play-slot.left { left: 19%; }
  .ddz-play-slot.right { right: 19%; }
  .ddz-opponent .opponent-stack { display: none; }
  .ddz-hand-tools { right: 14px; }
}
@media (max-width: 900px) {
  .ddz-arena::before { inset: 8px 10px 0; border-width: 5px; }
  .ddz-arena::after { inset: 19px 21px 8px; }
  .ddz-top-center { top: 8px; }
  .ddz-bottom-box { height: 53px; padding: 4px 9px 4px 6px; }
  .ddz-bottom-cards .pcard { --cw: 29px; }
  .ddz-bottom-label { height: 32px; font-size: 8px; }
  .ddz-bottom-meta { display: none; }
  .turntable-status { top: 84px; font-size: 8px; }
  .ddz-bid-center { top: 34%; width: 252px; min-height: 130px; padding: 14px 18px; }
  .ddz-bid-seal { width: 42px; height: 42px; font-size: 22px; }
  .ddz-bid-center h3 { font-size: 19px; }
  .ddz-opponent { top: 8%; padding: 4px 6px; gap: 6px; }
  .ddz-opponent-left { left: 2%; }
  .ddz-opponent-right { right: 2%; }
  .ddz-opponent .seat-avatar-wrap { width: 56px; height: 56px; }
  .ddz-opponent .seat-name { font-size: 10px; max-width: 76px; }
  .ddz-opponent .seat-meta { font-size: 7px; }
  .ddz-opponent .seat-bubble-slot { left: 69px; top: 56px; width: 150px; }
  .ddz-opponent-right .seat-bubble-slot { right: 69px; left: auto; }
  .ddz-play-slot.left { left: 19%; top: 39%; }
  .ddz-play-slot.right { right: 19%; top: 39%; }
  .ddz-play-slot .played-cards { --cw: 44px; }
  .ddz-play-slot .played-cards .pcard { --cw: 44px; }
  .ddz-play-slot .played-cards.small { --cw: 37px; }
  .ddz-play-slot .played-cards.small .pcard { --cw: 37px; }
  .ddz-play-slot.bottom { bottom: 173px; }
  .ddz-hand-wrap { left: 118px; right: 76px; --cw: clamp(55px, 7.6vw, 78px); }
  .ddz-hand { --cw: clamp(55px, 7.6vw, 78px); }
  .ddz-user-seat { left: 8px; bottom: 8px; min-width: 0; padding: 2px; background: none !important; }
  .ddz-user-seat .seat-avatar-wrap { width: 48px; height: 48px; }
  .ddz-user-seat .seat-info { display: none; }
  .ddz-user-seat .seat-bubble-slot { left: 0; bottom: 58px; width: 160px; }
  .ddz-hand-tools { right: 8px; bottom: 8px; }
  .ddz-hand-count { display: none; }
  .ddz-actions { bottom: 145px; }
  .ddz-actions .action-timer { display: grid; }
  .ddz-actions .action-btn { min-width: 68px; height: 34px; font-size: 10pt; padding: 0 14px; }
  .ddz-actionbar .action-btn.primary { min-width: 82px; }
  .ddz-screen .game-bean-pill { display: none; }
}
@media (max-width: 680px) {
  .ddz-top-center { transform: translateX(-50%) scale(.9); top: 5px; }
  .turntable-status { top: 74px; font-size: 7.5px; min-height: 21px; }
  .ddz-opponent { top: 7%; }
  .ddz-opponent .seat-avatar-wrap { width: 47px; height: 47px; }
  .ddz-opponent .level-pill { display: none; }
  .ddz-opponent .seat-name { font-size: 9px; max-width: 64px; }
  .ddz-opponent .seat-meta { font-size: 6.5px; }
  .ddz-opponent .seat-bubble-slot { left: 57px; top: 46px; width: 132px; }
  .ddz-opponent-right .seat-bubble-slot { right: 57px; left: auto; }
  .ddz-speech { font-size: 8.5px; max-width: 132px; padding: 5px 8px; }
  .ddz-play-slot.left { left: 16%; top: 43%; }
  .ddz-play-slot.right { right: 16%; top: 43%; }
  .ddz-play-slot.bottom { bottom: 142px; }
  .ddz-hand-wrap { left: 56px; right: 40px; --cw: clamp(44px, 10.5vw, 62px); }
  .ddz-hand { --cw: clamp(44px, 10.5vw, 62px); }
  .ddz-user-seat .seat-avatar-wrap { width: 40px; height: 40px; }
  .ddz-user-seat .seat-bubble-slot { bottom: 47px; }
  .ddz-actions { bottom: 116px; }
  .ddz-actions .action-btn { min-width: 56px; height: 30px; padding: 0 10px; font-size: 9px; }
  .ddz-actionbar .action-btn.primary { min-width: 66px; }
  .ddz-actions .kbd { display: none; }
  .ddz-bid-center { top: 31%; width: 225px; min-height: 116px; }
  .ddz-bid-seal { width: 37px; height: 37px; font-size: 19px; margin-bottom: 5px; }
  .ddz-bid-center h3 { font-size: 17px; }
  .ddz-bid-center p { font-size: 7.5px; }
  .ddz-bottom-cards .pcard { --cw: 24px; }
  .ddz-bottom-box { height: 45px; }
  .ddz-bottom-label { font-size: 7px; height: 27px; letter-spacing: 2px; }
  .ddz-pass-stamp { width: 42px; height: 42px; font-size: 12px; }
  .ddz-bomb-fx span { font-size: 58px; }
  .ddz-opponent .seat-info { overflow: hidden; }
  .ddz-play-slot .played-cards { --cw: 38px; }
  .ddz-play-slot .played-cards .pcard { --cw: 38px; }
}
@media (max-height: 720px) {
  .ddz-opponent { top: 7%; }
  .ddz-bid-center { top: 31%; }
  .ddz-actions { bottom: 154px; }
  .ddz-play-slot.bottom { bottom: 194px; }
  .ddz-seat .seat-avatar-wrap { width: 60px; height: 60px; }
  .ddz-user-seat .seat-avatar-wrap { width: 52px; height: 52px; }
  .ddz-hand-wrap { height: calc(var(--cw, 78px) * 1.4 + 36px); --cw: clamp(58px, 6vw, 82px); }
  .ddz-hand { --cw: clamp(58px, 6vw, 82px); }
}
@media (max-height: 520px) {
  .ddz-screen .game-topbar { height: 46px; flex-basis: 46px; }
  .ddz-brand, .ddz-screen .game-brand-mini p { display: none; }
  .ddz-bottom-box { height: 46px; padding: 3px 7px 3px 5px; }
  .ddz-bottom-cards .pcard { --cw: 24px; }
  .ddz-bottom-label { height: 28px; font-size: 7px; padding-right: 5px; }
  .ddz-bottom-meta { display: none; }
  .ddz-top-center { top: 5px; }
  .turntable-status { top: 66px; font-size: 7px; height: 20px; padding: 3px 9px; }
  .ddz-opponent { top: 5%; padding: 2px 4px; gap: 5px; }
  .ddz-opponent .seat-avatar-wrap { width: 40px; height: 40px; }
  .ddz-opponent .seat-name { font-size: 8.5px; max-width: 64px; }
  .ddz-opponent .seat-meta { font-size: 6px; }
  .ddz-opponent .level-pill { display: none; }
  .ddz-opponent .seat-bubble-slot { left: 48px; top: 39px; width: 126px; }
  .ddz-opponent-right .seat-bubble-slot { right: 48px; left: auto; }
  .ddz-bid-center { top: 28%; width: 208px; min-height: 90px; padding: 8px 16px; transform: translate(-50%, -50%) scale(.78); transform-origin: center; }
  .ddz-bid-seal { width: 34px; height: 34px; font-size: 17px; margin-bottom: 4px; }
  .ddz-bid-center h3 { font-size: 18px; }
  .ddz-play-slot.top, .ddz-play-slot.left, .ddz-play-slot.right { top: 34%; }
  .ddz-play-slot.left { left: 24%; }
  .ddz-play-slot.right { right: 24%; }
  .ddz-play-slot.left, .ddz-play-slot.right { transform: translate(-50%, -50%) scale(.8); }
  .ddz-play-slot.right { transform: translate(50%, -50%) scale(.8); }
  .ddz-play-slot.bottom { bottom: 136px; }
  .ddz-play-slot .played-cards { --cw: 31px; }
  .ddz-play-slot .played-cards .pcard { --cw: 31px; }
  .ddz-slot-label { font-size: 6.5px; margin-bottom: 2px; }
  .ddz-pass-stamp { width: 38px; height: 38px; font-size: 11px; }
  .ddz-user-seat { left: 5px; bottom: 2px; min-width: 0; padding: 2px; background: none !important; }
  .ddz-user-seat .seat-avatar-wrap { width: 38px; height: 38px; }
  .ddz-user-seat .seat-info { display: none; }
  .ddz-user-seat .seat-bubble-slot { left: 38px; bottom: 47px; width: 145px; }
  .ddz-actions { bottom: 104px; }
  .ddz-actions .action-btn { min-width: 58px; height: 29px; padding: 0 10px; font-size: 9px; }
  .ddz-actionbar .action-btn.primary { min-width: 72px; }
  .ddz-actions .action-timer { display: grid; }
  .ddz-actions .kbd { display: none; }
  .ddz-hand-wrap { left: 84px; right: 65px; height: 98px; --cw: 56px; }
  .ddz-hand { height: 98px; --cw: 56px; }
  .ddz-hand .hand-inner { bottom: 0; }
  .ddz-hand-tools { display: none; }
  .ddz-recent { display: none; }
  .ddz-bomb-fx span { font-size: 48px; letter-spacing: 4px; }
}
@media (max-height: 520px) and (max-width: 500px) {
  .ddz-hand-wrap { left: 6px; right: 6px; }
  .ddz-play-slot.top, .ddz-play-slot.left, .ddz-play-slot.right { top: 32%; }
  .ddz-play-slot.left { left: 13%; }
  .ddz-play-slot.right { right: 13%; }
  .ddz-bid-center { top: 26%; }
  .ddz-user-seat .seat-avatar-wrap { width: 34px; height: 34px; }
}

/* =========================================================
   斗地主 · 手机竖屏
   ========================================================= */
@media (max-width: 560px) and (orientation: portrait) {
  .ddz-screen .game-topbar {
    height: calc(48px + env(safe-area-inset-top));
    flex-basis: calc(48px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
    gap: 5px;
  }
  .ddz-screen .game-back { width: 29px; height: 29px; }
  .ddz-screen .game-back svg { width: 15px; height: 15px; }
  .ddz-screen .game-brand-mini { gap: 5px; }
  .ddz-screen .game-brand-mini .brand-coin { width: 27px; height: 27px; }
  .ddz-screen .game-brand-mini .brand-coin::before { inset: 8px; }
  .ddz-screen .game-brand-mini .brand-coin span { font-size: 9px; }
  .ddz-screen .game-brand-mini .brand-coin i { top: 5px; left: 8px; width: 7px; height: 4px; }
  .ddz-screen .game-brand-mini h2 { font-size: 13.5px; letter-spacing: .6px; }
  .ddz-screen .game-brand-mini p, .ddz-screen .game-divider-v { display: none; }
  .ddz-screen .game-room-info { display: none; }
  .ddz-screen .game-top-center { flex: 0 0 auto; margin-left: 2px; }
  .ddz-screen .game-top-stat { min-width: 44px; min-height: 28px; padding: 2px 6px; }
  .ddz-screen .game-top-stat:nth-child(2), .ddz-screen .game-top-stat:nth-child(3) { display: none; }
  .ddz-screen .game-top-stat span { font-size: 5.5px; letter-spacing: 0; }
  .ddz-screen .game-top-stat b { font-size: 11px; }
  .ddz-screen .game-top-actions { gap: 0; }
  .ddz-screen .game-top-actions .icon-btn { width: 28px; height: 28px; }
  .ddz-screen .game-top-actions .icon-btn svg { width: 16px; height: 16px; }
  .ddz-screen .game-top-actions .icon-btn[data-ddz-chat] { display: none; }
  .ddz-screen .game-top-actions .game-bean-pill { display: none; }

  .ddz-body::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 42%, rgba(57, 167, 124, .12), transparent 58%);
    pointer-events: none;
    z-index: 1;
  }
  .ddz-arena::before {
    inset: 2px 6px 0;
    border-width: 3px;
    border-radius: 46% 46% 2% 2% / 18% 18% 2% 2%;
    box-shadow: 0 0 0 1px rgba(162, 119, 59, .6), inset 0 0 80px rgba(0, 0, 0, .32);
  }
  .ddz-arena::after { inset: 10px 11px 4px; border-radius: 46% 46% 3% 3%; }
  .ddz-arena .table-center-mark { width: 155px; top: 45%; opacity: .7; }
  .ddz-arena .table-center-mark span { font-size: 48px; }

  .ddz-top-center { top: 3px; }
  .ddz-bottom-box { height: 43px; padding: 2px 7px 2px 4px; gap: 5px; border-radius: 9px; }
  .ddz-bottom-label { height: 29px; font-size: 6.5px; letter-spacing: 2px; padding-right: 4px; }
  .ddz-bottom-cards { height: 34px; gap: 2px; }
  .ddz-bottom-cards .pcard { --cw: 23px; }
  .ddz-bottom-meta { display: none; }
  .ddz-bottom-cards .pcard .card-corner { top: calc(var(--cw) * .05); left: calc(var(--cw) * .07); }
  .ddz-bottom-cards .pcard .card-corner .rank { font-size: 6px; }

  .turntable-status {
    top: 50px;
    max-width: calc(100vw - 120px);
    height: 21px;
    padding: 3px 10px;
    border-radius: 11px;
    font-size: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ddz-opponent {
    top: 76px;
    padding: 2px 3px;
    gap: 5px;
    background: rgba(3, 28, 22, .2);
    border-radius: 30px;
  }
  .ddz-opponent-left { left: 5px; }
  .ddz-opponent-right { right: 5px; }
  .ddz-opponent .seat-avatar-wrap { width: 42px; height: 42px; }
  .ddz-opponent .seat-avatar { border-width: 1.5px; }
  .ddz-opponent .level-pill { display: none; }
  .ddz-opponent .seat-info { padding-top: 1px; gap: 2px; }
  .ddz-opponent .seat-name { font-size: 9px; max-width: 62px; }
  .ddz-opponent .seat-meta { font-size: 6.5px; gap: 2px; }
  .ddz-opponent .seat-name-row { gap: 3px; }
  .ddz-opponent .seat-badge { font-size: 5.5px; padding: 1px 3px; }
  .ddz-opponent .seat-bubble-slot { top: 35px; left: 44px; width: 126px; }
  .ddz-opponent-right .seat-bubble-slot { left: auto; right: 44px; }
  .ddz-speech { max-width: 126px; font-size: 8px; padding: 5px 8px; }

  .ddz-bid-center {
    top: 31%;
    width: 218px;
    min-height: 102px;
    padding: 10px 16px 9px;
    border-radius: 13px;
  }
  .ddz-bid-seal { width: 37px; height: 37px; font-size: 19px; margin-bottom: 5px; }
  .ddz-bid-center h3 { font-size: 19px; letter-spacing: 3px; }
  .ddz-bid-center p { font-size: 7.5px; margin-top: 3px; }

  .ddz-play-slot.left { left: 28%; top: 42%; }
  .ddz-play-slot.right { right: 28%; top: 42%; }
  .ddz-play-slot.bottom { bottom: calc(166px + env(safe-area-inset-bottom)); }
  .ddz-play-slot .played-cards { --cw: 31px; }
  .ddz-play-slot .played-cards .pcard { --cw: 31px; }
  .ddz-play-slot .played-cards.small { --cw: 28px; }
  .ddz-play-slot .played-cards.small .pcard { --cw: 28px; }
  .ddz-slot-label { font-size: 6.5px; margin-bottom: 2px; padding: 1px 5px; }
  .ddz-play-slot .played-cards .pcard .card-corner .rank { font-size: 9px; }
  .ddz-pass-stamp { width: 38px; height: 38px; font-size: 11px; }

  .ddz-user-seat {
    left: 7px;
    bottom: calc(150px + env(safe-area-inset-bottom));
    padding: 2px;
    min-width: 0;
    background: none !important;
  }
  .ddz-user-seat .seat-avatar-wrap { width: 34px; height: 34px; }
  .ddz-user-seat .level-pill { display: none; }
  .ddz-user-seat .seat-info { display: none; }
  .ddz-user-seat .seat-bubble-slot { left: 36px; bottom: 35px; width: 140px; }
  .ddz-user-seat.is-turn .seat-avatar { border-color: rgba(255, 222, 146, .95); }

  .ddz-hand-wrap {
    left: max(4px, env(safe-area-inset-left));
    right: max(4px, env(safe-area-inset-right));
    bottom: max(4px, env(safe-area-inset-bottom));
    height: 104px;
    --cw: clamp(45px, 13.6vw, 56px);
  }
  .ddz-hand { height: 104px; --cw: clamp(45px, 13.6vw, 56px); }
  .ddz-hand .hand-inner { bottom: 0; }
  .ddz-hand .hand-inner .pcard { bottom: 15px; }
  .ddz-hand .pcard .card-corner .rank { font-size: calc(var(--cw) * .23); }
  .ddz-hand-tools { right: 6px; bottom: calc(108px + env(safe-area-inset-bottom)); }
  .ddz-hand-count { display: none; }
  .hand-sort-btn { min-height: 26px; font-size: 8px; }
  .ddz-actions {
    bottom: calc(112px + env(safe-area-inset-bottom));
    width: 100%;
    left: 0;
    transform: none;
    display: none;
    justify-content: center;
  }
  .ddz-actions.visible { display: flex; }
  .ddz-actions .game-actionbar {
    width: 100%;
    justify-content: center;
    gap: 6px;
    padding: 0 8px;
  }
  .ddz-actions .action-timer { display: grid; width: 32px; height: 32px; font-size: 12px; }
  .ddz-actions .action-btn {
    min-width: 64px;
    height: 36px;
    padding: 0 12px;
    font-size: 10px;
    border-radius: 18px;
  }
  .ddz-actionbar .action-btn.primary { min-width: 82px; }
  .ddz-actions .kbd { display: none; }
  .ddz-screen .game-toast, .ddz-bomb-fx { z-index: 90; }
  .ddz-bomb-fx span { font-size: 53px; letter-spacing: 5px; }
  .ddz-bomb-fx b { font-size: 8px; }
  .ddz-mult-pop b { font-size: 32px; }
  .ddz-screen + .chat-drawer, .ddz-screen .chat-drawer {
    right: 8px;
    left: 8px;
    bottom: calc(115px + env(safe-area-inset-bottom));
    width: auto;
  }
  .ddz-result-host .result-screen { padding: 14px; }
  .ddz-result-host .result-card { width: calc(100vw - 28px); padding: 20px 17px 17px; }
  .ddz-result-host .result-title { font-size: 30px; letter-spacing: 3px; }
  .ddz-result-host .result-score b { font-size: 28px; }
  .ddz-result-host .result-stat b { font-size: 11px; }
  .ddz-result-host .result-actions { gap: 8px; }
  .ddz-result-host .result-actions .gold-btn,
  .ddz-result-host .result-actions .ghost-btn { min-height: 37px; padding: 0 14px; font-size: 10px; }
  .chat-drawer { width: calc(100vw - 16px); left: 8px; right: 8px; bottom: calc(110px + env(safe-area-inset-bottom)); }
}
