/* =========================================================
   单机斗地主 · LANDLORD
   深色克制风格，与迅易达官网保持一致
   所有图形由 HTML / CSS 绘制，无外部图片与字体
   ========================================================= */

:root {
  --ink: #070b09;
  --panel: #0c130f;
  --panel-2: #101a14;
  --paper: #f4f5ef;
  --white: #fbfcf8;
  --acid: #d8f36b;
  --acid-strong: #c9ee4a;
  --teal: #77e7c5;
  --gold: #f0cf74;
  --coral: #ff8377;
  --muted: #93a39a;
  --muted-dim: #617069;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --card-face: #f7f6ee;
  --card-ink: #16201a;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC",
    "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --card-w: 54px;
  --card-h: 77px;
  --rank-size: 15px;
  --suit-size: 12px;
  --pip-size: 22px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #070b09;
  color: var(--paper);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button {
  font-family: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
}

h1,
h2,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(120% 52% at 50% 30%, rgba(40, 74, 55, 0.26) 0%, rgba(7, 11, 9, 0) 64%),
    radial-gradient(80% 40% at 50% 100%, rgba(216, 243, 107, 0.05) 0%, rgba(7, 11, 9, 0) 60%),
    #070b09;
}

@media (min-width: 620px) {
  .app {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 50px;
  height: calc(50px + env(safe-area-inset-top, 0px));
  padding: 0 12px;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0c130f 0%, #090e0b 100%);
  z-index: 5;
}

.back-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.back-links a {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 5px 4px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  transition: color 0.18s ease;
}

.back-links a:hover {
  color: var(--acid);
}

.back-links svg {
  width: 12px;
  height: 12px;
}

.title-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.title-mark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.title-mark i {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: var(--acid);
}

.title-mark i:nth-child(1) { height: 8px; opacity: 0.55; }
.title-mark i:nth-child(2) { height: 12px; opacity: 0.8; }
.title-mark i:nth-child(3) { height: 16px; }

.title-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
  min-width: 0;
}

.title-copy strong {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.title-copy em {
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 7.5px;
  font-style: normal;
  letter-spacing: 0.22em;
  white-space: nowrap;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.tag {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.sound-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.015);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

/* 扩大触控热区，不改变顶栏布局 */
.sound-toggle::before {
  content: "";
  position: absolute;
  inset: -6px;
}

.sound-toggle svg {
  width: 15px;
  height: 15px;
  overflow: visible;
}

.sound-toggle .sound-body {
  fill: currentColor;
}

.sound-toggle .sound-wave,
.sound-toggle .sound-slash {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
}

.sound-toggle .sound-slash {
  display: none;
  stroke: var(--coral);
  stroke-width: 1.5;
}

.sound-toggle.muted {
  color: var(--muted-dim);
}

.sound-toggle.muted .sound-wave {
  display: none;
}

.sound-toggle.muted .sound-slash {
  display: block;
}

.sound-toggle:hover {
  color: var(--acid);
  border-color: rgba(216, 243, 107, 0.4);
}

.sound-toggle.muted:hover {
  color: var(--coral);
  border-color: rgba(255, 131, 119, 0.4);
}

/* ---------------- 牌桌 ---------------- */

.stage {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 8px 10px 0;
  isolation: isolate;
}

.stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 47%;
  width: 86%;
  height: 54%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(216, 243, 107, 0.075);
  border-radius: 50%;
  box-shadow: inset 0 0 70px rgba(119, 231, 197, 0.035);
  pointer-events: none;
  z-index: -1;
}

.stage::after {
  content: "♠";
  position: absolute;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -54%);
  color: rgba(216, 243, 107, 0.028);
  font-size: 150px;
  line-height: 1;
  pointer-events: none;
  z-index: -1;
}

.seats {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 4px;
}

.seat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 132px;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.seat-right {
  flex-direction: row-reverse;
  justify-self: end;
  text-align: right;
}

.avatar {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #0c130f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.avatar::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(216, 243, 107, 0);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.avatar-a {
  background: linear-gradient(150deg, #b7f0d8 0%, #77e7c5 45%, #3fa88a 100%);
}

.avatar-b {
  background: linear-gradient(150deg, #ffe7ae 0%, #f0cf74 50%, #b78a2e 100%);
}

.avatar-me {
  width: 26px;
  height: 26px;
  font-size: 11px;
  background: linear-gradient(150deg, #effbb0 0%, #d8f36b 50%, #9cb832 100%);
}

.seat-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.seat-copy strong {
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.seat-copy em {
  color: var(--muted-dim);
  font-size: 9.5px;
  font-style: normal;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.seat-copy em b {
  color: var(--acid);
  font-size: 11.5px;
  font-weight: 700;
}

.seat.is-turn {
  background: rgba(216, 243, 107, 0.06);
  border-color: rgba(216, 243, 107, 0.22);
}

.seat.is-turn .avatar::after {
  border-color: rgba(216, 243, 107, 0.45);
  box-shadow: 0 0 12px rgba(216, 243, 107, 0.25);
}

.seat.is-thinking .avatar {
  animation: avatar-pulse 1.1s ease-in-out infinite;
}

@keyframes avatar-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}

.role-badge {
  position: absolute;
  top: -5px;
  left: 30px;
  padding: 1px 5px;
  border-radius: 999px;
  border: 1px solid rgba(240, 207, 116, 0.5);
  background: rgba(240, 207, 116, 0.12);
  color: var(--gold);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.role-badge.farmer {
  border-color: rgba(119, 231, 197, 0.42);
  background: rgba(119, 231, 197, 0.1);
  color: var(--teal);
}

.seat-right .role-badge {
  left: auto;
  right: 30px;
}

.bid-badge {
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(119, 231, 197, 0.12);
  border: 1px solid rgba(119, 231, 197, 0.3);
  color: var(--teal);
  font-size: 7.5px;
  white-space: nowrap;
  z-index: 3;
}

/* 每家最后打出的一手牌：紧贴座位下方，横跨整行，长牌自动换行不溢出 */

.seat-play-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 1px 4px 0;
}

.seat-play-row[hidden] {
  display: none !important;
}

.seat-play-row.row-right {
  justify-content: flex-end;
}

.seat-play-cap {
  flex: 0 0 auto;
  color: var(--muted-dim);
  font-size: 8px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.seat-play {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.seat-play .mini-card {
  margin-left: -12px;
}

.seat-play .mini-card:first-child {
  margin-left: 0;
}

.seat-play.dense .mini-card {
  margin-left: -14px;
}

/* 底牌 */

.deck-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding-top: 3px;
  min-width: 94px;
}

.deck-label {
  color: var(--muted-dim);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.bottom-row {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 38px;
}

.mini-card {
  position: relative;
  flex: 0 0 auto;
  width: 26px;
  height: 36px;
  border-radius: 4px;
  background: var(--card-face);
  border: 1px solid #d7d7c8;
  color: var(--card-ink);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.mini-card .mc-rank {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.mini-card .mc-suit {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 11px;
  line-height: 1;
}

.mini-card.red .mc-suit,
.mini-card.red .mc-rank {
  color: #cf4438;
}

.mini-card.joker {
  background: linear-gradient(160deg, #fffdf2 0%, #f4e9c6 100%);
}

.mini-card.joker .mc-rank {
  top: 3px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 9px;
}

.mini-card.joker .mc-suit {
  left: 0;
  right: 0;
  bottom: 3px;
  text-align: center;
  font-size: 7px;
  letter-spacing: 0.05em;
}

/* 出牌区专用：点数和花色集中在左上角，叠放后仍能看清 */
.mini-card.strip-card .mc-rank {
  top: 2px;
  left: 2px;
  font-size: 9px;
  letter-spacing: -0.03em;
}

.mini-card.strip-card .mc-suit {
  top: 12px;
  left: 2px;
  right: auto;
  bottom: auto;
  font-size: 9px;
}

.mini-card.strip-card.joker .mc-rank {
  top: 2px;
  left: 3px;
  right: auto;
  text-align: left;
  font-size: 8px;
}

.mini-card.strip-card.joker .mc-suit {
  top: 11px;
  left: 3px;
  right: auto;
  bottom: auto;
  text-align: left;
  font-size: 7px;
}

/* 长牌型末尾的「+N」提示 */
.card-more {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin-left: 4px;
  padding: 0 4px;
  border: 1px solid rgba(216, 243, 107, 0.32);
  border-radius: 6px;
  background: rgba(216, 243, 107, 0.08);
  color: var(--acid);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0;
}

.seat-play .card-more {
  min-width: 22px;
  height: 22px;
  margin-left: 3px;
  font-size: 8px;
}

.mini-card.back {
  background:
    repeating-linear-gradient(45deg, rgba(216, 243, 107, 0.1) 0 2px, transparent 2px 6px),
    linear-gradient(155deg, #1a2c21 0%, #0f1b14 100%);
  border-color: rgba(216, 243, 107, 0.25);
}

.mini-card.back::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(216, 243, 107, 0.25);
  border-radius: 2px;
}

.bottom-row .mini-card {
  animation: bottom-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.bottom-row .mini-card:nth-child(2) { animation-delay: 0.05s; }
.bottom-row .mini-card:nth-child(3) { animation-delay: 0.1s; }

@keyframes bottom-in {
  from { opacity: 0; transform: translateY(-8px) rotate(-4deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

/* 中央出牌区 */

.table-center {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding-top: 12px;
}

.play-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 16px;
}

.play-label {
  color: var(--muted-dim);
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

.multiplier {
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(216, 243, 107, 0.28);
  background: rgba(216, 243, 107, 0.08);
  color: var(--acid);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
}

.played {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
  width: 100%;
  min-height: 52px;
  padding: 8px 4px 2px;
  overflow: hidden;
}

.played .mini-card {
  margin-left: -12px;
  box-shadow: -2px 2px 6px rgba(0, 0, 0, 0.32);
  animation: play-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.played .mini-card:first-child {
  margin-left: 0;
}

.played.dense .mini-card {
  margin-left: -14px;
}

.played .card-more {
  margin-left: 6px;
}

@keyframes play-in {
  from { opacity: 0; transform: translateY(10px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.played .empty-hint {
  color: var(--muted-dim);
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

/* 赢家最后一手：中央放大展示，等待结算 */

.played.final {
  min-height: 62px;
  padding-top: 10px;
}

.played.final .mini-card {
  width: 36px;
  height: 50px;
  margin-left: -8px;
  border-width: 2px;
  box-shadow: 0 0 18px rgba(216, 243, 107, 0.3), -2px 2px 8px rgba(0, 0, 0, 0.42);
  animation: final-in 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.played.final .mini-card .mc-rank {
  top: 2px;
  left: 3px;
  font-size: 13px;
}

.played.final .mini-card .mc-suit {
  top: 18px;
  left: 3px;
  right: auto;
  bottom: auto;
  font-size: 12px;
}

.played.final .mini-card.joker .mc-rank {
  font-size: 11px;
}

.played.final .mini-card.joker .mc-suit {
  font-size: 8px;
}

.played.final .card-more {
  min-width: 32px;
  height: 34px;
  margin-left: 7px;
  font-size: 12px;
}

@keyframes final-in {
  from { opacity: 0; transform: scale(0.86) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.banner {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  min-height: 20px;
  padding: 2px 10px;
  color: var(--acid);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  text-align: center;
  opacity: 0.92;
  transition: opacity 0.2s ease;
}

.banner.soft {
  color: var(--muted);
}

.banner.warn {
  color: var(--coral);
}

.banner.emph {
  animation: banner-emph 0.7s ease;
}

@keyframes banner-emph {
  0% { transform: scale(0.94); opacity: 0.2; }
  32% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0.92; }
}

/* ---------------- 玩家区 ---------------- */

.player-zone {
  position: relative;
  flex: 0 0 auto;
  padding: 3px 10px 0;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 19, 15, 0.5) 0%, #080d0a 100%);
}

.player-zone.is-turn {
  border-top-color: rgba(216, 243, 107, 0.28);
}

.seat.bid-flash,
.player-zone.bid-flash {
  animation: bid-flash 0.7s ease;
}

@keyframes bid-flash {
  0% { box-shadow: inset 0 0 0 0 rgba(216, 243, 107, 0); }
  35% { box-shadow: inset 0 0 0 1px rgba(216, 243, 107, 0.5), 0 0 18px rgba(216, 243, 107, 0.16); }
  100% { box-shadow: inset 0 0 0 0 rgba(216, 243, 107, 0); }
}

.player-head {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 25px;
}

.player-name {
  font-size: 11.5px;
  font-weight: 700;
}

.player-count {
  margin-left: auto;
  color: var(--muted-dim);
  font-size: 9.5px;
  letter-spacing: 0.03em;
}

.player-count b {
  color: var(--acid);
  font-size: 12.5px;
  font-weight: 700;
}

.role-me {
  position: static;
  margin-left: 2px;
  padding: 1px 5px;
}

.trust-tag {
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(240, 207, 116, 0.12);
  border: 1px solid rgba(240, 207, 116, 0.32);
  color: var(--gold);
  font-size: 7.5px;
  white-space: nowrap;
}

.hand-wrap {
  position: relative;
  width: 100%;
  height: calc(var(--card-h) + 36px);
  margin-top: 1px;
  padding: 0 6px;
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.hand {
  position: absolute;
  inset: 0 6px;
  touch-action: none;
}

.card {
  position: absolute;
  top: 34px;
  left: 0;
  width: var(--card-w);
  height: var(--card-h);
  padding: 0;
  border: 1px solid #d9d9ca;
  border-radius: 6px;
  background: linear-gradient(158deg, #ffffff 0%, var(--card-face) 55%, #ecebdd 100%);
  color: var(--card-ink);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  transform: translateY(var(--arc, 0px)) rotate(var(--rot, 0deg));
  transform-origin: 50% 92%;
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.16s ease;
  will-change: transform;
  z-index: 1;
}

.card:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
  z-index: 200;
}

/* 选中的牌整体抬到牌列上方，露出完整的点数与花色；
   保持自然层叠顺序，右侧未选中的牌仍能完整显示。 */
.card.selected {
  border-color: rgba(240, 207, 116, 0.9);
  transform: translateY(calc(var(--arc, 0px) - 34px)) rotate(var(--rot, 0deg)) scale(1.03);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.52),
    0 0 0 2px var(--gold),
    0 0 0 5px rgba(240, 207, 116, 0.2),
    0 -10px 20px rgba(240, 207, 116, 0.1);
}

.card.selected .c-corner {
  color: #0e1a12;
}

.card .c-corner {
  position: absolute;
  top: 3px;
  left: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-weight: 800;
}

.card .c-corner b {
  font-size: var(--rank-size);
  letter-spacing: -0.04em;
}

.card[data-rank="10"] .c-corner b {
  font-size: calc(var(--rank-size) * 0.84);
  letter-spacing: -0.09em;
}

.card .c-corner i {
  margin-top: 1px;
  font-size: var(--suit-size);
  font-style: normal;
}

.card .c-pip {
  position: absolute;
  right: 4px;
  bottom: 4px;
  font-size: var(--pip-size);
  line-height: 1;
  opacity: 0.92;
}

.card.red {
  color: #c33f35;
}

.card.joker {
  background:
    radial-gradient(80% 60% at 50% 30%, rgba(216, 243, 107, 0.22) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(158deg, #fffdf2 0%, #f3e9c8 60%, #e7d9a9 100%);
  border-color: #d8c78d;
  color: #5a4716;
}

.card.joker .c-joker {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.card.joker .c-joker b {
  font-size: calc(var(--rank-size) * 1.18);
  font-weight: 800;
  line-height: 1;
}

.card.joker .c-joker em {
  font-family: var(--mono);
  font-size: 6.5px;
  font-style: normal;
  letter-spacing: 0.14em;
  opacity: 0.65;
}

.card.joker.big .c-joker b {
  color: #b3342f;
}

.card.joker .c-star {
  font-size: calc(var(--suit-size) * 0.9);
  line-height: 1;
  opacity: 0.7;
}

/* 出牌按钮 */

.action-row {
  display: flex;
  gap: 8px;
  padding: 3px 0 4px;
}

.act {
  flex: 1 1 0;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #111a15;
  color: var(--paper);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  transition: transform 0.12s ease, background 0.18s ease, opacity 0.18s ease, border-color 0.18s ease;
}

.act:active:not(:disabled) {
  transform: scale(0.97);
}

.act.primary {
  flex: 1.5 1 0;
  border-color: transparent;
  background: linear-gradient(180deg, #e4fa8c 0%, var(--acid) 46%, var(--acid-strong) 100%);
  color: #10180f;
  box-shadow: 0 4px 18px rgba(216, 243, 107, 0.16);
}

.act.primary:disabled {
  background: #1a241d;
  color: rgba(244, 245, 239, 0.35);
  box-shadow: none;
}

.act:disabled {
  opacity: 0.32;
  cursor: default;
}

.act:not(:disabled):hover {
  border-color: rgba(216, 243, 107, 0.45);
}

.act.shake {
  animation: act-shake 0.3s ease;
}

@keyframes act-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  55% { transform: translateX(4px); }
  80% { transform: translateX(-2px); }
}

.hand.drag-up {
  cursor: grabbing;
}

.hand.drag-up .card.selected {
  box-shadow:
    0 16px 28px rgba(0, 0, 0, 0.58),
    0 0 0 2px var(--gold),
    0 0 0 5px rgba(240, 207, 116, 0.24);
}

.act.primary:not(:disabled):hover {
  border-color: transparent;
  filter: brightness(1.04);
}

.util-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 4px;
}

.util {
  height: 23px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.util:hover {
  color: var(--acid);
  border-color: rgba(216, 243, 107, 0.35);
}

.util.active {
  color: var(--ink);
  background: var(--acid);
  border-color: var(--acid);
  font-weight: 700;
}

.status {
  margin-left: auto;
  overflow: hidden;
  color: var(--muted-dim);
  font-size: 9px;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 页脚 ---------------- */

.foot {
  flex: 0 0 auto;
  padding: 5px 10px 7px;
  padding-bottom: calc(7px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: #080d0a;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3px 13px;
}

.foot-nav a {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.foot-nav a:hover {
  color: var(--acid);
}

.foot p {
  margin-top: 3px;
  color: var(--muted-dim);
  font-size: 7.5px;
  letter-spacing: 0.03em;
  text-align: center;
}

/* ---------------- 弹层 ---------------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 7, 5, 0.68);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.overlay.bid {
  background: rgba(4, 7, 5, 0.16);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.sheet {
  width: min(100%, 330px);
  padding: 20px 18px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(216, 243, 107, 0.08) 0%, rgba(12, 19, 15, 0) 65%),
    linear-gradient(180deg, #111c16 0%, #0a100c 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  text-align: center;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.overlay.is-open .sheet {
  transform: translateY(0) scale(1);
}

.sheet-kicker {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.24em;
}

.sheet h2 {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.sheet-desc {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.sheet-desc b {
  color: var(--paper);
  font-weight: 700;
}

.sheet-desc .win {
  color: var(--acid);
}

.sheet-desc .lose {
  color: var(--coral);
}

.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.sheet-btn {
  flex: 1 1 0;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #121d16;
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: transform 0.12s ease, background 0.18s ease;
}

.sheet-btn:active {
  transform: scale(0.97);
}

.sheet-btn:focus-visible {
  outline: 2px solid rgba(216, 243, 107, 0.5);
  outline-offset: 2px;
}

.sheet-btn.primary {
  border-color: transparent;
  background: linear-gradient(180deg, #e4fa8c 0%, var(--acid) 50%, var(--acid-strong) 100%);
  color: #10180f;
}

.sheet-btn.ghost {
  background: transparent;
}

.sheet-btn.ghost:hover {
  border-color: rgba(216, 243, 107, 0.4);
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #070b09;
  color: var(--paper);
  font-size: 13px;
  text-align: center;
}

/* ---------------- 炸弹 / 王炸特效 ---------------- */

.app.bomb-shake {
  animation: bomb-shake 0.45s ease;
}

@keyframes bomb-shake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  15% { transform: translate3d(-3px, 2px, 0); }
  30% { transform: translate3d(3px, -2px, 0); }
  45% { transform: translate3d(-2px, -1px, 0); }
  60% { transform: translate3d(2px, 1px, 0); }
  75% { transform: translate3d(-1px, 0, 0); }
}

.blast {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.blast.show {
  opacity: 1;
  visibility: visible;
}

.blast-glow {
  position: absolute;
  inset: -22%;
  background: radial-gradient(circle at 50% 46%, rgba(255, 246, 196, 0.58) 0%, rgba(240, 207, 116, 0.22) 28%, rgba(7, 11, 9, 0) 62%);
  opacity: 0;
}

.blast-cards {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 2px;
}

.blast .mini-card {
  width: 54px;
  height: 75px;
  margin-left: -10px;
  border-width: 2px;
  box-shadow: 0 0 26px rgba(255, 230, 140, 0.55), 0 8px 22px rgba(0, 0, 0, 0.55);
}

.blast .mini-card:first-child {
  margin-left: 0;
}

.blast .mini-card .mc-rank {
  top: 3px;
  left: 4px;
  font-size: 20px;
}

.blast .mini-card .mc-suit {
  right: 4px;
  bottom: 3px;
  font-size: 22px;
}

.blast .mini-card.joker .mc-rank {
  font-size: 16px;
}

.blast .mini-card.joker .mc-suit {
  font-size: 10px;
}

.blast-word {
  position: absolute;
  top: 58%;
  z-index: 3;
  color: #fff8cf;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 0 18px rgba(255, 200, 80, 0.85), 0 2px 10px rgba(0, 0, 0, 0.7);
  opacity: 0;
}

.blast.show .blast-glow {
  animation: blast-glow 0.62s ease-out;
}

.blast.show .blast-cards {
  animation: blast-cards 0.78s cubic-bezier(0.18, 0.9, 0.28, 1.2);
}

.blast.show .blast-word {
  animation: blast-word 0.78s ease-out;
}

@keyframes blast-glow {
  0% { opacity: 0; transform: scale(0.7); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.15); }
}

@keyframes blast-cards {
  0% { opacity: 0; transform: scale(0.4) translateY(10px); }
  35% { opacity: 1; transform: scale(1.18); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes blast-word {
  0% { opacity: 0; transform: scale(0.6); }
  25% { opacity: 1; transform: scale(1.08); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

/* 结算面板中的赢家最后一手 */

.sheet-final {
  display: block;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.sheet-final .sf-name {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-dim);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.sheet-final .sf-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 0;
}

.sheet-final .mini-card {
  margin-left: -6px;
}

.sheet-final .mini-card:first-child {
  margin-left: 0;
}

/* ---------------- 小屏适配 ---------------- */

@media (max-width: 359px) {
  .topbar {
    padding-left: 9px;
    padding-right: 9px;
  }

  .title-copy em {
    display: none;
  }

  .back-links a {
    padding: 5px 2px;
    font-size: 9.5px;
  }

  .seats {
    gap: 2px;
  }

  .seat {
    gap: 5px;
    padding: 4px;
  }

  .avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .seat-copy strong {
    font-size: 10.5px;
  }

  .deck-slot {
    min-width: 86px;
  }

  .mini-card {
    width: 24px;
    height: 33px;
  }

  .played .mini-card,
  .seat-play .mini-card {
    margin-left: -10px;
  }

  .played.dense .mini-card,
  .seat-play.dense .mini-card {
    margin-left: -12px;
  }

  .bottom-row {
    height: 35px;
  }

  .banner {
    font-size: 9.5px;
  }

  .act {
    font-size: 12.5px;
  }

  .foot-nav {
    gap: 3px 10px;
  }
}

@media (max-height: 700px) {
  .topbar {
    height: 44px;
    height: calc(44px + env(safe-area-inset-top, 0px));
  }

  .avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .table-center {
    padding-top: 6px;
  }

  .played {
    min-height: 46px;
    padding-top: 5px;
  }

  .mini-card {
    width: 24px;
    height: 33px;
  }

  .played .mini-card,
  .seat-play .mini-card {
    margin-left: -10px;
  }

  .played.dense .mini-card,
  .seat-play.dense .mini-card {
    margin-left: -12px;
  }

  .seat-play-row {
    min-height: 30px;
  }

  .played.final {
    min-height: 54px;
  }

  .played.final .mini-card {
    width: 32px;
    height: 44px;
  }

  .played.final .mini-card .mc-rank {
    font-size: 12px;
  }

  .played.final .mini-card .mc-suit {
    font-size: 13px;
  }

  .blast .mini-card {
    width: 48px;
    height: 66px;
  }

  .blast-word {
    font-size: 32px;
  }

  .action-row {
    padding: 2px 0 3px;
  }

  .act {
    height: 37px;
  }

  .footer p {
    display: none;
  }
}

@media (max-height: 620px) {
  .foot {
    padding: 3px 8px 4px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
  }

  .foot p {
    display: none;
  }

  .seat-copy em {
    display: none;
  }

  .table-center {
    padding-top: 3px;
  }

  .played {
    min-height: 40px;
  }
}

/* ---------------- 减少动态效果 ---------------- */

@media (prefers-reduced-motion: reduce) {
  .bottom-row .mini-card,
  .played .mini-card,
  .seat.is-thinking .avatar,
  .app.bomb-shake,
  .banner.emph,
  .seat.bid-flash,
  .player-zone.bid-flash,
  .blast.show .blast-glow,
  .blast.show .blast-cards,
  .blast.show .blast-word {
    animation: none;
  }

  .blast.show .blast-glow {
    opacity: 0.5;
  }

  .blast.show .blast-word {
    opacity: 1;
  }

  .overlay,
  .sheet,
  .card,
  .act,
  .util,
  .sheet-btn {
    transition-duration: 0.01ms;
  }
}
