/* ──────────────────────────────────────────────────────────────────────────
   直播 PK 平台 — Nintendo *in-game* menu style (Mario Party / Mario Kart).
   Bright sky-blue field with moving diagonal stripes, candy 3D buttons with
   a physical "thickness" edge that depresses on click, chunky rounded white
   panels floating on drop shadows, ultra-bold rounded type with dark outline.
   Fonts: Noto Sans SC everywhere (heavy weights for display, like the .pk-btn look
   display) + system PingFang stack (body).
   ────────────────────────────────────────────────────────────────────────── */

:root {
  /* Field */
  --sky:          #2bb2f2;
  --sky-deep:     #1490d8;
  --stripe:       rgba(255, 255, 255, 0.10);

  /* Panels */
  --panel:        #ffffff;
  --panel-soft:   #f2f7fb;
  --panel-cream:  #fff9e8;

  /* Mario primaries */
  --m-red:        #e4000f;
  --m-red-edge:   #930009;
  --m-yellow:     #ffc600;
  --m-yellow-edge:#cc8a00;
  --m-blue:       #0099e0;
  --m-blue-edge:  #00689c;
  --m-green:      #43b047;
  --m-green-edge: #2a7a2e;
  --m-pink:       #ff5fa2;
  --m-purple:     #9457eb;

  /* Ink — deep navy works better than black in game UIs */
  --navy:         #163a61;
  --navy-deep:    #0e2a4a;
  --ink:          #20436b;
  --muted:        #6b86a5;

  --good:         #43b047;
  --bad:          #e4000f;

  /* Bouncy game-feel motion */
  --t-fast:       120ms;
  --t-base:       220ms;
  --bounce:       cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease:         cubic-bezier(0.25, 0.1, 0.25, 1);

  --r-md:         16px;
  --r-lg:         22px;
  --r-xl:         28px;
  --r-pill:       999px;

  /* Floating panel shadow — soft + a hint of the navy edge */
  --float:        0 6px 0 rgba(14, 42, 74, 0.18), 0 14px 30px rgba(14, 42, 74, 0.20);
  --float-sm:     0 4px 0 rgba(14, 42, 74, 0.16), 0 8px 18px rgba(14, 42, 74, 0.16);
}

* { box-sizing: border-box; }

*:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 3px;
  border-radius: var(--r-md);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  /* CJK body text must come from ONE font family — Japanese webfonts (M PLUS /
     Mochiy) only partially cover simplified Chinese and produce mixed-weight
     patchwork. System stack keeps every glyph consistent. */
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* The classic game-menu field: bright blue + slowly drifting diagonal stripes */
  background-color: var(--sky);
  background-image:
    repeating-linear-gradient(45deg, var(--stripe) 0 44px, transparent 44px 88px),
    radial-gradient(ellipse at 50% -10%, rgba(255, 255, 255, 0.28) 0%, transparent 55%),
    linear-gradient(180deg, var(--sky) 0%, var(--sky-deep) 100%);
  background-attachment: fixed;
  animation: field-drift 40s linear infinite;
}
@keyframes field-drift {
  from { background-position: 0 0, 0 0, 0 0; }
  to   { background-position: 622px 0, 0 0, 0 0; }
}

/* Display type rules:
   - Latin/digits-only display text (VS, P1, countdown, VICTORY) → Mochiy Pop One
   - Display text = same family, font-weight 900
     (站酷黄油体): a single-weight game-y font with FULL simplified-Chinese
     coverage, so no patchwork fallback is ever visible. */
.pk-display {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-weight: 900;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.pk-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px clamp(16px, 3vw, 32px) 90px;
}

/* ── Header — floating banner ───────────────────────────────────────────── */
.pk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 14px 22px;
  background: var(--panel);
  border-radius: var(--r-xl);
  box-shadow: var(--float);
}
.pk-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.02em;
  color: var(--navy);
}
.pk-brand::before {
  content: "PK";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  color: #fff;
  background: var(--m-red);
  border: 3px solid #fff;
  border-radius: 14px;
  font-size: 17px;
  box-shadow: 0 4px 0 var(--m-red-edge), 0 6px 12px rgba(14, 42, 74, 0.25);
  transform: rotate(-4deg);
}
.pk-userbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pk-score {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: var(--m-yellow);
  color: var(--navy-deep);
  border-radius: var(--r-pill);
  font-weight: 900;
  font-size: 14.5px;
  box-shadow: 0 3px 0 var(--m-yellow-edge);
}
.pk-score .pk-icon { color: var(--navy-deep); }
.pk-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: var(--panel-soft);
  color: var(--ink);
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 14px;
}
.pk-link {
  color: var(--m-blue);
  text-decoration: none;
  font-weight: 900;
  font-size: 14px;
  transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--bounce);
  display: inline-block;
}
.pk-link:hover { color: var(--m-red); transform: scale(1.08); }

/* ── Card — floating rounded panel ──────────────────────────────────────── */
.pk-card {
  background: var(--panel);
  border-radius: var(--r-xl);
  box-shadow: var(--float);
  padding: 26px 28px;
  margin-bottom: 22px;
}
.pk-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-weight: 900;
  font-size: 25px;
  letter-spacing: 0.02em;
  color: var(--navy);
}
.pk-card h2 .pk-icon { color: var(--m-red); }
.pk-card p {
  margin: 12px 0;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.7;
}
.pk-card p strong { color: var(--navy); font-weight: 900; }
.pk-card p code {
  background: var(--panel-soft);
  color: var(--m-blue);
  padding: 2px 9px;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 900;
  font-size: 14px;
}
.pk-card h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 14px;
  padding: 6px 18px;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  background: var(--m-blue);
  border-radius: var(--r-pill);
  box-shadow: 0 3px 0 var(--m-blue-edge);
  transform: rotate(-1deg);
}
.pk-card h3 .pk-icon { width: 16px; height: 16px; }

/* ── Buttons — candy 3D with physical edge ──────────────────────────────── */
.pk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 28px;
  color: #fff;
  background: var(--m-red);
  border: 3px solid #fff;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.02em;
  white-space: nowrap;   /* CJK labels must never wrap into vertical text */
  flex-shrink: 0;
  cursor: pointer;
  /* the candy thickness: colored hard edge below + ambient shadow */
  box-shadow: 0 5px 0 var(--m-red-edge), 0 9px 16px rgba(14, 42, 74, 0.28);
  transition: transform var(--t-fast) var(--bounce), box-shadow var(--t-fast) var(--ease), filter var(--t-fast);
  text-decoration: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}
.pk-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 7px 0 var(--m-red-edge), 0 12px 20px rgba(14, 42, 74, 0.3);
  filter: brightness(1.06);
}
.pk-btn:active {
  /* pressed: sinks down, edge compresses */
  transform: translateY(4px) scale(0.99);
  box-shadow: 0 1px 0 var(--m-red-edge), 0 3px 6px rgba(14, 42, 74, 0.2);
}
.pk-btn:focus-visible { border-radius: var(--r-pill); }
.pk-btn:disabled {
  cursor: not-allowed;
  background: #9fb4c8;
  box-shadow: 0 4px 0 #7e94a8;
  transform: none;
  filter: grayscale(0.2);
}

.pk-btn.ghost {
  background: #fff;
  color: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 5px 0 rgba(14, 42, 74, 0.35), 0 9px 16px rgba(14, 42, 74, 0.18);
  text-shadow: none;
}
.pk-btn.ghost:hover { box-shadow: 0 7px 0 rgba(14, 42, 74, 0.35), 0 12px 20px rgba(14, 42, 74, 0.2); }
.pk-btn.ghost:active { box-shadow: 0 1px 0 rgba(14, 42, 74, 0.35); }

/* 认输:小、暗、靠边 — 不是误触得到的大目标 (点了还有二次确认) */
.pk-resign-btn {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.45;
  box-shadow: 0 3px 0 rgba(14, 42, 74, 0.25);
}
.pk-resign-btn:hover { opacity: 1; }

.pk-btn.danger {
  background: var(--navy);
  box-shadow: 0 5px 0 #07182c, 0 9px 16px rgba(14, 42, 74, 0.3);
}
.pk-btn.danger:active { box-shadow: 0 1px 0 #07182c; }

.pk-btn.yellow {
  background: var(--m-yellow);
  color: var(--navy-deep);
  text-shadow: none;
  box-shadow: 0 5px 0 var(--m-yellow-edge), 0 9px 16px rgba(14, 42, 74, 0.25);
}
.pk-btn.yellow:active { box-shadow: 0 1px 0 var(--m-yellow-edge); }
.pk-btn.green {
  background: var(--m-green);
  box-shadow: 0 5px 0 var(--m-green-edge), 0 9px 16px rgba(14, 42, 74, 0.25);
}
.pk-btn.green:active { box-shadow: 0 1px 0 var(--m-green-edge); }
.pk-btn.cyan {
  background: var(--m-blue);
  box-shadow: 0 5px 0 var(--m-blue-edge), 0 9px 16px rgba(14, 42, 74, 0.25);
}
.pk-btn.cyan:active { box-shadow: 0 1px 0 var(--m-blue-edge); }

.pk-btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ── Icons ──────────────────────────────────────────────────────────────── */
.pk-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pk-card h2 .pk-icon { width: 24px; height: 24px; }
.pk-score .pk-icon, .pk-user-chip .pk-icon { width: 15px; height: 15px; }
.pk-btn .pk-icon { width: 18px; height: 18px; }

/* ── Status indicator ───────────────────────────────────────────────────── */
.pk-status-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--panel-soft);
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.pk-status-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #b6c6d6;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(14, 42, 74, 0.3);
}
.pk-status-dot.on {
  background: var(--m-green);
  animation: bounce-dot 1s var(--bounce) infinite;
}
@keyframes bounce-dot {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.3); }
}

/* ── Players VS layout ──────────────────────────────────────────────────── */
.pk-vs-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 18px;
  margin: 20px 0;
}
.pk-players-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.pk-player {
  position: relative;
  text-align: center;
  padding: 26px 16px 20px;
  background: var(--panel-cream);
  border: 3px solid var(--navy);
  border-radius: var(--r-lg);
  box-shadow: 0 5px 0 rgba(14, 42, 74, 0.3), 0 10px 18px rgba(14, 42, 74, 0.18);
  transition: transform var(--t-base) var(--bounce);
}
.pk-player:hover { transform: translateY(-3px) rotate(-0.5deg); }
/* P1 / P2 corner badges — game character-select feel */
.pk-player::before {
  content: "P1";
  position: absolute;
  top: -12px; left: -8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px; height: 30px;
  padding: 0 8px;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  color: #fff;
  background: var(--m-blue);
  border: 3px solid #fff;
  border-radius: 10px;
  box-shadow: 0 3px 0 var(--m-blue-edge);
  transform: rotate(-6deg);
}
.pk-vs-grid .pk-player:last-child::before,
.pk-players-row .pk-player:nth-child(2)::before { content: "P2"; background: var(--m-red); box-shadow: 0 3px 0 var(--m-red-edge); }
.pk-players-row .pk-player:nth-child(3)::before { content: "P3"; background: var(--m-yellow); color: var(--navy-deep); box-shadow: 0 3px 0 var(--m-yellow-edge); }
.pk-players-row .pk-player:nth-child(4)::before { content: "P4"; background: var(--m-green); box-shadow: 0 3px 0 var(--m-green-edge); }
.pk-players-row .pk-player:nth-child(5)::before { content: "P5"; background: var(--m-pink); box-shadow: 0 3px 0 #c23a75; }
.pk-players-row .pk-player:nth-child(6)::before { content: "P6"; background: var(--m-purple); box-shadow: 0 3px 0 #6a35b5; }

.pk-player.you { background: #eafff0; border-color: var(--m-green); }
.pk-player.winner {
  background: var(--m-yellow);
  border-color: #fff;
  animation: winner-bounce 0.9s var(--bounce) infinite;
}
@keyframes winner-bounce {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-6px) rotate(1deg); }
}
.pk-player-avatar { font-size: 42px; line-height: 1; margin-bottom: 10px; filter: drop-shadow(0 3px 0 rgba(14, 42, 74, 0.2)); }
.pk-player-avatar:has(.pk-av-img) { width: 56px; height: 56px; margin: 0 auto 10px; }
.pk-profile-avatar { border-radius: 18px; overflow: hidden; }
.pk-profile-avatar:has(.pk-av-img) { border-radius: 50%; }
.pk-player-name { font-weight: 900; font-size: 16.5px; margin-bottom: 2px; color: var(--navy); }
.pk-player-score { color: var(--muted); font-size: 12px; font-weight: 800; }

.pk-vs {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--m-yellow);
  border: 4px solid #fff;
  color: var(--m-red);
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 24px;
  box-shadow: 0 5px 0 var(--m-yellow-edge), 0 9px 16px rgba(14, 42, 74, 0.3);
  animation: vs-wiggle 2.2s ease-in-out infinite;
  text-shadow: 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
}
@keyframes vs-wiggle {
  0%, 100% { transform: rotate(-5deg) scale(1); }
  50%      { transform: rotate(5deg) scale(1.08); }
}

/* ── Game selection — level-select tiles ────────────────────────────────── */
.pk-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 18px;
  margin-bottom: 6px;
}
.pk-game-card {
  background: var(--panel);
  border: 3px solid var(--navy);
  border-radius: var(--r-lg);
  padding: 18px;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(14, 42, 74, 0.3), 0 9px 16px rgba(14, 42, 74, 0.16);
  transition: transform var(--t-base) var(--bounce), border-color var(--t-fast), box-shadow var(--t-fast);
}
.pk-game-card:hover {
  transform: translateY(-5px) scale(1.04) rotate(-0.8deg);
  border-color: var(--m-yellow);
  box-shadow: 0 8px 0 var(--m-yellow-edge), 0 14px 24px rgba(14, 42, 74, 0.24);
}
.pk-game-card:nth-child(even):hover { transform: translateY(-5px) scale(1.04) rotate(0.8deg); }
.pk-game-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  width: 60px; height: 60px;
  margin-bottom: 12px;
  background: var(--sky);
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.18) 0 8px, transparent 8px 16px);
  border: 3px solid var(--navy);
  border-radius: var(--r-md);
  box-shadow: 0 3px 0 rgba(14, 42, 74, 0.3);
}
.pk-game-name {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-weight: 900;
  font-size: 20px;
  margin-bottom: 4px;
  color: var(--navy);
}
.pk-game-desc { color: var(--muted); font-size: 13px; line-height: 1.55; font-weight: 600; }
.pk-game-tag {
  display: inline-block;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
  margin-top: 12px;
  background: var(--m-blue);
  color: #fff;
  border-radius: var(--r-pill);
  box-shadow: 0 2px 0 var(--m-blue-edge);
}
.pk-game-tag.punishment { background: var(--m-pink); box-shadow: 0 2px 0 #c23a75; }

/* ── Invite tokens ─────────────────────────────────────────────────────── */
.pk-invite-tokens { display: grid; gap: 12px; margin-top: 12px; }
.pk-token-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-soft);
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 12.5px;
  color: var(--navy);
  font-weight: 700;
}
.pk-token-row .pk-btn { min-height: 36px; padding: 0 16px; font-size: 13px; border-width: 2px; }

/* ── Inputs ────────────────────────────────────────────────────────────── */
.pk-input {
  width: 100%;
  padding: 13px 18px;
  background: var(--panel-soft);
  border: 3px solid transparent;
  border-radius: var(--r-md);
  color: var(--navy);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast) var(--bounce);
}
.pk-input::placeholder { color: #9fb4c8; font-weight: 600; }
.pk-input:focus {
  outline: none;
  background: #fff;
  border-color: var(--m-blue);
  transform: scale(1.01);
}

/* ── Gomoku / TicTacToe board ───────────────────────────────────────────── */
.pk-board {
  background: #ffe9b3;
  background-image:
    linear-gradient(rgba(22, 58, 97, 0.4) 1.5px, transparent 1.5px),
    linear-gradient(90deg, rgba(22, 58, 97, 0.4) 1.5px, transparent 1.5px);
  background-size: var(--cell) var(--cell);
  position: relative;
  margin: 16px auto;
  border: 4px solid var(--navy);
  border-radius: var(--r-md);
  box-shadow: 0 6px 0 rgba(14, 42, 74, 0.3), 0 12px 22px rgba(14, 42, 74, 0.2);
}
.pk-board.click-hint { cursor: pointer; }
.pk-cell {
  position: absolute;
  width: var(--cell);
  height: var(--cell);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pk-stone {
  width: 80%;
  height: 80%;
  border-radius: 50%;
  border: 2.5px solid var(--navy);
  box-shadow: 0 2px 0 rgba(14, 42, 74, 0.35);
}
.pk-stone.black { background: radial-gradient(circle at 32% 28%, #5a7da6, var(--navy-deep)); }
.pk-stone.white { background: radial-gradient(circle at 32% 28%, #ffffff, #e8edf3); }
.pk-stone.last  {
  box-shadow: 0 0 0 4px var(--m-yellow), 0 2px 0 rgba(14, 42, 74, 0.35);
  animation: stone-in var(--t-base) var(--bounce);
}
/* Hover preview — translucent stone showing where the click will land */
.pk-ghost { pointer-events: none; }
.pk-stone.ghost {
  opacity: 0.4;
  box-shadow: 0 0 0 3px rgba(0, 153, 224, 0.5);
  animation: ghost-pulse 1.2s ease-in-out infinite;
}
@keyframes ghost-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.06); }
}
@keyframes stone-in { from { transform: scale(0.3); } to { transform: scale(1); } }

.pk-turn {
  text-align: center;
  font-weight: 900;
  margin: 14px 0;
  font-size: 16.5px;
}
.pk-turn .me   { color: var(--m-green); }
.pk-turn .them { color: var(--muted); }

/* ── Guess number ───────────────────────────────────────────────────────── */
.pk-guess-row {
  display: flex;
  gap: 12px;
  margin: 18px 0;
  justify-content: center;
}
.pk-guess-row input {
  width: 140px;
  padding: 12px;
  background: #fff;
  border: 4px solid var(--navy);
  border-radius: var(--r-md);
  color: var(--navy);
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 28px;
  text-align: center;
  box-shadow: 0 4px 0 rgba(14, 42, 74, 0.3);
  transition: border-color var(--t-fast), transform var(--t-fast) var(--bounce);
}
.pk-guess-row input:focus {
  outline: none;
  border-color: var(--m-yellow);
  transform: scale(1.04);
}
.pk-guess-log { max-height: 270px; overflow-y: auto; display: grid; gap: 8px; margin-top: 12px; padding-right: 4px; }
.pk-guess-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--panel-soft);
  border-radius: var(--r-md);
  font-size: 14.5px;
  font-weight: 700;
}
.pk-guess-entry .higher { color: var(--m-blue); font-weight: 900; }
.pk-guess-entry .lower  { color: var(--m-pink); font-weight: 900; }
.pk-guess-entry .hit    { color: var(--m-green); font-weight: 900; font-size: 16px; }

/* ── Tug of pun ─────────────────────────────────────────────────────────── */
.pk-tug {
  height: 70px;
  background: #fff;
  border: 4px solid var(--navy);
  border-radius: var(--r-pill);
  position: relative;
  margin: 26px 0;
  overflow: hidden;
  box-shadow: 0 5px 0 rgba(14, 42, 74, 0.3), inset 0 3px 8px rgba(14, 42, 74, 0.08);
}
.pk-tug::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 153, 224, 0.16) 0%, transparent 45%, transparent 55%, rgba(228, 0, 15, 0.14) 100%);
}
.pk-tug-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--m-yellow);
  border: 4px solid #fff;
  box-shadow: 0 4px 0 var(--m-yellow-edge), 0 6px 10px rgba(14, 42, 74, 0.3);
  transition: left var(--t-fast) linear;
}
.pk-tug-center { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; background: rgba(22, 58, 97, 0.2); z-index: 1; }
.pk-tug-label-l, .pk-tug-label-r {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-weight: 900;
  font-size: 17px;
  z-index: 2;
}
.pk-tug-label-l { left: 22px; color: var(--m-blue); }
.pk-tug-label-r { right: 22px; color: var(--m-red); }

/* ── Settlement / result card ───────────────────────────────────────────── */
.pk-result-card {
  text-align: center;
  background: var(--panel);
  border-radius: var(--r-xl);
  box-shadow: var(--float);
  animation: result-drop 480ms var(--bounce);
  position: relative;
  overflow: hidden;
}
.pk-result-card::before {
  /* sunburst behind the title — classic victory screen */
  content: "";
  position: absolute;
  top: -130px;
  left: 50%;
  transform: translateX(-50%);
  width: 560px;
  height: 560px;
  background: repeating-conic-gradient(from 0deg, rgba(255, 198, 0, 0.16) 0deg 11deg, transparent 11deg 22deg);
  border-radius: 50%;
  pointer-events: none;
  animation: sunburst-spin 24s linear infinite;
}
@keyframes sunburst-spin { to { transform: translateX(-50%) rotate(360deg); } }
@keyframes result-drop {
  0%   { transform: translateY(-30px) scale(0.92); opacity: 0; }
  60%  { transform: translateY(4px) scale(1.02); opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}
.pk-result-header { padding: 22px 0 26px; position: relative; text-align: center; }
.pk-result-epilogue {
  margin-top: 12px;
  display: inline-block;
  padding: 8px 20px;
  background: var(--panel-soft);
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}
.pk-result-epilogue strong {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 20px;
  color: var(--m-red);
}
.pk-result-title {
  display: inline-block;
  margin: 0 0 16px;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-weight: 900;
  font-size: 52px;
  letter-spacing: 0.04em;
  line-height: 1.15;
  transform: rotate(-2deg);
}
.pk-result-title.won {
  color: var(--m-yellow);
  text-shadow:
    -2px -2px 0 var(--navy), 2px -2px 0 var(--navy),
    -2px  2px 0 var(--navy), 2px  2px 0 var(--navy),
    0 6px 0 var(--m-yellow-edge);
  animation: title-bounce 1.1s var(--bounce) infinite;
}
@keyframes title-bounce {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50%      { transform: rotate(-2deg) translateY(-6px); }
}
.pk-result-title.lost {
  color: #b9c8d8;
  text-shadow:
    -2px -2px 0 var(--navy), 2px -2px 0 var(--navy),
    -2px  2px 0 var(--navy), 2px  2px 0 var(--navy),
    0 5px 0 #5d7184;
}
.pk-result-title.draw {
  color: #fff;
  text-shadow:
    -2px -2px 0 var(--navy), 2px -2px 0 var(--navy),
    -2px  2px 0 var(--navy), 2px  2px 0 var(--navy);
}
.pk-result-sub {
  display: block;
  margin: 0 auto;
  width: fit-content;
  padding: 6px 22px;
  font-weight: 900;
  font-size: 18px;
  border-radius: var(--r-pill);
  color: #fff;
}
.pk-result-sub.gain { background: var(--m-green); box-shadow: 0 3px 0 var(--m-green-edge); }
.pk-result-sub.lose { background: var(--m-red); box-shadow: 0 3px 0 var(--m-red-edge); }
.pk-result-game {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  font-weight: 900;
}
.pk-result-breakdown {
  display: grid;
  gap: 12px;
  max-width: 460px;
  margin: 0 auto;
  position: relative;
}
.pk-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 20px;
  background: var(--panel-soft);
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 700;
}
.pk-result-row.winner {
  background: var(--m-yellow);
  border: 3px solid #fff;
  box-shadow: 0 4px 0 var(--m-yellow-edge);
  color: var(--navy-deep);
}
.pk-result-row.winner .pk-result-name .pk-icon { color: var(--m-red); }
.pk-result-name { font-weight: 900; display: inline-flex; align-items: center; gap: 6px; }
.pk-result-delta { font-family: "Noto Sans SC", "PingFang SC", sans-serif; font-weight: 900; font-size: 18px; }
.pk-result-delta .win  { color: var(--m-green); }
.pk-result-delta .loss { color: var(--m-red); }
.pk-result-delta .draw { color: var(--muted); }
.pk-result-row.winner .pk-result-delta .win { color: var(--m-green-edge); }

/* ── Countdown chip ─────────────────────────────────────────────────────── */
.pk-countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  margin: 0 4px;
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 16px;
}
.pk-countdown.urgent {
  background: var(--m-red);
  animation: countdown-panic 0.5s var(--bounce) infinite;
}
@keyframes countdown-panic {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

/* ── 数字炸弹 — range track ─────────────────────────────────────────────── */
.pk-bomb-track {
  position: relative;
  height: 58px;
  margin: 18px 0;
  background: var(--panel-soft);
  border: 3px solid var(--navy);
  border-radius: var(--r-pill);
  overflow: hidden;
  box-shadow: inset 0 3px 8px rgba(14, 42, 74, 0.10);
}
.pk-bomb-window {
  position: absolute;
  top: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--m-yellow);
  border-radius: var(--r-pill);
  transition: left 360ms var(--bounce), width 360ms var(--bounce), background 300ms;
  box-shadow: inset 0 -4px 0 var(--m-yellow-edge);
  min-width: 96px;
}
.pk-bomb-track.danger .pk-bomb-window {
  background: var(--m-red);
  box-shadow: inset 0 -4px 0 var(--m-red-edge);
  animation: bomb-danger 0.7s ease-in-out infinite;
}
.pk-bomb-track.danger .pk-bomb-lo,
.pk-bomb-track.danger .pk-bomb-hi { color: #fff; }
@keyframes bomb-danger {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.18); }
}
.pk-bomb-lo, .pk-bomb-hi {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 18px;
  color: var(--navy-deep);
}
.pk-bomb-emoji {
  font-size: 26px;
  filter: drop-shadow(0 2px 0 rgba(14, 42, 74, 0.3));
  animation: bomb-tick 1.2s ease-in-out infinite;
}
@keyframes bomb-tick {
  0%, 100% { transform: rotate(-8deg); }
  50%      { transform: rotate(8deg); }
}
.pk-guess-entry.boom {
  background: var(--m-red);
  color: #fff;
  animation: boom-flash 500ms var(--bounce);
}
.pk-guess-entry.boom .hit { color: #fff; }
@keyframes boom-flash {
  0%   { transform: scale(0.9); }
  40%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* ── 石头剪刀布 ─────────────────────────────────────────────────────────── */
.pk-rps-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 14px 0 6px;
}
.pk-rps-side { text-align: center; }
.pk-rps-name { font-weight: 900; font-size: 15px; color: var(--navy); margin-bottom: 6px; }
.pk-rps-mid { font-size: 12.5px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.pk-rps-pips { display: inline-flex; gap: 6px; }
.pk-rps-pip {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--panel-soft);
  border: 2.5px solid var(--navy);
}
.pk-rps-pip.on {
  background: var(--m-yellow);
  box-shadow: 0 2px 0 var(--m-yellow-edge);
  animation: pip-pop 300ms var(--bounce);
}
@keyframes pip-pop { from { transform: scale(0.3); } to { transform: scale(1); } }

.pk-rps-reveal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 14px 0;
  padding: 14px;
  background: var(--panel-soft);
  border-radius: var(--r-lg);
}
.pk-rps-hand {
  font-size: 52px;
  line-height: 1;
  filter: drop-shadow(0 3px 0 rgba(14, 42, 74, 0.25));
  animation: hand-reveal 420ms var(--bounce);
}
@keyframes hand-reveal {
  0%   { transform: scale(0.2) rotate(-30deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.pk-rps-vs {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-weight: 900;
  font-size: 20px;
  color: var(--m-red);
  white-space: nowrap;
}
.pk-rps-hands {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 16px 0 6px;
}
.pk-rps-btn {
  width: 88px;
  height: 88px;
  font-size: 42px;
  background: #fff;
  border: 4px solid var(--navy);
  border-radius: 24px;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(14, 42, 74, 0.3), 0 10px 16px rgba(14, 42, 74, 0.16);
  transition: transform var(--t-fast) var(--bounce), box-shadow var(--t-fast), border-color var(--t-fast);
}
.pk-rps-btn:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.08) rotate(-3deg);
  border-color: var(--m-yellow);
  box-shadow: 0 9px 0 var(--m-yellow-edge), 0 14px 22px rgba(14, 42, 74, 0.22);
}
.pk-rps-btn:active:not(:disabled) {
  transform: translateY(4px) scale(0.96);
  box-shadow: 0 1px 0 rgba(14, 42, 74, 0.3);
}
.pk-rps-btn.locked { opacity: 0.4; cursor: not-allowed; }

/* Gomoku winning line highlight */
.pk-stone.win {
  box-shadow: 0 0 0 4px var(--m-yellow), 0 0 14px rgba(255, 198, 0, 0.8);
  animation: win-stone 700ms var(--bounce) infinite alternate;
}
@keyframes win-stone {
  from { transform: scale(1); }
  to   { transform: scale(1.14); }
}

/* Tap button gets extra chunk */
.pk-tap-btn {
  min-height: 64px;
  padding: 0 48px;
  font-size: 22px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* ── Lobby: ready badges + waiting ──────────────────────────────────────── */
.pk-ready-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 900;
  border-radius: var(--r-pill);
  background: var(--panel-soft);
  color: var(--muted);
}
.pk-ready-badge.on {
  background: var(--m-green);
  color: #fff;
  box-shadow: 0 2px 0 var(--m-green-edge);
}
.pk-waiting-host {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 26px;
  background: var(--panel-soft);
  border-radius: var(--r-lg);
  font-size: 16px;
}
.pk-game-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.7);
}
.pk-game-card.disabled:hover { transform: none; border-color: var(--hairline); box-shadow: 0 5px 0 rgba(14, 42, 74, 0.3), 0 9px 16px rgba(14, 42, 74, 0.16); animation: none; }
.pk-game-card.random {
  background: linear-gradient(135deg, #fff7df 0%, #ffe9b3 100%);
  border-color: var(--m-yellow-edge);
}

/* ── Roulette (Fall Guys-style random pick) ─────────────────────────────── */
.pk-roulette {
  position: relative;
  height: 130px;
  margin: 18px 0;
  overflow: hidden;
  background: var(--panel-soft);
  border: 3px solid var(--navy);
  border-radius: var(--r-lg);
}
.pk-roulette-strip {
  /* NOTE: spinRoulette() animates `transform: translateX(...)` directly —
     vertical centering must NOT live in transform or the spin wipes it out
     (cards used to drop to the bottom and get clipped). */
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  will-change: transform;
  padding: 0;
}
.pk-roulette-card {
  flex: 0 0 120px;
  height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: var(--r-md);
}
.pk-roulette-card.landed {
  background: var(--m-yellow);
  animation: winner-bounce 0.7s var(--bounce) infinite;
}
.pk-roulette-emoji { font-size: 34px; line-height: 1; }
.pk-roulette-name { font-size: 13px; font-weight: 900; color: var(--navy); }
.pk-roulette-pointer {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 18px solid var(--m-red);
  z-index: 2;
  filter: drop-shadow(0 2px 0 rgba(14, 42, 74, 0.4));
}

/* ── AI icon images (emoji replacements; alt-emoji fallback on 404) ─────── */
.pk-icon-img {
  display: block;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(14, 42, 74, 0.22);
  box-shadow: 0 2px 0 rgba(14, 42, 74, 0.15);
}
.pk-game-emoji .pk-icon-img { width: 100%; height: 100%; border: none; box-shadow: none; border-radius: 14px; }
.pk-roulette-emoji .pk-icon-img { width: 48px; height: 48px; }
.pk-loading-emoji .pk-icon-img { width: 72px; height: 72px; border-radius: 16px; }
.pk-punish-emoji .pk-icon-img { width: 52px; height: 52px; }
.pk-punish-big .pk-icon-img { width: 96px; height: 96px; border-radius: 20px; margin: 0 auto; }

/* ── Pre-game ready-check (rules screen 准备 button + per-player chips) ──── */
.pk-ready-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.pk-ready-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 3px solid var(--navy);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.pk-ready-chip strong { color: var(--muted); }
.pk-ready-chip.on {
  background: #e2f8e9;
  border-color: #1ba94c;
}
.pk-ready-chip.on strong { color: #0c6b2e; }
/* eliminated player — unmistakably "out": greyed, struck through, dim */
.pk-ready-chip.out {
  background: rgba(120, 130, 145, 0.12);
  border-color: rgba(120, 130, 145, 0.4);
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(224, 64, 90, 0.7);
  text-decoration-thickness: 2px;
  opacity: 0.6;
  filter: grayscale(1);
}
.pk-ready-chip.out .pk-av-img,
.pk-ready-chip.out .pk-av-glyph { filter: grayscale(1) brightness(0.92); }

/* ── 模拟高考 ────────────────────────────────────────────────────────────── */
.pk-exam-q {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 26px;
  text-align: center;
  color: var(--navy);
  margin: 18px auto 16px;
  max-width: 640px;
  line-height: 1.5;
}
.pk-exam-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
}
.pk-exam-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.08s;
}
.pk-exam-opt:hover:not(:disabled) { transform: translateY(-2px); }
.pk-exam-opt:disabled { cursor: default; opacity: 0.92; }
.pk-exam-opt.picked { background: #fff7df; border-color: var(--m-yellow-edge); }
.pk-exam-opt.correct { background: #e2f8e9; border-color: #1ba94c; }
.pk-exam-opt.wrong { background: #ffe3e6; border-color: var(--m-red); }
.pk-exam-letter {
  flex: 0 0 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sky);
  border: 2px solid var(--navy);
  border-radius: 8px;
  font-weight: 900;
}

/* ── 火眼金睛 ────────────────────────────────────────────────────────────── */
.pk-odd-grid {
  display: grid;
  gap: 4px;
  max-width: 560px;
  margin: 14px auto 0;
}
.pk-odd-cell {
  aspect-ratio: 1;
  font-size: clamp(16px, 3.4vw, 30px);
  background: var(--panel-soft);
  border: 2px solid rgba(14, 42, 74, 0.18);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: transform 0.06s;
}
.pk-odd-cell:hover:not(:disabled) { transform: scale(1.12); background: #fff; }
.pk-odd-cell:disabled { cursor: default; }
.pk-odd-cell.reveal {
  background: #ffe9a8;
  border-color: var(--m-yellow-edge);
  animation: winner-bounce 0.6s var(--bounce, ease) infinite;
}

/* ── 谁是卧底 ────────────────────────────────────────────────────────────── */
.pk-imposter-word {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 24px;
  text-align: center;
  color: var(--navy);
  background: linear-gradient(160deg, #fff7df 0%, #ffe9b3 100%);
  border: 3px solid var(--m-yellow-edge);
  border-radius: var(--r-lg);
  max-width: 380px;
  margin: 14px auto 4px;
  padding: 14px 20px;
}

/* ── 烫手炸弹 ────────────────────────────────────────────────────────────── */
.pk-potato-stage { text-align: center; margin-top: 12px; }
.pk-potato-bomb {
  font-size: 92px;
  line-height: 1.1;
  display: inline-block;
  filter: drop-shadow(0 6px 0 rgba(14, 42, 74, 0.2));
}
.pk-potato-bomb.anxiety-1 { animation: potato-shake 0.5s infinite; }
.pk-potato-bomb.anxiety-2 { animation: potato-shake 0.3s infinite; }
.pk-potato-bomb.anxiety-3 { animation: potato-shake 0.18s infinite; }
.pk-potato-bomb.anxiety-4 { animation: potato-shake 0.1s infinite; }
@keyframes potato-shake {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-3px, 2px) rotate(-4deg); }
  50% { transform: translate(3px, -2px) rotate(3deg); }
  75% { transform: translate(-2px, -2px) rotate(-2deg); }
  100% { transform: translate(2px, 2px) rotate(4deg); }
}

/* ── Avatars (image avatars render round; glyphs centered) ──────────────── */
.pk-av-img {
  /* bounded default so an avatar in an unsized container never blows up; big
     containers (.pk-profile-avatar / .pk-player-avatar) override to 100%. */
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  flex: none;
}
.pk-av-glyph { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }

/* picker grid */
.pk-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 10px;
  margin: 10px 0 4px;
}
.pk-avatar-opt {
  aspect-ratio: 1;
  font-size: 28px;
  line-height: 1;
  padding: 4px;
  background: var(--panel-soft);
  border: 3px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.08s;
}
.pk-avatar-opt .pk-av-img { border: none; }
.pk-avatar-opt:hover { transform: scale(1.1); }
.pk-avatar-opt.on { border-color: var(--m-yellow-edge); box-shadow: 0 0 0 3px #fff7df; }

/* header user chip avatar */
.pk-user-av {
  width: 26px; height: 26px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
}
.pk-user-av .pk-av-img { width: 26px; height: 26px; }
.pk-user-chip { display: inline-flex; align-items: center; text-decoration: none; }

/* profile + player avatars: size the image to the container */
.pk-profile-avatar .pk-av-img { width: 100%; height: 100%; }
/* explicit size (not 100%) so it never depends on :has or parent sizing */
.pk-player-avatar .pk-av-img { width: 56px; height: 56px; }
@media (max-width: 560px) { .pk-player-avatar .pk-av-img { width: 48px; height: 48px; } }

/* ── PK 检测 / 触发对局 / 邀请 / 踢人 ─────────────────────────────────────── */
.pk-detected-banner {
  margin: 14px 0;
  padding: 16px;
  text-align: center;
  background: linear-gradient(160deg, #fff7df 0%, #ffe9a8 100%);
  border: 3px solid var(--m-yellow-edge);
  border-radius: var(--r-lg);
  animation: winmoment-pop 0.4s var(--bounce, ease);
}
.pk-detected-title { font-family: "Noto Sans SC", sans-serif; font-weight: 900; font-size: 19px; color: var(--navy); }
.pk-detected-sub { font-size: 13px; color: var(--ink); margin-top: 4px; }
.pk-invite-slots { display: grid; gap: 12px; margin-top: 14px; }
.pk-invite-slot {
  padding: 12px 14px;
  background: var(--panel-soft);
  border: 2px solid rgba(14, 42, 74, 0.16);
  border-radius: var(--r-md);
}
.pk-invite-who { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.pk-ended-prompt {
  margin: 0 0 14px;
  padding: 12px 14px;
  text-align: center;
  background: #ffe3e6;
  border: 3px solid var(--m-red);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 700;
  color: #8a0a20;
}
.pk-player { position: relative; }
.pk-kick-btn {
  position: absolute;
  top: -6px; right: -6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--m-red);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.pk-kick-btn:hover { transform: scale(1.15); }

/* ── Practice bot lineup panel ──────────────────────────────────────────── */
.pk-bot-panel {
  margin: 6px 0 18px;
  padding: 14px 16px;
  background: var(--panel-soft);
  border: 3px dashed var(--navy);
  border-radius: var(--r-lg);
}
.pk-bot-remove {
  border: none;
  background: var(--m-red);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  line-height: 1;
  margin-left: 2px;
}
.pk-bot-remove:hover { transform: scale(1.15); }

/* ── 胜负定格 (victory moment between killing move and settle) ──────────── */
.pk-winmoment-float {
  /* floats ABOVE the final board instead of replacing it */
  position: fixed;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  width: min(440px, 86vw);
  pointer-events: none;
  filter: drop-shadow(0 14px 30px rgba(14, 42, 74, 0.35));
}
.pk-winmoment-card {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 26px 20px 30px;
  margin-bottom: 0;
  animation: winmoment-pop 0.45s var(--bounce, cubic-bezier(0.34, 1.56, 0.64, 1));
}
.pk-winmoment-card.win  { background: linear-gradient(160deg, #fff7df 0%, #ffe9a8 100%); }
.pk-winmoment-card.lose { background: linear-gradient(160deg, #f3f4fa 0%, #d9dcec 100%); }
.pk-winmoment-card.draw { background: linear-gradient(160deg, #eef7ff 0%, #d8ecfb 100%); }
.pk-winmoment-burst {
  position: absolute;
  inset: -40%;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.55) 0deg 9deg, transparent 9deg 18deg);
  animation: winmoment-spin 9s linear infinite;
  pointer-events: none;
}
.pk-winmoment-card.lose .pk-winmoment-burst { opacity: 0.25; animation-duration: 18s; }
.pk-winmoment-emoji {
  position: relative;
  font-size: 84px;
  line-height: 1;
  filter: drop-shadow(0 6px 0 rgba(14, 42, 74, 0.25));
  animation: winmoment-bounce 0.9s var(--bounce, cubic-bezier(0.34, 1.56, 0.64, 1)) infinite alternate;
}
.pk-winmoment-title {
  position: relative;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 56px;
  margin-top: 10px;
  color: var(--navy);
  text-shadow: 0 4px 0 rgba(255, 255, 255, 0.8);
  letter-spacing: 4px;
}
.pk-winmoment-card.win .pk-winmoment-title { color: #b2761a; }
.pk-winmoment-sub {
  position: relative;
  margin-top: 10px;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}
@keyframes winmoment-pop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes winmoment-spin { to { transform: rotate(360deg); } }
@keyframes winmoment-bounce { from { transform: translateY(0); } to { transform: translateY(-12px); } }

/* ── Rules intro (shown during loading so everyone learns the game) ─────── */
.pk-rules {
  max-width: 520px;
  margin: 14px auto 4px;
  padding: 14px 22px 16px;
  background: var(--panel-soft);
  border: 3px solid var(--navy);
  border-radius: var(--r-lg);
  text-align: left;
}
.pk-rules-title {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 17px;
  color: var(--navy);
  text-align: center;
  margin-bottom: 8px;
}
.pk-rules ul { margin: 0; padding-left: 20px; }
.pk-rules li {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  margin: 3px 0;
}
.pk-rules li::marker { color: var(--m-red); }

/* ── Loading countdown ─────────────────────────────────────────────────── */
.pk-loading-card { text-align: center; }
.pk-loading-center { padding: 12px 0 8px; }
.pk-loading-game {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 14px;
}
.pk-loading-emoji { font-size: 52px; line-height: 1; filter: drop-shadow(0 3px 0 rgba(14,42,74,0.2)); }
.pk-loading-name {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 34px;
  color: var(--navy);
}
.pk-loading-count {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 76px;
  line-height: 1.1;
  color: var(--m-red);
  text-shadow: 0 4px 0 rgba(14, 42, 74, 0.18);
  animation: count-pulse 1s var(--bounce) infinite;
}
@keyframes count-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}

/* ── 数字炸弹爆炸演出 (full-screen takeover, ~3s) ────────────────────────── */
.pk-boom-card {
  text-align: center;
  padding: 56px 24px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 198, 0, 0.5) 0%, transparent 45%),
    radial-gradient(circle at 50% 40%, rgba(228, 0, 15, 0.55) 0%, transparent 75%),
    #2b0b0e;
  border: 4px solid var(--m-red);
  animation: boom-shake 0.65s linear;
}
@keyframes boom-shake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  10% { transform: translate(-14px, 8px) rotate(-1.2deg); }
  25% { transform: translate(12px, -6px) rotate(1deg); }
  40% { transform: translate(-10px, -8px) rotate(-0.8deg); }
  55% { transform: translate(8px, 6px) rotate(0.6deg); }
  70% { transform: translate(-6px, 4px) rotate(-0.4deg); }
  85% { transform: translate(4px, -3px) rotate(0.2deg); }
}
.pk-boom-emoji {
  font-size: 120px;
  line-height: 1;
  display: inline-block;
  animation: boom-pop 0.55s var(--bounce);
  filter: drop-shadow(0 0 40px rgba(255, 198, 0, 0.8));
}
@keyframes boom-pop {
  0%   { transform: scale(0.1); opacity: 0; }
  55%  { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(1); }
}
.pk-boom-num {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 110px;
  line-height: 1.1;
  color: #fff;
  text-shadow:
    -3px -3px 0 var(--m-red), 3px -3px 0 var(--m-red),
    -3px  3px 0 var(--m-red), 3px  3px 0 var(--m-red),
    0 8px 0 var(--m-red-edge);
  animation: boom-num-in 0.5s var(--bounce) 0.25s backwards;
}
@keyframes boom-num-in {
  from { transform: scale(0.2) rotate(-12deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}
.pk-boom-text {
  margin-top: 14px;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 30px;
  color: #ffe9b3;
}
.pk-boom-me {
  margin-top: 10px;
  display: inline-block;
  padding: 6px 22px;
  background: var(--m-red);
  color: #fff;
  border-radius: var(--r-pill);
  font-weight: 900;
  font-size: 18px;
  animation: count-pulse 0.7s var(--bounce) infinite;
}

/* ── 矿洞大乱斗 canvas ───────────────────────────────────────────────── */
.pk-brawl-wrap {
  margin: 14px auto 0;
  border: 4px solid var(--navy);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 6px 0 rgba(14, 42, 74, 0.3), 0 12px 22px rgba(14, 42, 74, 0.2);
  line-height: 0;
  background: #120b1e;
}
.pk-brawl-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: auto;
}

/* ── ⚡ 反应对决 ─────────────────────────────────────────────────────────── */
.pk-rxn-scores {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin: 12px 0 4px;
  flex-wrap: wrap;
}
.pk-rxn-score { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 14px; }
.pk-rxn-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 210px;
  margin-top: 8px;
  border: none;
  border-radius: var(--r-lg);
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 44px;
  cursor: pointer;
  transition: transform var(--t-fast) var(--bounce);
  -webkit-user-select: none; user-select: none;
}
.pk-rxn-zone.wait {
  background: var(--m-red);
  color: #fff;
  box-shadow: 0 6px 0 var(--m-red-edge);
}
.pk-rxn-zone.go {
  background: var(--m-green);
  color: #fff;
  box-shadow: 0 6px 0 var(--m-green-edge);
  animation: rxn-go 0.4s var(--bounce);
  font-size: 64px;
}
@keyframes rxn-go { from { transform: scale(0.92); } to { transform: scale(1); } }
.pk-rxn-zone.go:active { transform: scale(0.97); }
.pk-rxn-zone.fouled {
  background: var(--panel-soft);
  color: var(--muted);
  cursor: not-allowed;
  font-size: 30px;
}
.pk-rxn-zone.between {
  background: var(--panel-cream);
  color: var(--navy);
  font-size: 28px;
  cursor: default;
}
.pk-rxn-sub { font-family: inherit; font-size: 15px; opacity: 0.8; }

/* ── ⌨️ 打字对决 ───────────────────────────────────────────────────────── */
.pk-type-phrase {
  margin: 14px auto;
  padding: 18px 22px;
  max-width: 640px;
  background: var(--panel-cream);
  border: 3px solid var(--navy);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 0 rgba(14, 42, 74, 0.3);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.7;
  text-align: center;
  letter-spacing: 0.06em;
  color: var(--navy);
  user-select: none;
  -webkit-user-select: none;
}
.pk-type-input-row {
  display: flex;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto 16px;
}
.pk-type-bar-row { max-width: 640px; margin: 0 auto 8px; }
.pk-type-bar-name { font-size: 13px; font-weight: 800; color: var(--ink); }
.pk-type-bar {
  height: 14px;
  background: var(--panel-soft);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-top: 3px;
}
.pk-type-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--m-blue), var(--m-green));
  border-radius: var(--r-pill);
  transition: width 300ms var(--ease);
}

/* ── 🚩 翻雷对决 ───────────────────────────────────────────────────────── */
.pk-mine-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: fit-content;
  margin: 14px auto;
}
.pk-mine-row { display: flex; gap: 8px; }
.pk-mine-cell {
  width: 64px;
  height: 64px;
  border: 3px solid var(--navy);
  border-radius: var(--r-md);
  background: var(--m-yellow);
  box-shadow: 0 4px 0 var(--m-yellow-edge);
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 26px;
  cursor: pointer;
  transition: transform var(--t-fast) var(--bounce), box-shadow var(--t-fast);
}
.pk-mine-cell:not(:disabled):hover { transform: translateY(-3px); box-shadow: 0 7px 0 var(--m-yellow-edge); }
.pk-mine-cell:disabled { cursor: default; }
.pk-mine-cell:not(.open):not(.mine):disabled { opacity: 0.7; }
.pk-mine-cell.open {
  background: var(--panel-soft);
  box-shadow: none;
  border-color: var(--hairline-2);
  color: var(--navy);
  animation: mine-open 240ms var(--bounce);
}
@keyframes mine-open { from { transform: scale(0.6); } to { transform: scale(1); } }
.pk-mine-cell.open.n1 { color: var(--m-blue); }
.pk-mine-cell.open.n2 { color: var(--m-green); }
.pk-mine-cell.open.n3 { color: var(--m-red); }
.pk-mine-cell.open.n4, .pk-mine-cell.open.n5 { color: var(--m-purple, #9457eb); }
.pk-mine-cell.mine {
  background: var(--m-red);
  box-shadow: none;
  animation: boom-flash 480ms var(--bounce);
}

/* ── 🎲 大话骰 ───────────────────────────────────────────────────────────── */
.pk-die {
  position: relative;
  display: inline-block;
  width: 46px; height: 46px;
  background: linear-gradient(145deg, #ffffff, #e8e8ee);
  border: 2.5px solid var(--navy);
  border-radius: 10px;
  box-shadow: 0 3px 0 rgba(14, 42, 74, 0.3);
  margin: 2px;
  vertical-align: middle;
}
.pk-die.small { width: 32px; height: 32px; border-radius: 7px; }
.pk-die.inline { width: 30px; height: 30px; border-radius: 6px; box-shadow: 0 2px 0 rgba(14,42,74,0.25); }
.pk-die.wild { background: linear-gradient(145deg, #fff3c8, #ffe084); border-color: var(--m-yellow-edge); }
.pk-die.match { border-color: var(--m-green); box-shadow: 0 0 0 3px rgba(67, 176, 71, 0.4); }
.pk-die.dim { opacity: 0.4; }
.pk-die.back {
  background: linear-gradient(145deg, var(--navy), #0a1f38);
  color: rgba(255,255,255,0.5);
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  animation: dice-wobble 2.2s ease-in-out infinite;
}
@keyframes dice-wobble {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3deg); }
}
.pk-pip {
  position: absolute;
  width: 22%; height: 22%;
  background: var(--navy-deep);
  border-radius: 50%;
}
.pk-die.wild .pk-pip { background: var(--m-red); }
/* 3×3 pip positions */
.pk-pip.p0 { left: 12%; top: 12%; } .pk-pip.p1 { left: 39%; top: 12%; } .pk-pip.p2 { right: 12%; top: 12%; }
.pk-pip.p3 { left: 12%; top: 39%; } .pk-pip.p4 { left: 39%; top: 39%; } .pk-pip.p5 { right: 12%; top: 39%; }
.pk-pip.p6 { left: 12%; bottom: 12%; } .pk-pip.p7 { left: 39%; bottom: 12%; } .pk-pip.p8 { right: 12%; bottom: 12%; }

.pk-dice-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  margin: 8px auto;
  max-width: 620px;
  background: var(--panel-soft);
  border-radius: var(--r-lg);
}
.pk-dice-row.mine { background: var(--panel-cream); border: 3px solid var(--m-yellow); box-shadow: 0 3px 0 var(--m-yellow-edge); }
.pk-dice-name { min-width: 130px; font-weight: 900; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.pk-dice-tray { display: flex; flex-wrap: wrap; }
.pk-dice-current {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  margin: 10px 0;
  color: var(--navy);
}
.pk-dice-banner {
  text-align: center;
  margin: 12px auto;
  max-width: 620px;
  padding: 14px 18px;
  background: var(--panel-cream);
  border: 3px solid var(--m-red);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 0 var(--m-red-edge);
  font-weight: 800;
  animation: result-pop 300ms var(--bounce);
}
.pk-dice-controls { max-width: 620px; margin: 14px auto 0; display: grid; gap: 12px; justify-items: center; }
.pk-dice-bidset { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pk-dice-faces { display: flex; gap: 4px; }
.pk-die-btn {
  background: none; border: none; padding: 2px; cursor: pointer; border-radius: 10px;
  transition: transform var(--t-fast) var(--bounce);
}
.pk-die-btn:hover { transform: translateY(-3px); }
.pk-die-btn.sel .pk-die { border-color: var(--m-red); box-shadow: 0 0 0 3px rgba(228, 0, 15, 0.35); }

/* ── ⚪ 黑白棋 ───────────────────────────────────────────────────────────── */
.pk-rev-score { display: flex; justify-content: center; gap: 22px; margin: 10px 0; flex-wrap: wrap; }
.pk-rev-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px;
  background: var(--panel-soft);
  border-radius: var(--r-pill);
  font-weight: 800; font-size: 14px;
}
.pk-rev-chip strong { font-family: "Noto Sans SC", "PingFang SC", sans-serif; font-size: 18px; }
.pk-rev-board {
  display: grid;
  grid-template-columns: repeat(8, 54px);
  gap: 3px;
  width: fit-content;
  margin: 12px auto;
  padding: 8px;
  background: var(--navy);
  border-radius: var(--r-md);
  box-shadow: 0 6px 0 rgba(14, 42, 74, 0.35), 0 12px 22px rgba(14, 42, 74, 0.2);
}
.pk-rev-cell {
  width: 54px; height: 54px;
  background: #2e9e57;
  border: none;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: default;
  position: relative;
}
.pk-rev-cell.legal { cursor: pointer; }
.pk-rev-cell.legal:hover { background: #38b865; }
.pk-rev-disc {
  width: 42px; height: 42px;
  border-radius: 50%;
  animation: rev-pop 240ms var(--bounce);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.35);
}
@keyframes rev-pop { from { transform: scale(0.4) rotateY(90deg); } to { transform: scale(1) rotateY(0); } }
.pk-rev-disc.black { background: radial-gradient(circle at 34% 30%, #5a5a66, #15151c); }
.pk-rev-disc.white { background: radial-gradient(circle at 34% 30%, #ffffff, #cfcfd8); }
.pk-rev-disc.last { box-shadow: 0 0 0 3px var(--m-yellow), inset 0 -4px 0 rgba(0,0,0,0.25); }
.pk-rev-disc.small { width: 18px; height: 18px; animation: none; }
.pk-rev-hint {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  animation: count-pulse 1.4s ease-in-out infinite;
}

/* ── 📦 点格棋 ───────────────────────────────────────────────────────────── */
.pk-dab-grid {
  width: fit-content;
  margin: 14px auto;
  padding: 18px;
  background: var(--panel-cream);
  border: 3px solid var(--navy);
  border-radius: var(--r-lg);
  box-shadow: 0 5px 0 rgba(14, 42, 74, 0.3);
}
.pk-dab-row { display: flex; align-items: center; }
.pk-dab-dot {
  width: 14px; height: 14px;
  background: var(--navy);
  border-radius: 50%;
  flex-shrink: 0;
}
.pk-dab-edge {
  border: none;
  background: rgba(14, 42, 74, 0.10);
  cursor: default;
  border-radius: 4px;
  transition: background var(--t-fast);
  flex-shrink: 0;
}
.pk-dab-edge.h { width: 52px; height: 10px; margin: 0 2px; }
.pk-dab-edge.v { width: 10px; height: 52px; margin: 2px 0; }
.pk-dab-edge[data-act] { cursor: pointer; }
.pk-dab-edge[data-act]:hover { background: var(--m-yellow); box-shadow: 0 0 0 2px var(--m-yellow-edge); }
.pk-dab-edge.drawn.o1 { background: var(--m-blue); }
.pk-dab-edge.drawn.o2 { background: var(--m-red); }
.pk-dab-edge.last { box-shadow: 0 0 0 3px var(--m-yellow); }
.pk-dab-box {
  width: 52px; height: 52px;
  margin: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px;
  border-radius: 8px;
  flex-shrink: 0;
}
.pk-dab-box.o1 { background: rgba(0, 153, 224, 0.18); animation: mine-open 260ms var(--bounce); }
.pk-dab-box.o2 { background: rgba(228, 0, 15, 0.14); animation: mine-open 260ms var(--bounce); }

/* ── 超时判负演出 ─────────────────────────────────────────────────────── */
.pk-timeout-card {
  text-align: center;
  padding: 56px 24px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 198, 0, 0.25) 0%, transparent 60%),
    var(--navy);
  border: 4px solid var(--m-yellow);
}
.pk-timeout-emoji {
  font-size: 100px;
  line-height: 1;
  display: inline-block;
  animation: timeout-swing 0.8s ease-in-out infinite;
}
@keyframes timeout-swing {
  0%, 100% { transform: rotate(-12deg); }
  50%      { transform: rotate(12deg); }
}
.pk-timeout-title {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 52px;
  color: var(--m-yellow);
  margin: 10px 0 6px;
}
.pk-timeout-text { font-size: 20px; color: #fff; font-weight: 800; margin-bottom: 12px; }

/* ── Punishment selection + stage ──────────────────────────────────────── */
.pk-punish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.pk-punish-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 18px 12px;
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: var(--r-md);
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(14, 42, 74, 0.3);
  transition: transform var(--t-fast) var(--bounce), border-color var(--t-fast), box-shadow var(--t-fast);
}
.pk-punish-card:hover {
  transform: translateY(-4px) rotate(-1deg);
  border-color: var(--m-red);
  box-shadow: 0 7px 0 var(--m-red-edge);
}
.pk-punish-emoji { font-size: 36px; line-height: 1; }
.pk-punish-name {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 19px;
  color: var(--navy);
}
.pk-punish-desc { font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.45; }

.pk-punishing-card { text-align: center; }
.pk-punish-stage {
  padding: 26px 18px;
  background: linear-gradient(135deg, #fff0f0 0%, #fff7df 100%);
  border: 3px solid var(--m-red);
  border-radius: var(--r-lg);
  box-shadow: 0 5px 0 var(--m-red-edge);
}
.pk-punish-big {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 12px;
  animation: vs-wiggle 1.6s ease-in-out infinite;
  display: inline-block;
}
.pk-punish-title {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 36px;
  color: var(--m-red);
  margin-bottom: 8px;
}
.pk-punish-detail { font-size: 16px; color: var(--ink); font-weight: 700; margin-bottom: 14px; }
.pk-punish-who {
  display: inline-block;
  padding: 6px 20px;
  background: var(--navy);
  color: #fff;
  border-radius: var(--r-pill);
  font-weight: 900;
  font-size: 15px;
}

/* ── Profile page ───────────────────────────────────────────────────────── */
.pk-profile-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin: 16px 0 22px;
}
.pk-profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px; height: 84px;
  font-size: 42px;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  color: var(--navy);
  background: var(--panel-soft);
  border: 3px solid var(--navy);
  border-radius: 22px;
  box-shadow: 0 4px 0 rgba(14, 42, 74, 0.3);
  flex-shrink: 0;
  overflow: hidden;
}
.pk-profile-fields { flex: 1; min-width: 0; }
.pk-profile-label {
  display: block;
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
  margin-bottom: 6px;
}
.pk-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 460px;
}
.pk-stat {
  text-align: center;
  padding: 16px 10px;
  background: var(--panel-soft);
  border-radius: var(--r-lg);
}
.pk-stat-num {
  display: block;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 26px;
  color: var(--navy);
  line-height: 1.2;
}
.pk-stat-label { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.pk-bind-result {
  padding: 16px 18px;
  background: var(--panel-cream);
  border: 3px solid var(--m-yellow);
  border-radius: var(--r-lg);
}
.pk-bind-result p { margin: 6px 0; }

/* 游客对局结束:保留战绩引导框 */
.pk-guest-keep {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--panel-cream, #fff7df);
  border: 3px solid var(--m-green, #2fbf71);
  border-radius: var(--r-lg, 16px);
}
.pk-guest-keep h3 { color: var(--navy); }
.pk-guest-keep code { font-size: 12px; }

/* ── History ────────────────────────────────────────────────────────────── */
.pk-history { display: grid; gap: 10px; }
.pk-history-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 12px;
  padding: 11px 18px;
  background: var(--panel-soft);
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 700;
  align-items: center;
  transition: transform var(--t-fast) var(--bounce), background var(--t-fast);
}
.pk-history-row:hover { background: var(--panel-cream); transform: scale(1.012); }
.pk-history-row .win  { color: var(--m-green); font-weight: 900; }
.pk-history-row .loss { color: var(--m-red); font-weight: 900; }
.pk-history-row .draw { color: var(--muted); font-weight: 900; }

/* ── Empty / toast ──────────────────────────────────────────────────────── */
.pk-empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--muted);
  font-weight: 800;
}
.pk-toast {
  position: fixed;
  bottom: 34px; left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 13px 28px;
  border: 3px solid #fff;
  border-radius: var(--r-pill);
  font-weight: 900;
  font-size: 15px;
  z-index: 80;
  box-shadow: 0 5px 0 var(--navy-deep), 0 10px 20px rgba(14, 42, 74, 0.4);
  animation: toast-bounce 380ms var(--bounce);
}
@keyframes toast-bounce {
  0%   { opacity: 0; transform: translate(-50%, 30px) scale(0.9); }
  60%  { opacity: 1; transform: translate(-50%, -4px) scale(1.03); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .pk-shell { padding: 16px 14px 70px; }
  .pk-header { flex-direction: column; align-items: flex-start; padding: 14px 18px; }
  .pk-card { padding: 20px; }
  .pk-result-title { font-size: 36px; }
  .pk-vs { width: 54px; height: 54px; font-size: 19px; }
  .pk-game-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (max-width: 440px) {
  .pk-game-grid { grid-template-columns: 1fr; }
}


/* ── 🃏 记忆翻牌 (memory-match) ──────────────────────────────────────────── */
.pk-mm-score { gap: 12px; }
.pk-mm-chip { transition: transform var(--t-fast) var(--bounce), box-shadow var(--t-fast); }
.pk-mm-chip.turn { outline: 3px solid var(--m-green); outline-offset: 2px; }
.pk-mm-chip.lead { box-shadow: 0 0 0 2px var(--m-yellow) inset; }
.pk-mm-chip strong { font-family: "Noto Sans SC", "PingFang SC", sans-serif; font-size: 18px; }

.pk-mm-grid {
  --mm-cell: 64px;
  display: grid;
  gap: 8px;
  width: fit-content;
  margin: 14px auto;
  perspective: 700px;
}
@media (max-width: 560px) { .pk-mm-grid { --mm-cell: 48px; gap: 6px; } }

.pk-mm-card {
  width: var(--mm-cell);
  height: var(--mm-cell);
  border: 3px solid var(--navy);
  border-radius: var(--r-md);
  background: var(--m-yellow);
  box-shadow: 0 4px 0 var(--m-yellow-edge);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--t-fast) var(--bounce), box-shadow var(--t-fast), background var(--t-fast);
}
.pk-mm-card .pk-mm-face {
  font-size: calc(var(--mm-cell) * 0.5);
  line-height: 1;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity var(--t-fast), transform var(--t-fast) var(--bounce);
}
.pk-mm-card:not(:disabled):hover { transform: translateY(-3px); box-shadow: 0 7px 0 var(--m-yellow-edge); }
.pk-mm-card:disabled { cursor: default; }
.pk-mm-card.up {
  background: var(--panel-soft);
  border-color: var(--hairline-2);
  box-shadow: none;
}
.pk-mm-card.up .pk-mm-face { opacity: 1; transform: scale(1); }
.pk-mm-card.active {
  border-color: var(--m-green);
  background: #eafbe9;
  animation: mine-open 240ms var(--bounce);
}
.pk-mm-card.matched {
  background: #eafbe9;
  border-color: var(--m-green);
  box-shadow: none;
  animation: mine-open 260ms var(--bounce);
}
.pk-mm-card.matched.mine { background: rgba(255, 198, 0, 0.22); border-color: var(--m-yellow-edge, #d9a800); }

/* ── 🂡 21点对决 (blackjack) ───────────────────────────────────────────── */
.pk-bj-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.pk-bj-seat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(22, 58, 97, 0.05);
  border: 2px solid transparent;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}
.pk-bj-seat.turn {
  border-color: var(--m-green);
  background: rgba(67, 176, 71, 0.1);
}
.pk-bj-seat.out { opacity: 0.5; }
.pk-bj-seat.win {
  border-color: var(--navy);
  background: rgba(22, 58, 97, 0.12);
}
.pk-bj-who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.pk-bj-name {
  font-weight: 800;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.pk-bj-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 13px;
  color: #fff;
}
.pk-bj-badge.live  { background: var(--navy); }
.pk-bj-badge.stood { background: var(--m-green-edge); }
.pk-bj-badge.bust  { background: var(--m-red); }
.pk-bj-hand {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pk-bj-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 52px;
  border-radius: 7px;
  background: #fff;
  border: 1.5px solid rgba(22, 58, 97, 0.25);
  box-shadow: 0 2px 4px rgba(14, 42, 74, 0.15);
  color: var(--ink);
  line-height: 1;
}
.pk-bj-card.red { color: var(--m-red); }
.pk-bj-card.back {
  font-size: 30px;
  color: #e9f3ff;
  background: repeating-linear-gradient(45deg, var(--m-blue, #3a7bd5) 0 6px, #2f63b0 6px 12px);
  border-color: rgba(22, 58, 97, 0.4);
}
.pk-bj-card b { font-size: 15px; font-weight: 900; }
.pk-bj-card i { font-size: 14px; font-style: normal; }
@media (max-width: 480px) {
  .pk-bj-card { width: 32px; height: 44px; }
  .pk-bj-card b { font-size: 13px; }
}

/* ── 🔢 闪电记数 ── */
.pk-nm-stage {
  text-align: center;
  padding: 18px 12px;
}
.pk-nm-number {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin: 8px 0;
  text-shadow: 0 2px 0 rgba(14, 42, 74, 0.12);
}
.pk-nm-hidden { color: var(--muted); letter-spacing: 0.18em; }
.pk-nm-reveal { color: var(--m-green); }
.pk-nm-input-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}
.pk-nm-input-row .pk-input {
  max-width: 220px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
}

/* ── 🎨 颜色陷阱 (Stroop) ─────────────────────────────────────────────────── */
.pk-stroop-stage {
  text-align: center;
  margin: 10px auto 0;
}
.pk-stroop-word {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: clamp(64px, 16vw, 120px);
  font-weight: 900;
  line-height: 1;
  user-select: none;
  text-shadow: 0 2px 8px rgba(14, 42, 74, 0.12);
}
.pk-stroop-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}
.pk-stroop-opts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}
.pk-stroop-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  font-size: 18px;
  font-weight: 800;
  color: var(--c);
  background: var(--panel-soft);
  border: 2px solid var(--c);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.06s, background 0.1s;
}
.pk-stroop-opt:hover:not(:disabled) { transform: scale(1.06); background: #fff; }
.pk-stroop-opt:disabled { cursor: default; opacity: 0.85; }
.pk-stroop-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c);
  border: 1px solid rgba(14, 42, 74, 0.18);
}
.pk-stroop-opt.answer {
  background: var(--c);
  color: #fff;
  animation: winner-bounce 0.6s var(--bounce, ease) infinite;
}
.pk-stroop-opt.answer .pk-stroop-swatch { background: #fff; }

/* ── ➗ 心算大战 ─────────────────────────────────────────────────────────── */
.pk-qm-problem {
  margin: 18px auto;
  padding: 22px 18px;
  text-align: center;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--navy-deep);
  background: var(--panel-soft);
  border-radius: var(--r-lg);
  line-height: 1.2;
}
.pk-qm-problem .pk-qm-q { color: var(--m-red); }
.pk-qm-problem.done { font-size: 30px; color: var(--m-green-edge); background: #e2f8e9; }
.pk-qm-problem.done strong { color: var(--m-green-edge); }
.pk-qm-row { max-width: 360px; margin: 0 auto; }

/* ── 🧩 表情猜成语 ──────────────────────────────────────────────────────── */
.pk-emoji-puzzle {
  margin: 16px auto 8px;
  padding: 22px 26px;
  max-width: 560px;
  background: var(--panel-cream);
  border: 3px solid var(--navy);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 0 rgba(14, 42, 74, 0.3);
  font-size: clamp(34px, 8vw, 56px);
  line-height: 1.3;
  text-align: center;
  letter-spacing: 0.12em;
  user-select: none;
  -webkit-user-select: none;
}
.pk-emoji-puzzle.solved {
  background: #ffe9a8;
  border-color: var(--m-yellow-edge);
  animation: winner-bounce 0.6s var(--bounce, ease) infinite;
}
.pk-emoji-hint {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 2px auto 10px;
}

/* 🎟️ 宾果连线 — big centered call, no card highlight (find it yourself) */
.pk-bingo-callwrap {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin: 4px 0 8px;
}
.pk-bingo-ball {
  width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 46px; font-weight: 900; color: #2a1c00;
  background: radial-gradient(circle at 35% 30%, #ffe08a, var(--accent, #ffc24b));
  border: 4px solid #fff; box-shadow: 0 5px 0 #c98b00, 0 0 0 4px rgba(255,194,75,0.35);
}
.pk-bingo-ball.live { animation: pkBingoPop 0.45s var(--bounce, cubic-bezier(.34,1.56,.64,1)), pkBingoUrge 0.9s ease-in-out infinite 0.45s; }
.pk-bingo-ball.idle {
  font-size: 30px; color: #9aa5b1; background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18); box-shadow: none; letter-spacing: 2px;
}
.pk-bingo-callmeta { display: flex; flex-direction: column; gap: 1px; text-align: center; }
.pk-bingo-callmeta strong { font-size: 16px; }
.pk-bingo-callmeta strong.hot { color: var(--m-red, #e0405a); }
.pk-bingo-callmeta span { font-size: 12px; color: var(--muted); }
@keyframes pkBingoPop { from { transform: scale(0.4) rotate(-14deg); } to { transform: scale(1) rotate(0); } }
@keyframes pkBingoUrge {
  0%, 100% { box-shadow: 0 5px 0 #c98b00, 0 0 0 4px rgba(255,194,75,0.35); }
  50% { box-shadow: 0 5px 0 #c98b00, 0 0 0 10px rgba(255,194,75,0); }
}
.pk-bingo-card { max-width: 320px; margin: 12px auto 0; }
.pk-bingo-heads, .pk-bingo-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
}
.pk-bingo-head {
  text-align: center; font-weight: 900; font-size: 16px; padding: 2px 0;
  color: var(--accent, #ffc24b); letter-spacing: 1px;
}
.pk-bingo-grid { margin-top: 6px; }
.pk-bingo-cell {
  aspect-ratio: 1 / 1; border-radius: 10px; font-size: 20px; font-weight: 900;
  border: 2px solid var(--navy, #0e2a4a); background: #fff;
  color: var(--navy, #0e2a4a); cursor: default;
  box-shadow: 0 2px 0 rgba(14, 42, 74, 0.15);
  transition: transform .08s, background .15s;
}
/* tappable during a live call — interactive feedback only, NOT a "this is the one" hint */
.pk-bingo-cell[data-act]:not(:disabled) { cursor: pointer; }
.pk-bingo-cell[data-act]:not(:disabled):hover { transform: scale(1.06); background: #fff7df; }
.pk-bingo-cell[data-act]:not(:disabled):active { transform: scale(0.94); }
.pk-bingo-cell.marked {
  background: var(--m-green, #2fbf71); border-color: var(--m-green, #2fbf71);
  color: #fff; box-shadow: 0 2px 0 #1c8a52;
}
.pk-bingo-cell.free { color: var(--accent, #d98a00); font-size: 24px; background: #fff7df; border-color: var(--m-yellow-edge, #d98a00); }
.pk-bingo-cell.free.marked { background: var(--m-yellow, #ffc24b); color: #2a1c00; }
.pk-bingo-hint { text-align: center; font-size: 12px; color: var(--muted); margin: 10px 0 0; }

/* ── 🚪 少数派 ─────────────────────────────────────────────────────────── */
.pk-minority-stage { margin-top: 12px; }
.pk-minority-opts { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.pk-minority-opt { flex: 1 1 0; min-width: 130px; max-width: 220px; min-height: 60px; font-size: 15px; }
.pk-minority-tag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-right: 6px; border-radius: 50%;
  background: rgba(14, 42, 74, 0.16); font-weight: 900; font-size: 13px;
}
.pk-minority-results { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.pk-minority-result {
  flex: 1 1 0; min-width: 130px; max-width: 220px; text-align: center;
  padding: 12px; border-radius: var(--r-card, 14px);
  border: 2px solid rgba(14, 42, 74, 0.18); background: rgba(14, 42, 74, 0.05);
}
.pk-minority-result .pk-minority-tag {
  width: 30px; height: 30px; margin: 0 auto 6px; font-size: 16px;
}
.pk-minority-result.maj { border-color: var(--m-red, #e05); background: rgba(224, 0, 80, 0.1); }
.pk-minority-result.min { border-color: var(--m-green, #2c7); background: rgba(34, 204, 119, 0.12); }
