/* =========================================================
   跑得快 · 三人牌桌
   ========================================================= */
.card-paodekuai .game-art {
  background:
    radial-gradient(ellipse at 72% 38%, rgba(245, 204, 118, .18), transparent 55%),
    linear-gradient(145deg, #123f56 0%, #0a2f43 55%, #061d2c 100%);
}
.card-paodekuai .art-seal {
  background: radial-gradient(circle at 35% 30%, rgba(45, 108, 145, .96), rgba(9, 43, 62, .96));
  color: #bfe6ff;
}
.card-paodekuai .hot-badge { background: linear-gradient(180deg, #3d8bb6, #185170); }
@media (min-width: 1180px) {
  .game-grid:has(.card-paodekuai) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.pdk-screen {
  --pdk-cw: clamp(54px, 5.2vw, 72px);
  background: #061e1b;
}
.pdk-body { position: relative; overflow: hidden; }
.pdk-arena {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(24, 105, 79, .46), transparent 60%),
    linear-gradient(180deg, #0b3f30 0%, #082e25 62%, #05201a 100%);
}
.pdk-arena::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,.012) 0 1px, transparent 1px 5px);
  pointer-events: none;
  opacity: .5;
}
.pdk-rim {
  position: absolute;
  inset: 16px 22px 6px;
  border: 7px solid #6d4a25;
  border-radius: 42% / 12%;
  box-shadow:
    0 0 0 1px rgba(245, 211, 140, .4) inset,
    0 0 0 3px rgba(28, 87, 65, .85),
    0 18px 46px rgba(0, 0, 0, .36);
  pointer-events: none;
}
.pdk-rim::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  border: 1px solid rgba(255, 225, 158, .18);
}
.pdk-watermark {
  position: absolute;
  left: 50%;
  top: 37%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  opacity: .1;
  pointer-events: none;
}
.pdk-watermark span {
  font-family: var(--font-kai);
  font-size: clamp(70px, 11vw, 150px);
  line-height: .9;
  color: #f7e3af;
  text-shadow: 0 10px 34px rgba(0, 0, 0, .5);
}
.pdk-watermark small { font-size: 8px; letter-spacing: 5px; color: #e8d19a; }

/* seats */
.pdk-seat {
  position: absolute;
  z-index: 15;
  top: 21%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 9px 6px 6px;
  border-radius: 34px 10px 10px 34px;
  background: linear-gradient(115deg, rgba(6, 39, 31, .7), rgba(1, 18, 14, .08));
  border: 1px solid rgba(231, 197, 128, .1);
  transition: border-color .2s, box-shadow .2s;
}
.pdk-seat-right { right: 14px; flex-direction: row-reverse; padding: 6px 6px 6px 9px; border-radius: 10px 34px 34px 10px; }
.pdk-seat-left { left: 14px; }
.pdk-seat.is-turn {
  border-color: rgba(247, 209, 126, .66);
  box-shadow: 0 0 0 1px rgba(247, 209, 126, .22), 0 0 24px rgba(239, 190, 78, .18);
}
.pdk-seat.is-turn::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1px solid rgba(247, 211, 135, .25);
  animation: pdkTurn 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pdkTurn { 0%,100% { opacity: .35; transform: scale(.99); } 50% { opacity: .95; transform: scale(1.01); } }
.pdk-seat-avatar { position: relative; width: 48px; height: 48px; flex: 0 0 auto; }
.pdk-seat-avatar .seat-avatar { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; border: 1px solid rgba(220, 186, 119, .25); }
.pdk-level {
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  padding: 1px 5px;
  border-radius: 7px;
  background: rgba(2, 22, 16, .86);
  border: 1px solid rgba(221, 186, 112, .23);
  color: #dcc188;
  font-size: 5px;
  white-space: nowrap;
}
.pdk-seat-copy { display: flex; flex-direction: column; min-width: 0; }
.pdk-seat-copy b { font-size: 10px; font-weight: 500; color: #efe1c3; white-space: nowrap; }
.pdk-seat-copy small { font-size: 7px; color: rgba(205, 192, 164, .56); margin-top: 2px; }
.pdk-seat-copy em { font-style: normal; font-size: 6px; color: rgba(186, 174, 146, .42); margin-top: 1px; }
.pdk-seat.is-turn .pdk-seat-copy em { color: #f0cf8b; }
.pdk-seat-stack {
  position: relative;
  width: 38px;
  height: 54px;
  flex: 0 0 auto;
}
.pdk-seat-stack .back-stack { position: absolute; inset: 0; }
.pdk-seat-stack .back-stack .pcard { --cw: 26px; position: absolute; }
.pdk-seat-stack .back-stack .pcard:nth-child(1) { left: 0; top: 3px; }
.pdk-seat-stack .back-stack .pcard:nth-child(2) { left: 5px; top: 1px; }
.pdk-seat-stack .back-stack .pcard:nth-child(3) { left: 10px; top: 4px; }
.pdk-seat-stack .back-stack .pcard:nth-child(4) { left: 15px; top: 2px; }
.pdk-bubble {
  position: absolute;
  z-index: 35;
  top: 72%;
  left: 50%;
  transform: translate(-50%, 8px);
  padding: 4px 10px;
  border-radius: 11px;
  background: rgba(4, 31, 23, .92);
  border: 1px solid rgba(229, 195, 128, .22);
  color: #e9d5a5;
  font-size: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s, transform .16s;
}
.pdk-bubble.is-show { opacity: 1; transform: translate(-50%, 0); }
.pdk-bubble.bomb { color: #ffd88e; border-color: rgba(255, 177, 93, .48); }

/* table / turn */
.pdk-table-play {
  position: absolute;
  z-index: 18;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  min-width: 170px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}
.pdk-table-label {
  padding: 2px 9px;
  border-radius: 9px;
  background: rgba(2, 24, 17, .56);
  border: 1px solid rgba(229, 195, 126, .12);
  color: rgba(219, 205, 172, .54);
  font-size: 7px;
  white-space: nowrap;
}
.pdk-table-cards .played-cards { --cw: 42px; filter: drop-shadow(0 7px 12px rgba(0, 0, 0, .35)); }
.pdk-table-cards .played-cards .pcard { --cw: 42px; }
.pdk-turn-status {
  position: absolute;
  z-index: 25;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(229, 195, 123, .18);
  background: rgba(3, 28, 21, .65);
  color: rgba(228, 211, 175, .75);
  font-size: 8px;
  letter-spacing: .3px;
  white-space: nowrap;
  transition: opacity .18s, border-color .18s;
}
.pdk-turn-status i { width: 5px; height: 5px; border-radius: 50%; background: #d8b467; box-shadow: 0 0 8px rgba(233, 191, 96, .55); }
.pdk-turn-status.your-turn { color: #ffe3a2; border-color: rgba(247, 210, 130, .38); }
.pdk-turn-status.thinking i { animation: pdkBlink 1s ease-in-out infinite; }
@keyframes pdkBlink { 50% { opacity: .25; } }

/* user / hand */
.pdk-user-seat {
  position: absolute;
  z-index: 20;
  left: 14px;
  bottom: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 7px 4px 4px;
  border-radius: 10px;
  background: linear-gradient(115deg, rgba(5, 39, 30, .72), rgba(2, 20, 15, .16));
  border: 1px solid rgba(229, 195, 123, .09);
}
.pdk-user-seat .seat-avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; border: 1px solid rgba(220, 186, 119, .23); }
.pdk-user-seat b { display: block; font-size: 9px; color: #e8dcc1; font-weight: 500; }
.pdk-user-seat small { display: block; margin-top: 2px; font-size: 7px; color: rgba(204, 190, 159, .46); }
.pdk-user-seat.is-turn {
  border-color: rgba(247, 209, 126, .55);
  box-shadow: 0 0 18px rgba(239, 190, 78, .16);
}
.pdk-hand-wrap {
  position: absolute;
  z-index: 22;
  left: 128px;
  right: 92px;
  bottom: max(2px, env(safe-area-inset-bottom));
  height: calc(var(--pdk-cw) * 1.4 + 18px);
  --cw: var(--pdk-cw);
}
.pdk-hand {
  height: 100%;
  min-height: 0;
  --cw: var(--pdk-cw);
}
.pdk-hand .hand-inner { bottom: 0; }
.pdk-hand .hand-inner .pcard { bottom: 16px; }
.pdk-hand.is-locked .pcard { pointer-events: none; }
.pdk-hand.is-shaking { animation: pdkHandShake .35s ease; }
@keyframes pdkHandShake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  55% { transform: translateX(4px); }
  80% { transform: translateX(-2px); }
}
.pdk-hand-tools {
  position: absolute;
  z-index: 35;
  right: 10px;
  bottom: calc(var(--pdk-cw) * 1.4 + 26px);
  display: flex;
  align-items: center;
  gap: 4px;
}
.pdk-hand-tools .hand-sort-btn { min-height: 24px; }
.pdk-hand-tools .pdk-must { color: rgba(213, 198, 163, .48); }
.pdk-hand-tools .pdk-must.is-on {
  color: #ffe1a0;
  border-color: rgba(247, 204, 111, .45);
  background: rgba(78, 51, 16, .65);
  box-shadow: 0 0 14px rgba(239, 190, 83, .14);
}
.pdk-hand-count { font-size: 7px; color: rgba(205, 192, 160, .38); padding-right: 2px; }

/* actions */
.pdk-actions {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: 148px;
  transform: translateX(-50%);
  display: none;
}
.pdk-actions.visible { display: block; }
.pdk-actionbar { position: static; transform: none; gap: 8px; }
.pdk-timer { display: grid; }
.pdk-timer.warning { color: #ffb18a; animation: pdkTimerWarn .8s ease-in-out infinite; }
@keyframes pdkTimerWarn { 50% { box-shadow: 0 0 0 4px rgba(255, 128, 90, .12); } }

/* result */
.pdk-result-host { position: absolute; inset: 0; z-index: 300; pointer-events: none; }
.pdk-result-host:empty { display: none; }
.pdk-result-host .result-screen { pointer-events: auto; }
.pdk-result-card { width: min(520px, calc(100vw - 28px)); }
.pdk-result-rows {
  margin-top: 9px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px solid rgba(220, 186, 119, .12);
  padding-top: 7px;
}
.pdk-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .018);
  font-size: 8px;
  color: rgba(223, 211, 181, .74);
}
.pdk-result-row.me { background: rgba(232, 193, 111, .07); border: 1px solid rgba(232, 193, 111, .14); }
.pdk-result-row > span { flex: 1; }
.pdk-result-row small { color: rgba(184, 173, 149, .45); }
.pdk-result-row b { font-family: Georgia, serif; font-size: 10px; }
.pdk-result-row b.gain { color: #f6d58d; }
.pdk-result-row b.loss { color: #a8b0a6; }
.pdk-result-card .result-actions { margin-top: 10px; }

.pdk-start-banner {
  position: absolute;
  z-index: 120;
  left: 50%;
  top: 35%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 15px 42px;
  border-radius: 12px;
  border: 1px solid rgba(232, 197, 126, .3);
  background: rgba(2, 30, 23, .74);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .42);
  pointer-events: none;
  animation: pdkBanner 1.8s ease both;
}
.pdk-start-banner span { font-family: var(--font-display); font-size: 29px; letter-spacing: 6px; color: #f7e5ba; }
.pdk-start-banner small { font-size: 7px; letter-spacing: 3px; color: rgba(211, 194, 155, .48); }
@keyframes pdkBanner {
  0% { opacity: 0; transform: translate(-50%, -44%) scale(.94); }
  16%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -54%) scale(1.02); }
}

@media (max-width: 1000px) and (max-height: 560px) and (orientation: landscape) {
  .pdk-screen {
    --pdk-cw: clamp(44px, 6.7vw, 58px);
  }
  .pdk-rim { inset: 10px 13px 4px; border-width: 4px; }
  .pdk-seat { top: 23%; padding: 4px 6px 4px 4px; gap: 5px; }
  .pdk-seat-right { right: 7px; padding: 4px 4px 4px 6px; }
  .pdk-seat-left { left: 7px; }
  .pdk-seat-avatar { width: 36px; height: 36px; }
  .pdk-level { display: none; }
  .pdk-seat-copy b { font-size: 8px; }
  .pdk-seat-copy small { font-size: 6px; }
  .pdk-seat-copy em { font-size: 5px; }
  .pdk-seat-stack { width: 30px; height: 44px; }
  .pdk-seat-stack .back-stack .pcard { --cw: 22px; }
  .pdk-bubble { font-size: 6px; padding: 3px 6px; top: 78%; }
  .pdk-turn-status { top: 15%; min-height: 21px; padding: 0 9px; font-size: 7px; }
  .pdk-table-play { top: 40%; min-height: 48px; gap: 3px; }
  .pdk-table-label { font-size: 6px; padding: 1px 6px; }
  .pdk-table-cards .played-cards { --cw: 32px; }
  .pdk-table-cards .played-cards .pcard { --cw: 32px; }
  .pdk-user-seat { left: 6px; bottom: 4px; padding: 2px 4px 2px 2px; }
  .pdk-user-seat .seat-avatar { width: 30px; height: 30px; }
  .pdk-user-seat b { font-size: 7px; }
  .pdk-user-seat small { font-size: 6px; }
  .pdk-hand-wrap {
    left: 52px;
    right: 42px;
    bottom: max(1px, env(safe-area-inset-bottom));
    height: calc(var(--pdk-cw) * 1.4 + 15px);
  }
  .pdk-hand .hand-inner .pcard { bottom: 13px; }
  .pdk-hand-tools { right: 5px; bottom: calc(var(--pdk-cw) * 1.4 + 21px); gap: 3px; }
  .pdk-hand-tools .hand-sort-btn { height: 21px; min-height: 21px; padding: 0 6px; font-size: 7px; }
  .pdk-hand-count { display: none; }
  .pdk-actions { bottom: calc(clamp(102px, 15.5vw, 126px) + env(safe-area-inset-bottom)); }
  .pdk-actions .action-timer { width: 32px; height: 32px; font-size: 11px; }
  .pdk-actions .action-btn { min-width: 60px; height: 34px; font-size: 9.5px; padding: 0 12px; }
  .pdk-actions .action-btn.primary { min-width: 78px; }
  .pdk-result-card { width: min(460px, calc(100vw - 20px)); padding: 15px 17px 13px; }
  .pdk-result-card .result-title { font-size: 26px; }
  .pdk-result-rows { margin-top: 5px; gap: 2px; }
  .pdk-result-row { padding: 3px 5px; font-size: 7px; }
  .pdk-start-banner { padding: 10px 30px; }
  .pdk-start-banner span { font-size: 23px; }
}

@media (max-width: 560px) and (orientation: portrait) {
  .pdk-screen { --pdk-cw: 34px; }
  .pdk-rim { inset: 8px 10px 4px; border-width: 4px; }
  .pdk-seat { top: 18%; padding: 4px 6px 4px 4px; gap: 4px; }
  .pdk-seat-right { right: 5px; }
  .pdk-seat-left { left: 5px; }
  .pdk-seat-avatar { width: 34px; height: 34px; }
  .pdk-seat-copy b { font-size: 8px; }
  .pdk-seat-copy small { font-size: 6px; }
  .pdk-seat-copy em { display: none; }
  .pdk-seat-stack { display: none; }
  .pdk-turn-status { top: 12%; font-size: 7px; }
  .pdk-table-play { top: 41%; }
  .pdk-table-cards .played-cards { --cw: 31px; }
  .pdk-table-cards .played-cards .pcard { --cw: 31px; }
  .pdk-user-seat { left: 4px; bottom: 3px; }
  .pdk-user-seat .seat-avatar { width: 30px; height: 30px; }
  .pdk-hand-wrap { left: 38px; right: 28px; bottom: 1px; height: calc(var(--pdk-cw) * 1.4 + 12px); }
  .pdk-hand-tools { left: 8px; right: auto; bottom: 105px; }
  .pdk-hand-tools .hand-sort-btn { height: 24px; font-size: 7px; }
  .pdk-hand-count { display: none; }
  .pdk-actions { bottom: 126px; }
  .pdk-actions .action-timer { width: 31px; height: 31px; font-size: 10px; }
  .pdk-actions .action-btn { min-width: 62px; height: 34px; font-size: 9px; padding: 0 10px; }
  .pdk-actions .action-btn.primary { min-width: 78px; }
  .pdk-result-card { width: calc(100vw - 18px); padding: 16px 14px 14px; }
  .pdk-result-card .result-title { font-size: 27px; }
  .pdk-result-rows { gap: 2px; }
  .pdk-result-row { font-size: 7px; }
  .pdk-start-banner { padding: 11px 28px; }
  .pdk-start-banner span { font-size: 23px; }
}
