/* ==========================================================================
   好友牌局 · 霓虹手游风格
   深蓝紫渐变 + 霓虹光带 + 亮面胶囊按钮 + 发光绒面牌桌
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg-0: #070a2a;
  --bg-1: #0f1650;
  --bg-2: #1a1c6e;
  --bg-3: #2c1b8a;
  --panel: rgba(18, 24, 82, 0.72);
  --panel-2: rgba(28, 34, 110, 0.78);
  --line: rgba(140, 170, 255, 0.22);
  --line-2: rgba(160, 190, 255, 0.4);
  --text: #ffffff;
  --text-2: #d5ddff;
  --muted: #98a6e0;
  --cyan: #46e6ff;
  --cyan-2: #2a9dff;
  --blue: #3b82ff;
  --blue-2: #1f4fe0;
  --magenta: #ff4fd8;
  --violet: #b56cff;
  --violet-2: #7a2ff0;
  --green: #5cf07a;
  --green-2: #1db954;
  --gold: #ffd54a;
  --gold-2: #ffb020;
  --gold-3: #ff8a00;
  --red: #ff5f6d;
  --red-2: #e0233a;
  --shadow: 0 24px 60px rgba(0, 0, 20, 0.55);
  --shadow-sm: 0 10px 26px rgba(0, 0, 20, 0.45);
  --glow-cyan: 0 0 24px rgba(70, 230, 255, 0.55);
  --glow-magenta: 0 0 24px rgba(255, 79, 216, 0.5);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --pop: cubic-bezier(0.2, 1.4, 0.4, 1);
  font-family: -apple-system, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Noto Sans CJK SC",
    "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--bg-0);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease,
    transform 140ms var(--ease), box-shadow 140ms ease, filter 140ms ease, opacity 140ms ease;
}

button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: saturate(0.5);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(70, 230, 255, 0.8);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(70, 230, 255, 0.35);
}

/* --------------------------------------------------------------------------
   通用装饰：背景、光带、星星、金币
   -------------------------------------------------------------------------- */

.entry-texture,
.stage-deco {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.entry-texture {
  position: fixed;
  background:
    radial-gradient(ellipse 70% 60% at 15% 10%, rgba(255, 79, 216, 0.28), transparent 60%),
    radial-gradient(ellipse 60% 55% at 85% 90%, rgba(70, 230, 255, 0.22), transparent 60%),
    radial-gradient(ellipse 90% 70% at 50% 45%, rgba(90, 60, 220, 0.35), transparent 70%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-3) 55%, var(--bg-0) 100%);
}

.streak {
  position: absolute;
  width: 140vmax;
  height: 18vmax;
  border-radius: 999px;
  filter: blur(26px);
  opacity: 0.55;
  animation: streak-drift 14s ease-in-out infinite alternate;
}

.streak-a {
  top: 6%;
  left: -30%;
  transform: rotate(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 79, 216, 0.55), rgba(181, 108, 255, 0.5), transparent);
}

.streak-b {
  right: -30%;
  bottom: 8%;
  transform: rotate(-16deg);
  background: linear-gradient(90deg, transparent, rgba(70, 230, 255, 0.55), rgba(59, 130, 255, 0.5), transparent);
  animation-delay: -7s;
}

@keyframes streak-drift {
  to {
    transform: rotate(-18deg) translate(4vmax, 2vmax);
    opacity: 0.35;
  }
}

.sparkle {
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
  animation: twinkle 2.6s ease-in-out infinite;
}

.sparkle-1 {
  top: 12%;
  left: 18%;
}

.sparkle-2 {
  top: 22%;
  right: 16%;
  width: 12px;
  height: 12px;
  animation-delay: -1.1s;
}

.sparkle-3 {
  bottom: 18%;
  left: 12%;
  width: 24px;
  height: 24px;
  background: var(--gold);
  animation-delay: -0.6s;
}

@keyframes twinkle {
  0%,
  100% {
    transform: scale(0.6) rotate(0deg);
    opacity: 0.35;
  }
  50% {
    transform: scale(1.15) rotate(25deg);
    opacity: 1;
  }
}

.coin-deco {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff2b0, var(--gold) 45%, var(--gold-3) 100%);
  box-shadow: 0 0 0 4px rgba(255, 176, 32, 0.35), 0 12px 24px rgba(0, 0, 0, 0.4), inset 0 -4px 0 rgba(0, 0, 0, 0.18);
  animation: coin-float 5s ease-in-out infinite alternate;
}

.coin-deco::after {
  position: absolute;
  inset: 11px;
  border: 3px solid rgba(255, 138, 0, 0.55);
  border-radius: 50%;
  content: "";
}

.coin-1 {
  bottom: 14%;
  left: 7%;
  transform: rotate(-14deg);
}

.coin-2 {
  top: 26%;
  right: 6%;
  width: 34px;
  height: 34px;
  animation-delay: -2.4s;
}

.coin-2::after {
  inset: 8px;
}

@keyframes coin-float {
  to {
    transform: translateY(-14px) rotate(8deg);
  }
}

/* --------------------------------------------------------------------------
   入口 / 密钥页
   -------------------------------------------------------------------------- */

.entry-screen,
.access-screen {
  position: relative;
  display: grid;
  height: 100vh;
  height: 100dvh;
  place-items: center;
  overflow: auto;
  background: var(--bg-0);
}

.access-content,
.entry-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.access-content {
  width: min(92vw, 420px);
  min-height: min(620px, 92vh);
  padding: 40px 0;
  text-align: center;
}

.entry-content {
  width: min(92vw, 520px);
  min-height: min(820px, 94vh);
  padding: 44px 0 30px;
  gap: 26px;
}

.access-mark {
  display: grid;
  width: 76px;
  height: 76px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(160deg, var(--cyan), var(--blue-2));
  color: #fff;
  box-shadow: var(--glow-cyan), 0 14px 30px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.45);
}

.access-mark svg {
  width: 32px;
  height: 32px;
  stroke-width: 2.2;
}

.access-content h1,
.brand-lockup h1,
.result-title span {
  background: linear-gradient(180deg, #ffffff 0%, #fff4c2 45%, #ffcf3f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
  letter-spacing: 3px;
  filter: drop-shadow(0 3px 0 rgba(120, 50, 200, 0.9)) drop-shadow(0 10px 24px rgba(0, 0, 40, 0.6))
    drop-shadow(0 0 18px rgba(255, 210, 90, 0.35));
}

.access-content h1 {
  margin: 6px 0 0;
  font-size: 40px;
  line-height: 1.1;
}

.access-subtitle {
  margin: 12px 0 24px;
  color: var(--text-2);
  font-size: 14px;
}

.brand-lockup {
  position: relative;
  min-height: 200px;
  text-align: center;
}

.brand-lockup h1 {
  position: relative;
  z-index: 2;
  margin: 12px 0 0;
  font-size: 76px;
  line-height: 1;
}

.brand-kicker,
.brand-subtitle {
  position: relative;
  z-index: 2;
  margin: 0;
}

.brand-kicker {
  display: inline-flex;
  height: 26px;
  padding: 0 12px;
  align-items: center;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--magenta), var(--violet-2));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  box-shadow: var(--glow-magenta), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.brand-subtitle {
  display: flex;
  margin-top: 12px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 600;
}

.brand-subtitle::before,
.brand-subtitle::after {
  width: 56px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7));
  content: "";
}

.brand-subtitle::after {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.7), transparent);
}

.card-fan {
  position: absolute;
  top: -8px;
  left: 50%;
  z-index: 0;
  width: 280px;
  height: 204px;
  transform: translateX(-50%);
  opacity: 0.9;
}

.card-fan img {
  position: absolute;
  top: 0;
  left: calc(50% - 55px);
  width: 110px;
  height: 154px;
  border: 3px solid #fff;
  border-radius: 12px;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 40, 0.6));
}

.card-fan img:nth-child(1) {
  transform: translate(-52px, 14px) rotate(-19deg);
}

.card-fan img:nth-child(2) {
  transform: translateY(-4px);
}

.card-fan img:nth-child(3) {
  transform: translate(52px, 14px) rotate(19deg);
}

.entry-panel,
.access-panel {
  position: relative;
  display: flex;
  width: min(100%, 400px);
  padding: 24px;
  flex-direction: column;
  border: 2px solid rgba(120, 190, 255, 0.35);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(38, 44, 140, 0.72), rgba(16, 22, 90, 0.86));
  box-shadow: var(--shadow), 0 0 40px rgba(70, 120, 255, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(18px);
}

.entry-panel::before,
.access-panel::before {
  position: absolute;
  top: 0;
  right: 30px;
  left: 30px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), transparent);
  content: "";
}

.access-panel {
  width: min(100%, 360px);
  text-align: left;
}

.game-picker-wrap {
  display: flex;
  margin-bottom: 16px;
  flex-direction: column;
}

.game-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.game-choice {
  --tint: #7a2ff0;
  --tint-2: #b56cff;
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 68px;
  padding: 7px 8px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  color: var(--text-2);
  text-align: left;
}

.game-choice[data-game-type="zhajinhua"] {
  --tint: #e0233a;
  --tint-2: #ff8a5c;
}

.game-choice[data-game-type="niuniu"] {
  --tint: #1f7ae0;
  --tint-2: #46e6ff;
}

.game-choice[data-game-type="texas"] {
  --tint: #127d87;
  --tint-2: #46e6ff;
}

.game-choice[data-game-type="sangong"] {
  --tint: #99522d;
  --tint-2: #ffc369;
}

.game-choice[data-game-type="magu"] {
  --tint: #39704b;
  --tint-2: #84db92;
}

.game-choice:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.game-choice.active {
  border-color: #fff;
  background: linear-gradient(160deg, var(--tint-2), var(--tint));
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 40, 0.45), 0 0 24px color-mix(in srgb, var(--tint-2) 60%, transparent),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.game-choice.active::after {
  position: absolute;
  top: 6px;
  right: -22px;
  padding: 2px 26px;
  transform: rotate(35deg);
  background: var(--gold);
  color: #3a2200;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1px;
  content: "HOT";
}

.game-choice-mark {
  display: grid;
  width: 34px;
  height: 42px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  background: linear-gradient(160deg, var(--tint-2), var(--tint));
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(0, 0, 40, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.45);
}

.game-choice.active .game-choice-mark {
  background: rgba(255, 255, 255, 0.2);
}

.game-choice strong,
.game-choice small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-choice strong {
  font-size: 12px;
  font-weight: 900;
}

.game-choice small {
  margin-top: 3px;
  font-size: 11px;
  opacity: 0.8;
}

.field-label {
  margin-bottom: 8px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}

.entry-panel input,
.entry-panel select,
.access-panel input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 2px solid rgba(120, 190, 255, 0.28);
  border-radius: 14px;
  background: rgba(5, 10, 50, 0.55);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.entry-panel select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2346e6ff' stroke-width='2.4' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
}

.entry-panel select option {
  background: #141a60;
  color: #fff;
}

.entry-panel input::placeholder,
.access-panel input::placeholder {
  color: #7f8bc7;
  font-weight: 500;
}

.entry-panel input:focus,
.entry-panel select:focus,
.access-panel input:focus {
  border-color: var(--cyan);
  outline: none;
  box-shadow: 0 0 0 4px rgba(70, 230, 255, 0.22), inset 0 2px 6px rgba(0, 0, 0, 0.35);
}

.access-panel input {
  height: 56px;
  margin-bottom: 14px;
  font-size: 24px;
  letter-spacing: 10px;
  text-align: center;
}

.access-panel input::placeholder {
  font-size: 14px;
  letter-spacing: 0;
}

.access-panel .primary-button {
  width: 100%;
}

.access-error {
  min-height: 18px;
  margin: 12px 0 0;
  color: #ff9aa5;
  font-size: 12px;
  text-align: center;
}

.access-contact {
  display: grid;
  margin-top: 18px;
  padding-top: 18px;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  border-top: 1px solid rgba(140, 190, 255, 0.26);
}

.access-contact-qr {
  display: block;
  width: 108px;
  aspect-ratio: 1;
  padding: 4px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 18px rgba(70, 230, 255, 0.32), 0 8px 18px rgba(0, 0, 30, 0.38);
  transition: transform 160ms var(--ease), box-shadow 160ms ease;
}

.access-contact-qr:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 26px rgba(70, 230, 255, 0.5), 0 10px 22px rgba(0, 0, 30, 0.42);
}

.access-contact-qr img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.access-contact-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
}

.access-contact-title {
  display: inline-flex;
  margin-bottom: 5px;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.access-contact-title svg {
  width: 17px;
  height: 17px;
  color: var(--cyan);
}

.access-contact-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.mode-switch {
  display: grid;
  height: 44px;
  margin: 16px 0;
  padding: 4px;
  grid-template-columns: 1fr 1fr;
  border-radius: 999px;
  background: rgba(5, 10, 50, 0.6);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.mode-switch button {
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mode-switch button.active {
  background: linear-gradient(180deg, var(--cyan), var(--cyan-2));
  color: #04203a;
  box-shadow: 0 4px 12px rgba(42, 157, 255, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.room-code-field {
  display: flex;
  margin-bottom: 16px;
  flex-direction: column;
}

.room-code-field input {
  font-weight: 900;
  letter-spacing: 5px;
  text-transform: uppercase;
}

.stake-fields {
  display: grid;
  margin-bottom: 16px;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px 12px;
}

.stake-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.stake-hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   按钮体系
   -------------------------------------------------------------------------- */

.primary-button,
.action-button {
  position: relative;
  display: inline-flex;
  min-height: 48px;
  padding: 0 20px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  border-radius: 999px;
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.primary-button::before,
.action-button:not(.quiet-action)::before {
  position: absolute;
  top: 2px;
  right: 8%;
  left: 8%;
  height: 42%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.05));
  content: "";
  pointer-events: none;
}

.primary-button svg,
.action-button svg,
.icon-button svg,
.room-code-button svg,
.top-pill svg,
.panel-tab svg,
.chat-send svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2.4;
}

.primary-button {
  min-height: 54px;
  background: linear-gradient(180deg, var(--cyan) 0%, var(--cyan-2) 60%, var(--blue-2) 100%);
  color: #fff;
  font-size: 17px;
  box-shadow: 0 6px 0 #143a9e, 0 16px 30px rgba(42, 157, 255, 0.45);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.primary-button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #143a9e, 0 10px 20px rgba(42, 157, 255, 0.4);
}

.entry-submit {
  width: 100%;
  margin-top: 4px;
}

.legal-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.action-button {
  min-width: 92px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, #5f6dff, #3a3fd6);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 5px 0 #23278a, 0 12px 22px rgba(0, 0, 40, 0.45);
}

.action-button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.action-button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #23278a, 0 8px 16px rgba(0, 0, 40, 0.4);
}

.action-button.primary-action {
  background: linear-gradient(180deg, var(--red), var(--red-2));
  box-shadow: 0 5px 0 #8a1020, 0 12px 26px rgba(224, 35, 58, 0.45);
}

.action-button.gold-action {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-2) 60%, var(--gold-3) 100%);
  color: #3a2200;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow: 0 5px 0 #9a5200, 0 14px 28px rgba(255, 176, 32, 0.45);
}

.action-button.gold-action:active:not(:disabled) {
  box-shadow: 0 2px 0 #9a5200, 0 8px 16px rgba(255, 176, 32, 0.4);
}

.action-button.blue-action {
  background: linear-gradient(180deg, var(--cyan), var(--cyan-2) 60%, var(--blue-2));
  box-shadow: 0 5px 0 #143a9e, 0 12px 26px rgba(42, 157, 255, 0.45);
}

.action-button.quiet-action {
  border-color: rgba(160, 190, 255, 0.45);
  background: rgba(10, 16, 70, 0.55);
  color: var(--text-2);
  box-shadow: 0 3px 0 rgba(0, 0, 40, 0.5);
}

.action-button.quiet-action:hover:not(:disabled) {
  border-color: var(--cyan);
  color: #fff;
}

/* 牌局操作 */
.game-action {
  min-width: 104px;
  min-height: 52px;
  padding: 0 20px;
  font-size: 15px;
}

.game-action svg {
  width: 18px;
  height: 18px;
}

.act-look {
  background: linear-gradient(180deg, var(--cyan), var(--cyan-2) 60%, var(--blue-2));
  box-shadow: 0 5px 0 #143a9e, 0 12px 26px rgba(42, 157, 255, 0.45);
}

.act-fold {
  background: linear-gradient(180deg, #ff8a5c, var(--red) 55%, var(--red-2));
  box-shadow: 0 5px 0 #8a1020, 0 12px 26px rgba(224, 35, 58, 0.4);
}

.act-call {
  background: linear-gradient(180deg, var(--green), var(--green-2) 70%, #128a3e);
  box-shadow: 0 5px 0 #0a5a28, 0 12px 26px rgba(29, 185, 84, 0.45);
}

.act-raise,
.act-show {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-2) 60%, var(--gold-3) 100%);
  color: #3a2200;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow: 0 5px 0 #9a5200, 0 14px 28px rgba(255, 176, 32, 0.45);
}

.act-show {
  min-width: 150px;
}

.act-compare {
  background: linear-gradient(180deg, var(--violet), var(--violet-2) 70%, #5a1cc0);
  box-shadow: 0 5px 0 #3b0f8a, 0 12px 26px rgba(122, 47, 240, 0.5);
}

.action-cost {
  position: absolute;
  top: -8px;
  right: -4px;
  z-index: 2;
  display: grid;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), var(--gold-3));
  color: #3a2200;
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-shadow: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.action-note {
  width: 100%;
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

/* --------------------------------------------------------------------------
   牌局页 · 顶栏
   -------------------------------------------------------------------------- */

.game-screen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 60% 50% at 10% 0%, rgba(255, 79, 216, 0.22), transparent 60%),
    radial-gradient(ellipse 60% 55% at 95% 100%, rgba(70, 230, 255, 0.2), transparent 60%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-3) 55%, var(--bg-0) 100%);
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  height: 64px;
  padding: 0 16px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(140, 170, 255, 0.18);
  background: rgba(8, 12, 60, 0.55);
  backdrop-filter: blur(14px);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  text-shadow: 0 2px 0 rgba(0, 0, 40, 0.5);
}

.topbar-brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 11px;
  background: linear-gradient(160deg, #ff8a5c, var(--red-2));
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(0, 0, 40, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.45);
}

.game-niuniu .topbar-brand-mark {
  background: linear-gradient(160deg, var(--cyan), #1f7ae0);
}

.game-texas .topbar-brand-mark {
  background: linear-gradient(160deg, #36d9ed, #126480);
}

.topbar-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-code-button,
.top-pill {
  display: inline-flex;
  height: 36px;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(0, 0, 40, 0.4);
  box-shadow: 0 4px 0 rgba(0, 0, 40, 0.35), 0 8px 18px rgba(0, 0, 40, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

.pill-blue {
  background: linear-gradient(180deg, #4fa8ff, #1f5fe0);
}

.pill-violet {
  background: linear-gradient(180deg, var(--violet), var(--violet-2));
}

.pill-gold {
  background: linear-gradient(180deg, #ffe37a, var(--gold-2));
  color: #3a2200;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.pill-gold svg {
  color: var(--gold-3);
}

.room-code-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.room-code-button strong {
  margin-left: 2px;
  font-size: 15px;
  letter-spacing: 2px;
}

.top-pill strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.connection-state {
  display: inline-flex;
  justify-self: end;
  margin-right: 210px;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(92, 240, 122, 0.22), 0 0 10px var(--green);
}

.connection-state.offline .connection-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 95, 109, 0.22), 0 0 10px var(--red);
}

.connection-state.reconnecting .connection-dot {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 213, 74, 0.22), 0 0 10px var(--gold);
  animation: connection-pulse 1s ease-in-out infinite alternate;
}

@keyframes connection-pulse {
  to {
    opacity: 0.4;
  }
}

.topbar-actions {
  position: absolute;
  top: 0;
  right: 12px;
  display: flex;
  height: 64px;
  align-items: center;
  gap: 6px;
}

.icon-button {
  position: relative;
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 40, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.icon-button:hover {
  border-color: var(--cyan);
  transform: translateY(-1px);
  box-shadow: var(--glow-cyan), 0 4px 10px rgba(0, 0, 40, 0.35);
}

.danger-icon:hover {
  border-color: var(--red);
  box-shadow: 0 0 18px rgba(255, 95, 109, 0.55);
}

.unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  animation: pop-in 220ms var(--pop);
}

/* --------------------------------------------------------------------------
   牌局页 · 布局与牌桌
   -------------------------------------------------------------------------- */

.game-layout {
  display: grid;
  height: calc(100vh - 64px);
  height: calc(100dvh - 64px);
  grid-template-columns: minmax(0, 1fr) 300px;
}

.table-stage {
  position: relative;
  min-width: 0;
  min-height: 580px;
  overflow: hidden;
}

.stage-deco .streak {
  opacity: 0.4;
}

.stage-deco .streak-a {
  top: 0;
}

.stage-deco .streak-b {
  bottom: 22%;
}

.table-rail,
.table-felt {
  position: absolute;
  top: 30px;
  left: 50%;
  width: min(92%, 980px);
  height: min(calc(100% - 220px), 590px);
  min-height: 360px;
  transform: translateX(-50%);
  border-radius: 999px;
}

.table-rail {
  display: none;
}

/* 绿色绒面 + 深色桌沿 + 霓虹外圈 */
.table-felt {
  --felt-1: #2fbf6a;
  --felt-2: #158a48;
  --felt-3: #0b5a2f;
  --rim: #1a2147;
  --rim-2: #2a3270;
  z-index: 1;
  border: 16px solid var(--rim);
  background:
    radial-gradient(ellipse 60% 55% at 50% 42%, rgba(255, 255, 255, 0.16), transparent 70%),
    radial-gradient(ellipse 120% 100% at 50% 110%, rgba(0, 0, 0, 0.35), transparent 60%),
    linear-gradient(180deg, var(--felt-1) 0%, var(--felt-2) 55%, var(--felt-3) 100%);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.12),
    inset 0 0 60px rgba(0, 40, 20, 0.5),
    0 0 0 2px rgba(255, 255, 255, 0.18),
    0 0 0 8px var(--rim-2),
    0 0 0 10px rgba(70, 230, 255, 0.55),
    0 0 40px 12px rgba(70, 230, 255, 0.35),
    0 0 90px 20px rgba(255, 79, 216, 0.25),
    0 40px 80px rgba(0, 0, 30, 0.6);
}

.table-felt::before {
  position: absolute;
  inset: 22px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.table-felt::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 58%;
  height: 58%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 70%);
  content: "";
  pointer-events: none;
}

.table-brand {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.16);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 8px;
  pointer-events: none;
  user-select: none;
}

.game-niuniu .table-felt {
  --felt-1: #6a3fd8;
  --felt-2: #4a25b0;
  --felt-3: #2a1478;
}

.game-texas .table-felt {
  --felt-1: #1bb5aa;
  --felt-2: #107c7b;
  --felt-3: #075252;
  --rim: #152b46;
  --rim-2: #254c73;
}

.community-cards {
  position: absolute;
  top: 35%;
  left: 50%;
  z-index: 5;
  display: none;
  min-height: 100px;
  transform: translateX(-50%);
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.game-texas .community-cards {
  display: flex;
}

.community-card {
  width: 62px;
  height: 90px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.13);
}

.community-card.back {
  opacity: 0.85;
}

.game-texas .table-center {
  top: 69%;
  width: 146px;
  min-height: 120px;
}

.game-texas .table-brand {
  color: rgba(220, 255, 255, 0.22);
}

.table-center {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: flex;
  width: 176px;
  min-height: 172px;
  padding: 12px 12px 14px;
  transform: translate(-50%, -50%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(10, 16, 70, 0.62), rgba(6, 10, 50, 0.78));
  color: #fff;
  text-align: center;
  box-shadow: 0 16px 36px rgba(0, 0, 30, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.pot-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 6px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff2b0, var(--gold) 45%, var(--gold-3) 100%);
  color: #6a3a00;
  box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.35), 0 8px 18px rgba(0, 0, 0, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}

.pot-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}

.pot-label,
.stake-value {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.pot-value {
  min-height: 32px;
  background: linear-gradient(180deg, #fff6cf, var(--gold) 60%, var(--gold-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 30px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 32px;
  filter: drop-shadow(0 2px 0 rgba(120, 50, 0, 0.6));
}

.pot-breakdown {
  display: flex;
  max-width: 150px;
  margin-top: 3px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px;
}

.pot-segment {
  padding: 2px 5px;
  border: 1px solid rgba(255, 213, 74, 0.55);
  border-radius: 6px;
  background: rgba(255, 176, 32, 0.12);
  color: #ffe79a;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.table-center.pot-flash {
  animation: pot-flash 520ms ease-out both;
}

@keyframes pot-flash {
  0% {
    box-shadow: 0 16px 36px rgba(0, 0, 30, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 0 0 rgba(255, 213, 74, 0);
  }
  35% {
    box-shadow: 0 16px 36px rgba(0, 0, 30, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 0 30px rgba(255, 213, 74, 0.8);
  }
  100% {
    box-shadow: 0 16px 36px rgba(0, 0, 30, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 0 0 rgba(255, 213, 74, 0);
  }
}

.round-status {
  max-width: 160px;
  min-height: 21px;
  margin-top: 6px;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stake-value {
  margin-top: 6px;
}

.turn-timer {
  width: 104px;
  margin-top: 5px;
}

.turn-timer > span {
  display: block;
  min-height: 17px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.timer-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.timer-fill {
  width: 100%;
  height: 100%;
  transform: scaleX(1);
  transform-origin: left;
  background: linear-gradient(90deg, var(--cyan-2), var(--cyan));
  box-shadow: 0 0 10px var(--cyan);
}

.turn-timer.urgent > span {
  color: var(--red);
  animation: timer-pulse 0.5s ease-in-out infinite alternate;
}

.turn-timer.urgent .timer-fill {
  background: linear-gradient(90deg, var(--red-2), var(--red));
  box-shadow: 0 0 10px var(--red);
}

@keyframes timer-pulse {
  to {
    opacity: 0.5;
  }
}

/* --------------------------------------------------------------------------
   座位
   -------------------------------------------------------------------------- */

.players-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.player-seat {
  position: absolute;
  display: grid;
  width: 152px;
  min-height: 64px;
  padding: 8px 10px;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(30, 38, 120, 0.85), rgba(12, 18, 70, 0.9));
  box-shadow: var(--shadow-sm), inset 0 2px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.player-seat.current {
  border-color: var(--cyan);
  animation: seat-glow 1.2s ease-in-out infinite alternate;
}

@keyframes seat-glow {
  from {
    box-shadow: 0 0 0 2px rgba(70, 230, 255, 0.25), 0 0 16px rgba(70, 230, 255, 0.4), var(--shadow-sm);
  }
  to {
    box-shadow: 0 0 0 4px rgba(70, 230, 255, 0.45), 0 0 34px rgba(70, 230, 255, 0.75), var(--shadow-sm);
  }
}

.player-seat.banker {
  border-color: var(--gold);
}

.player-seat.texas-seat {
  border-color: rgba(92, 229, 255, 0.4);
}

.player-seat.texas-seat.current,
.player-seat.texas-seat.all-in {
  border-color: var(--gold);
}

.seat-bet {
  position: absolute;
  right: 7px;
  bottom: -16px;
  z-index: 6;
  padding: 2px 6px;
  border: 1px solid rgba(255, 213, 74, 0.65);
  border-radius: 999px;
  background: #101c2d;
  color: #ffe49a;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.player-seat.folded {
  opacity: 0.55;
  filter: saturate(0.6);
}

.player-seat.offline {
  filter: saturate(0.2);
}

.player-seat.winner {
  border-color: #fff;
  background: linear-gradient(180deg, rgba(255, 176, 32, 0.55), rgba(120, 60, 0, 0.75));
  box-shadow: 0 0 0 3px rgba(255, 213, 74, 0.5), 0 0 36px rgba(255, 176, 32, 0.7), var(--shadow-sm);
  animation: none;
}

.winner-badge {
  position: absolute;
  top: -12px;
  left: 10px;
  z-index: 8;
  display: inline-flex;
  height: 22px;
  padding: 0 10px;
  align-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), var(--gold-3));
  color: #3a2200;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  animation: pop-in 260ms var(--pop);
}

@keyframes pop-in {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}

.seat-top {
  top: -8px;
  left: 50%;
  transform: translate(-50%, -35%);
}

.seat-top-left {
  top: 12%;
  left: 9%;
  transform: translate(-50%, -50%);
}

.seat-top-right {
  top: 12%;
  right: 9%;
  transform: translate(50%, -50%);
}

.seat-left {
  top: 54%;
  left: 0;
  transform: translate(-43%, -50%);
}

.seat-right {
  top: 54%;
  right: 0;
  transform: translate(43%, -50%);
}

.seat-bottom-left {
  bottom: 7%;
  left: 12%;
  transform: translate(-50%, 50%);
}

.seat-bottom-right {
  right: 12%;
  bottom: 7%;
  transform: translate(50%, 50%);
}

.avatar {
  --avatar-hue: 200;
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background:
    var(--avatar-image, none) center 18% / cover no-repeat,
    linear-gradient(160deg, hsl(var(--avatar-hue) 90% 70%), hsl(var(--avatar-hue) 75% 45%));
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 0 2px hsl(var(--avatar-hue) 90% 60% / 0.55), 0 6px 14px rgba(0, 0, 40, 0.45),
    inset 0 2px 0 rgba(255, 255, 255, 0.45);
}

.avatar-initial {
  opacity: 0;
}

.avatar .dealer-badge {
  position: absolute;
  right: -7px;
  bottom: -6px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold), var(--gold-3));
  color: #3a2200;
  font-size: 10px;
  font-weight: 900;
}

.seat-copy {
  min-width: 0;
}

.seat-name-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.seat-name {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--gold);
  filter: drop-shadow(0 0 4px rgba(255, 213, 74, 0.8));
}

.seat-chips {
  display: block;
  margin-top: 2px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.seat-state {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-2);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-card-stack {
  position: absolute;
  right: 8px;
  bottom: -13px;
  width: 38px;
  height: 21px;
}

.seat-card-stack span {
  position: absolute;
  width: 18px;
  height: 25px;
  border: 1.5px solid #fff;
  border-radius: 3px;
  background: #293244 url("/assets/wcgame/card-back.png") center / cover no-repeat;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.seat-revealed-hand {
  position: absolute;
  left: 50%;
  bottom: -37px;
  display: flex;
  transform: translateX(-50%);
  gap: 2px;
}

.game-niuniu .seat-revealed-hand {
  gap: 0;
}

.game-niuniu .seat-revealed-hand .small-card + .small-card {
  margin-left: -5px;
}

.score-change {
  position: absolute;
  top: -12px;
  right: 8px;
  z-index: 8;
  padding: 2px 9px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #101650;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  animation: pop-in 300ms var(--pop);
}

.score-change.positive,
.my-score-change.positive,
.result-delta.positive {
  color: var(--gold);
}

.score-change.negative,
.my-score-change.negative,
.result-delta.negative {
  color: #ff8d98;
}

.speech-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 9;
  min-width: 58px;
  max-width: 150px;
  padding: 7px 12px;
  transform: translateX(-50%);
  border: 2px solid #fff;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #eef3ff);
  color: #1b2050;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  word-break: break-word;
  box-shadow: 0 8px 20px rgba(0, 0, 40, 0.45);
  animation: bubble-in 180ms var(--pop);
}

.speech-bubble::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff;
  content: "";
}

@keyframes bubble-in {
  from {
    transform: translate(-50%, 6px) scale(0.8);
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   手牌区
   -------------------------------------------------------------------------- */

.hand-dock {
  position: absolute;
  right: 18px;
  bottom: 14px;
  left: 18px;
  z-index: 8;
  display: grid;
  height: 172px;
  padding: 13px 18px;
  grid-template-columns: minmax(130px, 0.7fr) 250px minmax(290px, 1.4fr);
  align-items: center;
  gap: 16px;
  border: 2px solid rgba(140, 190, 255, 0.35);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(30, 38, 120, 0.78), rgba(10, 16, 70, 0.9));
  color: #fff;
  box-shadow: var(--shadow), 0 0 30px rgba(70, 120, 255, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(16px);
  transition: box-shadow 200ms ease, border-color 200ms ease;
}

.hand-dock.winner {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 213, 74, 0.4), 0 0 50px rgba(255, 176, 32, 0.5), var(--shadow);
}

.game-niuniu .hand-dock {
  grid-template-columns: minmax(130px, 0.6fr) 320px minmax(300px, 1.2fr);
}

.my-identity {
  min-width: 0;
}

.my-name-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.my-name-row svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
  filter: drop-shadow(0 0 4px rgba(255, 213, 74, 0.8));
}

.my-name {
  overflow: hidden;
  font-size: 16px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.banker-label {
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold), var(--gold-3));
  color: #3a2200;
  font-size: 10px;
  font-weight: 900;
}

.my-chip-count {
  display: inline-flex;
  height: 28px;
  margin-top: 8px;
  padding: 0 11px 0 9px;
  align-items: center;
  gap: 5px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe37a, var(--gold-2));
  color: #3a2200;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 3px 0 #9a5200, inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.my-chip-count svg {
  width: 14px;
  height: 14px;
  color: var(--gold-3);
}

.my-state {
  display: block;
  min-height: 18px;
  margin-top: 8px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
}

.my-score-change {
  display: block;
  min-height: 18px;
  margin-top: 3px;
  font-size: 13px;
  font-weight: 900;
}

.my-hand {
  position: relative;
  display: flex;
  min-width: 224px;
  min-height: 125px;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.niuniu-hand {
  min-width: 300px;
  gap: 5px;
}

.niuniu-hand .playing-card {
  width: 56px;
  height: 84px;
}

.playing-card {
  position: relative;
  width: 68px;
  height: 100px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f1f4ff 100%);
  color: #1b2050;
  box-shadow: 0 8px 18px rgba(0, 0, 40, 0.45), inset 0 1px 0 #fff;
  user-select: none;
  transition: transform 160ms var(--ease), box-shadow 160ms ease;
}

.playing-card.card-sprite,
.playing-card.back {
  background: #e9e9e9 var(--card-image) center / 100% 100% no-repeat;
}

.playing-card.card-sprite .card-corner,
.playing-card.card-sprite .card-suit-large {
  display: none;
}

.playing-card.red {
  color: #e8323c;
}

.playing-card.back {
  border-color: #fff;
  background-color: #223547;
}

.my-hand .playing-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 28px rgba(0, 0, 40, 0.55), 0 0 20px rgba(70, 230, 255, 0.35);
}

.playing-card.deal-in {
  animation: deal-in 380ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes deal-in {
  from {
    transform: translate(0, -28px) rotate(-6deg) scale(0.9);
    opacity: 0;
  }
}

.card-corner {
  position: absolute;
  top: 6px;
  left: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 18px;
  font-weight: 900;
  line-height: 16px;
}

.card-corner .corner-suit {
  margin-top: 2px;
  font-size: 15px;
}

.card-suit-large {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -43%);
  font-size: 38px;
}

.playing-card.small-card {
  width: 28px;
  height: 40px;
  border-width: 1.5px;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.small-card .card-corner {
  top: 3px;
  left: 3px;
  font-size: 9px;
  line-height: 8px;
}

.small-card .corner-suit {
  font-size: 8px;
}

.small-card .card-suit-large {
  display: none;
}

.hand-placeholder {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.hand-name {
  position: absolute;
  bottom: 0;
  left: 50%;
  display: inline-flex;
  height: 22px;
  padding: 0 12px;
  align-items: center;
  transform: translateX(-50%);
  border: 2px solid #fff;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--violet), var(--violet-2));
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 40, 0.45);
}

/* --------------------------------------------------------------------------
   操作区
   -------------------------------------------------------------------------- */

.action-area {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 110px;
  align-content: center;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.action-area.multi-choice {
  flex-wrap: nowrap;
  gap: 6px;
}

.action-area.multi-choice .action-button {
  min-width: 58px;
  padding: 0 10px;
}

.raise-wrap {
  position: relative;
}

.raise-options {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  z-index: 10;
  display: grid;
  width: 190px;
  padding: 8px;
  gap: 4px;
  border: 2px solid rgba(140, 190, 255, 0.4);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(30, 38, 120, 0.96), rgba(10, 16, 70, 0.98));
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: menu-in 160ms var(--pop);
}

@keyframes menu-in {
  from {
    transform: translateY(8px) scale(0.96);
    opacity: 0;
  }
}

.raise-options button {
  display: flex;
  min-height: 40px;
  padding: 0 12px;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.raise-options button:hover {
  background: rgba(70, 230, 255, 0.18);
}

.raise-custom {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding: 8px 6px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.raise-custom-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-2);
  font-size: 11px;
}

.raise-custom-head strong {
  color: var(--gold);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.raise-custom input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
}

.raise-custom-confirm {
  min-height: 34px !important;
  justify-content: center !important;
  background: linear-gradient(180deg, var(--cyan), var(--blue-2)) !important;
  color: #fff !important;
}

.raise-options span:last-child {
  color: var(--gold);
  font-weight: 900;
}

.refill-target {
  margin-left: 2px;
  opacity: 0.85;
}

.refill-pending {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.refill-review {
  display: flex;
  width: 100%;
  max-height: 96px;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  overflow-y: auto;
  border: 2px dashed rgba(140, 190, 255, 0.4);
  border-radius: 14px;
  background: rgba(5, 10, 50, 0.4);
}

.refill-review-title {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 800;
}

.refill-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.refill-row-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-button.refill-mini {
  min-width: 0;
  min-height: 30px;
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  box-shadow: 0 3px 0 #23278a;
}

.action-button.gold-action.refill-mini {
  box-shadow: 0 3px 0 #9a5200;
}

/* --------------------------------------------------------------------------
   侧栏：记录 / 聊天
   -------------------------------------------------------------------------- */

.history-panel {
  position: relative;
  z-index: 12;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border-left: 1px solid rgba(140, 170, 255, 0.2);
  background: rgba(8, 12, 60, 0.62);
  backdrop-filter: blur(16px);
}

.panel-tabs {
  display: flex;
  height: 56px;
  padding: 10px 10px 0;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(140, 170, 255, 0.2);
}

.panel-tab {
  position: relative;
  display: inline-flex;
  height: 38px;
  padding: 0 14px;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.panel-tab svg {
  width: 15px;
  height: 15px;
}

.panel-tab:hover {
  color: #fff;
}

.panel-tab.active {
  background: linear-gradient(180deg, var(--cyan), var(--cyan-2));
  color: #04203a;
  box-shadow: 0 4px 12px rgba(42, 157, 255, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.panel-tabs .icon-button {
  margin-left: auto;
}

.tab-badge {
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.panel-pane {
  display: none;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.panel-pane.active {
  display: flex;
}

.eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
}

.dialog-heading h2 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.history-list {
  min-height: 0;
  margin: 0;
  padding: 10px 14px;
  flex: 1;
  overflow: auto;
  list-style: none;
  scrollbar-color: rgba(140, 170, 255, 0.35) transparent;
  scrollbar-width: thin;
}

.history-list li {
  position: relative;
  min-height: 44px;
  padding: 8px 6px 8px 20px;
  border-bottom: 1px solid rgba(140, 170, 255, 0.14);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.history-list li:last-child {
  animation: log-in 220ms ease-out;
}

@keyframes log-in {
  from {
    transform: translateX(6px);
    opacity: 0;
  }
}

.history-list li::before {
  position: absolute;
  top: 15px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5b6ac9;
  content: "";
}

.history-list li[data-tone="win"] {
  margin: 4px 0;
  padding-left: 24px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 176, 32, 0.28), transparent);
  color: var(--gold);
}

.history-list li[data-tone="win"]::before {
  left: 8px;
}

.history-list li[data-tone="win"]::before,
.history-list li[data-tone="raise"]::before {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

.history-list li[data-tone="compare"]::before,
.history-list li[data-tone="fold"]::before {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

.history-list li[data-tone="bet"]::before {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.history-list time {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.empty-history {
  padding: 24px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.room-summary {
  display: flex;
  padding: 10px 16px 12px;
  justify-content: space-between;
  border-top: 1px solid rgba(140, 170, 255, 0.2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.chat-list {
  display: flex;
  min-height: 0;
  margin: 0;
  padding: 12px 12px 6px;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  list-style: none;
  scrollbar-color: rgba(140, 170, 255, 0.35) transparent;
  scrollbar-width: thin;
}

.chat-item {
  display: flex;
  max-width: 88%;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.chat-item:last-child {
  animation: log-in 200ms ease-out;
}

.chat-item.mine {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 10px;
}

.chat-name {
  color: var(--text-2);
  font-weight: 800;
}

.chat-bubble {
  padding: 8px 13px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px 16px 16px 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

.chat-item.mine .chat-bubble {
  border-color: rgba(255, 255, 255, 0.5);
  border-radius: 16px 16px 4px 16px;
  background: linear-gradient(180deg, var(--cyan), var(--cyan-2));
  color: #04203a;
  text-shadow: none;
}

.chat-item.quick .chat-bubble {
  font-weight: 900;
}

.voice-bubble {
  --voice-progress: 0%;
  display: flex;
  width: 184px;
  min-height: 44px;
  padding: 7px 12px;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  background: linear-gradient(
    90deg,
    rgba(70, 230, 255, 0.28) 0 var(--voice-progress),
    rgba(255, 255, 255, 0.1) var(--voice-progress) 100%
  );
  color: #fff;
  text-align: left;
}

.chat-item.mine .voice-bubble {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.55) 0 var(--voice-progress),
    var(--cyan-2) var(--voice-progress) 100%
  );
}

.voice-bubble.playing {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(255, 213, 74, 0.3);
}

.voice-play-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.voice-waveform {
  display: flex;
  height: 22px;
  flex: 1;
  align-items: center;
  gap: 3px;
}

.voice-waveform i {
  display: block;
  width: 3px;
  height: 8px;
  border-radius: 3px;
  background: currentColor;
  opacity: 0.84;
}

.voice-waveform i:nth-child(2),
.voice-waveform i:nth-child(7) { height: 13px; }
.voice-waveform i:nth-child(3),
.voice-waveform i:nth-child(6) { height: 18px; }
.voice-waveform i:nth-child(4) { height: 22px; }
.voice-waveform i:nth-child(5) { height: 16px; }

.voice-duration {
  min-width: 29px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: right;
}

.quick-chips {
  display: flex;
  padding: 6px 12px 4px;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-chips button {
  height: 28px;
  padding: 0 12px;
  border: 2px solid rgba(160, 190, 255, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 800;
}

.quick-chips button:hover {
  border-color: var(--magenta);
  background: rgba(255, 79, 216, 0.18);
  color: #fff;
}

.chat-form {
  display: flex;
  padding: 8px 12px 12px;
  gap: 8px;
}

.chat-form input {
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  flex: 1;
  border: 2px solid rgba(120, 190, 255, 0.28);
  border-radius: 999px;
  background: rgba(5, 10, 50, 0.6);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.chat-form input::placeholder {
  color: #7f8bc7;
}

.chat-form input:focus {
  border-color: var(--cyan);
  outline: none;
  box-shadow: 0 0 0 3px rgba(70, 230, 255, 0.22);
}

.chat-send {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--cyan), var(--cyan-2));
  color: #04203a;
  box-shadow: 0 4px 0 #143a9e, 0 8px 18px rgba(42, 157, 255, 0.45);
}

.chat-voice {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid rgba(160, 190, 255, 0.42);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(49, 61, 112, 0.95), rgba(17, 24, 67, 0.98));
  color: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 30, 0.55), 0 8px 18px rgba(0, 0, 40, 0.35);
}

.chat-voice:hover:not(:disabled) {
  border-color: var(--cyan);
  transform: translateY(-1px);
}

.chat-voice.recording {
  border-color: #fff;
  background: linear-gradient(180deg, #ff7b86, var(--red-2));
  box-shadow: 0 4px 0 #7d1426, 0 0 18px rgba(255, 95, 109, 0.68);
  animation: voice-recording-pulse 900ms ease-in-out infinite alternate;
}

.chat-voice svg {
  width: 18px;
  height: 18px;
}

.voice-record-timer {
  position: absolute;
  top: -9px;
  left: 50%;
  min-width: 35px;
  height: 17px;
  padding: 0 4px;
  transform: translateX(-50%);
  border: 1px solid #fff;
  border-radius: 999px;
  background: #ad1831;
  color: #fff;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 15px;
}

@keyframes voice-recording-pulse {
  to {
    box-shadow: 0 4px 0 #7d1426, 0 0 28px rgba(255, 95, 109, 0.92);
  }
}

.chat-send:hover:not(:disabled) {
  transform: translateY(-1px);
}

.chat-send svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   Toast / 弹窗
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  top: 78px;
  left: 50%;
  z-index: 100;
  max-width: min(90vw, 420px);
  min-height: 42px;
  padding: 10px 18px;
  transform: translate(-50%, -12px);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(40, 50, 150, 0.95), rgba(16, 22, 90, 0.97));
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  box-shadow: var(--shadow), 0 0 24px rgba(70, 120, 255, 0.35);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms var(--pop);
}

.toast.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.in-game .toast {
  top: auto;
  bottom: 198px;
  transform: translate(-50%, 12px);
}

.in-game .toast.visible {
  transform: translate(-50%, 0);
}

.toast.error {
  border-color: rgba(255, 95, 109, 0.7);
  background: linear-gradient(180deg, rgba(150, 30, 60, 0.95), rgba(90, 16, 40, 0.97));
  box-shadow: var(--shadow), 0 0 24px rgba(255, 95, 109, 0.4);
}

.game-dialog {
  width: min(92vw, 500px);
  padding: 22px;
  border: 2px solid rgba(140, 190, 255, 0.4);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(38, 44, 140, 0.96), rgba(12, 18, 76, 0.98));
  color: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 30, 0.7), 0 0 40px rgba(70, 120, 255, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.25);
}

.game-dialog::backdrop {
  background: rgba(4, 6, 30, 0.72);
  backdrop-filter: blur(5px);
}

.game-dialog[open] {
  animation: dialog-in 240ms var(--pop);
}

@keyframes dialog-in {
  from {
    transform: translateY(16px) scale(0.94);
    opacity: 0;
  }
}

.compact-dialog {
  width: min(92vw, 400px);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.hand-ranking {
  display: grid;
  margin: 20px 0 16px;
  padding: 0;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  list-style: none;
}

.hand-ranking li {
  display: flex;
  min-height: 62px;
  padding: 10px 12px;
  flex-direction: column;
  justify-content: center;
  border: 2px solid rgba(140, 190, 255, 0.25);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.hand-ranking strong {
  color: var(--gold);
  font-size: 14px;
  font-weight: 900;
}

.hand-ranking span {
  margin-top: 3px;
  color: var(--text-2);
  font-size: 11px;
}

.rules-footnote {
  margin: 0 0 8px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.7;
}

.compare-targets {
  display: grid;
  margin-top: 18px;
  gap: 8px;
}

.compare-target-button {
  display: flex;
  min-height: 52px;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  border: 2px solid rgba(140, 190, 255, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 800;
}

.compare-target-button:hover {
  border-color: var(--violet);
  background: rgba(181, 108, 255, 0.2);
  box-shadow: 0 0 18px rgba(181, 108, 255, 0.45);
}

.compare-target-button span:last-child {
  color: var(--gold);
  font-size: 12px;
}

/* 结算弹窗 */
.result-dialog {
  position: relative;
  width: min(94vw, 560px);
  padding: 26px 26px 24px;
  overflow: visible;
  border-color: rgba(255, 255, 255, 0.5);
  background: linear-gradient(180deg, rgba(60, 60, 190, 0.92), rgba(24, 24, 110, 0.97));
  box-shadow: 0 30px 80px rgba(0, 0, 30, 0.7), 0 0 60px rgba(181, 108, 255, 0.45), 0 0 120px rgba(70, 230, 255, 0.25),
    inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

.result-deco {
  position: absolute;
  inset: -30px;
  overflow: visible;
  pointer-events: none;
}

.result-deco .sparkle-1 {
  top: 8px;
  left: 22px;
}

.result-deco .sparkle-2 {
  top: 40px;
  right: 30px;
}

.result-deco .sparkle-3 {
  bottom: 60px;
  left: 6px;
}

.result-deco .coin-1 {
  bottom: 10px;
  left: -6px;
}

.result-deco .coin-2 {
  top: 60px;
  right: -8px;
}

.result-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.result-title {
  margin: 0;
  text-align: center;
}

.result-title span {
  display: inline-block;
  font-size: 36px;
  letter-spacing: 6px;
}

.result-headline {
  margin: 14px 0 0;
  text-align: center;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 1px;
}

.result-headline.win {
  background: linear-gradient(180deg, #fff6cf, var(--gold) 60%, var(--gold-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(120, 50, 0, 0.6)) drop-shadow(0 0 16px rgba(255, 213, 74, 0.5));
}

.result-headline.lose {
  color: #ff9aa5;
}

.result-headline.neutral {
  color: var(--text-2);
}

.result-subline {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.result-body {
  display: flex;
  max-height: min(46vh, 340px);
  margin: 16px 0 0;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  scrollbar-color: rgba(140, 170, 255, 0.35) transparent;
  scrollbar-width: thin;
}

.result-row {
  display: grid;
  padding: 8px 12px;
  grid-template-columns: minmax(0, 1.2fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.result-row.won {
  border-color: rgba(255, 213, 74, 0.75);
  background: linear-gradient(90deg, rgba(255, 176, 32, 0.3), rgba(255, 255, 255, 0.06));
}

.result-row.me {
  box-shadow: 0 0 0 2px rgba(70, 230, 255, 0.45);
}

.result-who {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.result-avatar {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

.result-who strong,
.result-who small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-who strong {
  font-size: 13px;
  font-weight: 900;
}

.result-who small {
  margin-top: 2px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
}

.result-cards {
  display: flex;
  gap: 2px;
}

.result-cards .small-card + .small-card {
  margin-left: -6px;
}

.result-delta {
  min-width: 56px;
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.result-actions {
  display: flex;
  margin-top: 18px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.result-actions .action-button {
  min-width: 150px;
  min-height: 50px;
  font-size: 15px;
}

.result-actions .action-note {
  width: auto;
}

.mobile-only {
  display: none;
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .top-pill.pill-violet {
    display: none;
  }
}

@media (max-width: 1040px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .connection-state {
    margin-right: 190px;
  }

  .hand-dock {
    grid-template-columns: 120px 225px minmax(260px, 1fr);
    gap: 10px;
  }

  .game-niuniu .hand-dock {
    grid-template-columns: 110px 290px minmax(280px, 1fr);
  }

  .playing-card {
    width: 62px;
    height: 91px;
  }

  .my-hand {
    min-width: 205px;
  }
}

@media (max-width: 800px) {
  body {
    overflow: hidden;
  }

  .mobile-only {
    display: inline-grid;
  }

  .topbar {
    height: 58px;
    padding: 0 10px;
    grid-template-columns: 36px minmax(0, 1fr) 176px;
  }

  .topbar-brand > span:last-child {
    display: none;
  }

  .topbar-brand-mark {
    width: 30px;
    height: 30px;
  }

  .topbar-pills {
    justify-self: center;
    gap: 6px;
  }

  .top-pill {
    display: none;
  }

  .room-code-button {
    width: 132px;
    height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .connection-state {
    display: none;
  }

  .topbar-actions {
    right: 6px;
    height: 58px;
    gap: 2px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
  }

  .topbar-actions .icon-button {
    width: 32px;
    height: 32px;
  }

  .game-layout {
    display: block;
    height: calc(100vh - 58px);
    height: calc(100dvh - 58px);
  }

  .table-stage {
    height: 100%;
    min-height: 510px;
  }

  .table-rail,
  .table-felt {
    top: 38px;
    width: calc(100% - 28px);
    height: min(49vh, 430px);
    min-height: 320px;
  }

  .table-felt {
    border-width: 10px;
    box-shadow:
      inset 0 0 0 2px rgba(255, 255, 255, 0.12),
      inset 0 0 40px rgba(0, 40, 20, 0.5),
      0 0 0 2px rgba(255, 255, 255, 0.18),
      0 0 0 5px var(--rim-2),
      0 0 0 7px rgba(70, 230, 255, 0.55),
      0 0 26px 8px rgba(70, 230, 255, 0.35),
      0 0 60px 14px rgba(255, 79, 216, 0.22),
      0 24px 50px rgba(0, 0, 30, 0.55);
  }

  .table-felt::before {
    inset: 14px;
  }

  .game-texas .community-cards {
    top: 31%;
    gap: 4px;
  }

  .game-texas .community-card {
    width: 44px;
    height: 64px;
  }

  .game-texas .table-center {
    top: 66%;
    width: 118px;
    min-height: 108px;
  }

  .table-brand {
    top: 14%;
    font-size: 18px;
    letter-spacing: 5px;
  }

  .table-center {
    width: 130px;
    min-height: 138px;
    padding: 8px 8px 10px;
    border-radius: 20px;
  }

  .pot-icon {
    width: 34px;
    height: 34px;
    margin-bottom: 4px;
  }

  .pot-icon svg {
    width: 16px;
    height: 16px;
  }

  .pot-value {
    font-size: 23px;
  }

  .player-seat {
    width: 108px;
    min-height: 52px;
    padding: 6px;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 5px;
    border-radius: 14px;
  }

  .avatar {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .seat-name {
    font-size: 11px;
  }

  .seat-chips,
  .seat-state {
    font-size: 9px;
  }

  .seat-top {
    top: -3px;
  }

  .seat-top-left {
    top: 12%;
    left: 12%;
  }

  .seat-top-right {
    top: 12%;
    right: 12%;
  }

  .seat-left {
    top: 57%;
    left: 14%;
    transform: translate(-50%, -50%);
  }

  .seat-right {
    top: 57%;
    right: 14%;
    transform: translate(50%, -50%);
  }

  .seat-bottom-left {
    bottom: 2%;
    left: 17%;
  }

  .seat-bottom-right {
    right: 17%;
    bottom: 2%;
  }

  .hand-dock {
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    height: 184px;
    padding: 9px 10px;
    grid-template-columns: 92px minmax(150px, 1fr);
    grid-template-rows: 105px 55px;
    gap: 4px 8px;
    border-radius: 20px;
  }

  .game-niuniu .hand-dock {
    grid-template-columns: 92px minmax(150px, 1fr);
    grid-template-rows: 105px 55px;
  }

  .my-identity {
    grid-column: 1;
    grid-row: 1;
  }

  .my-name {
    max-width: 76px;
    font-size: 13px;
  }

  .my-chip-count {
    height: 24px;
    margin-top: 5px;
    padding: 0 8px 0 6px;
    font-size: 11px;
    white-space: nowrap;
  }

  .my-state {
    margin-top: 5px;
    font-size: 10px;
  }

  .refill-target {
    display: none;
  }

  .my-hand {
    min-width: 0;
    min-height: 104px;
    grid-column: 2;
    grid-row: 1;
    gap: 5px;
  }

  .niuniu-hand {
    min-width: 0;
    gap: 0;
  }

  .niuniu-hand .playing-card {
    width: 50px;
    height: 76px;
  }

  .niuniu-hand .playing-card + .playing-card {
    margin-left: -3px;
  }

  .playing-card {
    width: 56px;
    height: 82px;
    border-radius: 8px;
  }

  .card-corner {
    top: 5px;
    left: 5px;
    font-size: 14px;
    line-height: 13px;
  }

  .card-corner .corner-suit {
    font-size: 12px;
  }

  .card-suit-large {
    font-size: 30px;
  }

  .action-area {
    min-height: 50px;
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .action-button,
  .game-action {
    min-width: 0;
    min-height: 44px;
    padding: 0 6px;
    flex: 1 1 0;
    gap: 3px;
    font-size: 12px;
    white-space: nowrap;
  }

  .action-area.multi-choice .action-button {
    min-width: 0;
    padding: 0 5px;
  }

  .raise-wrap {
    min-width: 0;
    flex: 1 1 0;
  }

  .raise-wrap > .action-button {
    width: 100%;
  }

  .action-button svg,
  .game-action svg {
    width: 15px;
    height: 15px;
  }

  .action-cost {
    top: -7px;
    right: 1px;
    min-width: 20px;
    height: 19px;
    padding: 0 4px;
    border-width: 1px;
    font-size: 10px;
  }

  .action-note {
    position: absolute;
    right: 0;
    bottom: -3px;
    left: 0;
    transform: translateY(100%);
  }

  .raise-options {
    right: -10px;
    bottom: calc(100% + 7px);
  }

  .history-panel {
    position: fixed;
    top: 58px;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: min(88vw, 340px);
    background: rgba(8, 12, 60, 0.94);
    box-shadow: -18px 0 45px rgba(0, 0, 30, 0.6);
    transform: translateX(105%);
    transition: transform 200ms var(--ease);
  }

  .history-panel.open {
    transform: translateX(0);
  }

  .chat-form {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .toast {
    top: 66px;
  }

  .in-game .toast {
    top: auto;
    bottom: 198px;
  }

  .result-dialog {
    padding: 22px 16px 18px;
  }

  .result-title span {
    font-size: 28px;
    letter-spacing: 4px;
  }

  .result-headline {
    font-size: 24px;
  }

  .result-row {
    padding: 6px 10px;
    gap: 8px;
  }

  .result-actions .action-button {
    min-width: 0;
    flex: 1 1 0;
  }
}

@media (max-width: 430px) {
  .entry-content {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 26px 0 18px;
    gap: 16px;
  }

  .brand-lockup {
    min-height: 170px;
  }

  .brand-lockup h1 {
    font-size: 56px;
  }

  .card-fan {
    width: 240px;
    height: 175px;
  }

  .card-fan img {
    left: calc(50% - 47px);
    width: 94px;
    height: 132px;
  }

  .entry-panel {
    padding: 20px;
  }

  .game-choice {
    min-height: 60px;
    padding: 6px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 4px;
  }

  .game-choice-mark {
    width: 28px;
    height: 34px;
    font-size: 15px;
  }

  .game-choice strong {
    font-size: 11px;
  }

  .game-choice small {
    font-size: 9px;
  }

  .topbar {
    grid-template-columns: 34px minmax(0, 1fr) 160px;
  }

  .topbar-actions .icon-button {
    width: 30px;
    height: 30px;
  }

  .room-code-button {
    width: 116px;
    font-size: 11px;
  }

  .room-code-button strong {
    font-size: 13px;
    letter-spacing: 1px;
  }

  .table-rail,
  .table-felt {
    top: 32px;
    height: 43vh;
    min-height: 290px;
  }

  .table-center {
    transform: translate(-50%, -44%) scale(0.9);
  }

  .hand-dock {
    height: 180px;
    grid-template-columns: 80px minmax(150px, 1fr);
  }

  .game-niuniu .hand-dock {
    grid-template-columns: 80px minmax(150px, 1fr);
  }

  .playing-card {
    width: 52px;
    height: 76px;
  }

  .niuniu-hand .playing-card {
    width: 46px;
    height: 72px;
  }

  .niuniu-hand .playing-card + .playing-card {
    margin-left: -9px;
  }

  .action-button,
  .game-action {
    padding: 0 6px;
  }

  .action-button svg,
  .game-action svg {
    display: none;
  }

  .my-chip-count {
    padding: 0 6px;
  }

  .my-chip-count svg {
    display: none;
  }

  .result-cards {
    display: none;
  }

  .result-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-height: 700px) and (max-width: 800px) {
  .table-rail,
  .table-felt {
    top: 24px;
    height: 42vh;
    min-height: 265px;
  }

  .hand-dock {
    height: 164px;
    grid-template-rows: 91px 49px;
  }

  .my-hand {
    min-height: 88px;
  }

  .playing-card {
    width: 48px;
    height: 70px;
  }

  .niuniu-hand .playing-card {
    width: 44px;
    height: 66px;
  }

  .niuniu-hand .playing-card + .playing-card {
    margin-left: -7px;
  }

  .action-button,
  .game-action {
    min-height: 38px;
  }
}

@media (max-width: 430px) and (max-height: 620px) {
  .entry-content {
    min-height: 100%;
    padding: 10px 0;
    gap: 8px;
  }

  .brand-lockup {
    min-height: 0;
    padding-top: 4px;
  }

  .card-fan {
    display: none;
  }

  .brand-lockup h1 {
    margin-top: 4px;
    font-size: 40px;
  }

  .brand-subtitle {
    margin-top: 4px;
    font-size: 13px;
  }

  .entry-panel {
    padding: 14px 16px 12px;
  }

  .game-picker-wrap,
  .stake-fields,
  .room-code-field {
    margin-bottom: 10px;
  }

  .field-label {
    margin-bottom: 5px;
    font-size: 12px;
  }

  .game-choice {
    min-height: 48px;
    padding: 5px 7px;
  }

  .game-choice-mark {
    width: 28px;
    height: 32px;
    font-size: 14px;
  }

  .entry-panel input,
  .entry-panel select {
    height: 40px;
    font-size: 15px;
  }

  .mode-switch {
    height: 38px;
    margin: 10px 0;
  }

  .stake-hint {
    font-size: 11px;
    line-height: 1.35;
  }

  .entry-submit,
  .primary-button {
    min-height: 44px;
    font-size: 15px;
  }

  .legal-note {
    margin-top: 8px;
  }
}

/* ========================================================================== 
   牌桌视觉重构 · 对齐「界面设计」中的黑金属 / 青绿绒面 / 霓虹灯带
   ========================================================================== */

.game-screen {
  background:
    radial-gradient(ellipse 55% 38% at 50% 28%, rgba(20, 205, 204, 0.12), transparent 70%),
    radial-gradient(ellipse 55% 45% at 12% 75%, rgba(79, 44, 181, 0.18), transparent 72%),
    linear-gradient(155deg, #050914 0%, #0b1020 45%, #070a14 100%);
}

.game-screen::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(115deg, transparent 0 13%, rgba(58, 79, 122, 0.08) 13.2% 13.6%, transparent 13.8% 70%, rgba(255, 182, 45, 0.06) 70.2% 70.5%, transparent 70.7%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 12px);
  content: "";
  pointer-events: none;
}

.topbar {
  height: 68px;
  border-bottom: 1px solid rgba(67, 221, 255, 0.28);
  background:
    linear-gradient(90deg, rgba(8, 13, 24, 0.98), rgba(15, 21, 40, 0.96) 48%, rgba(8, 12, 23, 0.98)),
    #090d19;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.58), 0 1px 0 rgba(255, 193, 69, 0.18) inset;
  backdrop-filter: blur(18px);
}

.topbar::after {
  position: absolute;
  right: 22%;
  bottom: -2px;
  left: 22%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #23dfff, #7b55ff, #ffc742, transparent);
  box-shadow: 0 0 12px rgba(42, 220, 255, 0.7);
  content: "";
}

.topbar-brand {
  font-family: Georgia, "Songti SC", "STSong", serif;
  color: #ffe8a0;
  letter-spacing: 1px;
}

.topbar-brand-mark {
  border-color: #e4c36e;
  border-radius: 9px;
  background: linear-gradient(145deg, #176f77, #073b51 58%, #11182e);
  box-shadow: 0 0 0 2px rgba(50, 223, 255, 0.22), 0 0 18px rgba(46, 221, 255, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.game-niuniu .topbar-brand-mark,
.game-texas .topbar-brand-mark {
  background: linear-gradient(145deg, #176f77, #073b51 58%, #11182e);
}

.room-code-button,
.top-pill {
  height: 38px;
  border: 1px solid rgba(115, 218, 255, 0.62);
  background: linear-gradient(180deg, rgba(25, 58, 94, 0.97), rgba(11, 22, 45, 0.98));
  box-shadow: 0 0 16px rgba(45, 196, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.23);
}

.top-pill.pill-violet {
  border-color: rgba(255, 197, 81, 0.68);
  background: linear-gradient(180deg, #3d3c55, #171d31);
  color: #ffe39a;
}

.top-pill.pill-gold {
  border-color: #ffdc73;
  background: linear-gradient(180deg, #ffdd62, #d98716);
  color: #392100;
}

.icon-button {
  border-color: rgba(147, 172, 221, 0.4);
  background: linear-gradient(160deg, #293047, #101522 70%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.game-layout {
  position: relative;
  z-index: 1;
  display: block;
  height: calc(100vh - 68px);
  height: calc(100dvh - 68px);
}

.table-stage {
  height: 100%;
  min-height: 600px;
}

.table-rail,
.table-felt {
  top: 54px;
  height: min(calc(100% - 210px), 650px);
  min-height: 410px;
}

.table-rail {
  display: block;
  z-index: 0;
  width: min(calc(100% - 42px), 1370px);
  transform: translateX(-50%) translateY(-14px);
  border: 2px solid rgba(104, 137, 191, 0.32);
  background:
    radial-gradient(ellipse at 50% 8%, rgba(126, 161, 207, 0.2), transparent 42%),
    repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 13px),
    linear-gradient(180deg, #222b3c, #080d17 55%, #141c2a);
  box-shadow:
    inset 0 0 0 12px #0b101b,
    inset 0 0 0 14px rgba(128, 163, 208, 0.2),
    0 24px 45px rgba(0, 0, 0, 0.72),
    0 0 30px rgba(45, 215, 255, 0.12);
}

.table-felt,
.game-niuniu .table-felt,
.game-texas .table-felt {
  --felt-1: #159e9a;
  --felt-2: #087873;
  --felt-3: #034c4d;
  --rim: #111a27;
  --rim-2: #202c42;
  width: min(calc(100% - 94px), 1280px);
  border: 18px solid var(--rim);
  background:
    repeating-radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 7px),
    radial-gradient(ellipse 60% 62% at 50% 43%, rgba(41, 230, 215, 0.24), transparent 72%),
    linear-gradient(180deg, var(--felt-1), var(--felt-2) 53%, var(--felt-3));
  box-shadow:
    inset 0 0 0 2px rgba(146, 255, 237, 0.2),
    inset 0 0 55px rgba(0, 27, 31, 0.7),
    0 0 0 5px #26324a,
    0 0 0 8px #22def6,
    0 0 18px 8px rgba(34, 222, 246, 0.48),
    0 0 0 11px rgba(133, 73, 255, 0.75),
    0 0 26px 13px rgba(146, 73, 255, 0.32),
    0 30px 50px rgba(0, 0, 0, 0.64);
}

.table-felt::before {
  inset: 20px;
  border: 2px dashed rgba(135, 255, 236, 0.16);
}

.table-felt::after {
  width: 66%;
  height: 64%;
  background: radial-gradient(ellipse, rgba(120, 255, 234, 0.075), transparent 72%);
}

.table-plaque {
  position: absolute;
  top: -52px;
  left: 50%;
  z-index: 15;
  display: grid;
  width: 286px;
  height: 76px;
  transform: translateX(-50%);
  place-items: center;
  clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%);
  background:
    linear-gradient(90deg, transparent, rgba(47, 224, 255, 0.26), transparent),
    linear-gradient(180deg, #263653, #091321 48%, #182238);
  color: #ffe8a1;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 5px;
  text-shadow: 0 2px 0 #6d4205, 0 0 12px rgba(255, 220, 110, 0.68);
  box-shadow: 0 0 0 3px #2addff, 0 0 22px rgba(42, 221, 255, 0.7), 0 0 40px rgba(119, 73, 255, 0.45);
}

.table-plaque::before,
.table-plaque::after {
  position: absolute;
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  background: #ffdf70;
  box-shadow: 0 0 9px #ffbf2e;
  content: "";
}

.table-plaque::before { left: 20px; }
.table-plaque::after { right: 20px; }

.table-chip-stack {
  position: absolute;
  top: -29px;
  right: 8%;
  z-index: 13;
  display: flex;
  height: 70px;
  align-items: flex-end;
  gap: 3px;
  transform: rotate(-5deg);
}

.table-chip-stack i,
.table-chip-stack b {
  display: block;
  width: 47px;
  height: 47px;
  margin-left: -22px;
  border: 5px dashed rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background: radial-gradient(circle, #263249 0 34%, #e9eefb 35% 42%, #263249 43% 62%, #101726 63%);
  box-shadow: 0 5px 0 #080c14, 0 9px 13px rgba(0, 0, 0, 0.48);
}

.table-chip-stack b {
  background: radial-gradient(circle, #ffd473 0 34%, #fff0ba 35% 42%, #dc8522 43% 62%, #7e3b0c 63%);
}

.table-brand {
  top: 17%;
  color: rgba(180, 255, 245, 0.1);
  font-family: Georgia, serif;
  letter-spacing: 11px;
}

.community-cards {
  top: 39%;
  gap: 9px;
}

.community-card {
  width: 72px;
  height: 101px;
  border-radius: 7px;
  box-shadow: 0 8px 13px rgba(0, 0, 0, 0.48), 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.game-texas .table-center,
.table-center {
  top: 66%;
  width: 202px;
  min-height: 80px;
  padding: 8px 12px;
  border: 1px solid rgba(101, 224, 235, 0.34);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(7, 32, 44, 0.72), rgba(4, 18, 30, 0.76));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.pot-icon {
  position: absolute;
  top: -16px;
  left: -13px;
  width: 32px;
  height: 32px;
  margin: 0;
  border-width: 1px;
}

.pot-icon svg { width: 15px; height: 15px; }
.pot-label { color: #a8d9dd; }
.pot-value { min-height: 27px; font-size: 25px; line-height: 27px; }
.round-status { min-height: 17px; margin-top: 1px; font-size: 11px; }
.turn-timer { margin-top: 2px; }
.stake-value { margin-top: 3px; }

.player-seat {
  width: 170px;
  min-height: 78px;
  padding: 9px 12px;
  grid-template-columns: 54px minmax(0, 1fr);
  border: 1px solid rgba(83, 224, 244, 0.52);
  border-radius: 9px;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  background:
    linear-gradient(90deg, rgba(52, 220, 239, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(15, 29, 48, 0.98), rgba(7, 17, 31, 0.97));
  box-shadow: 0 0 0 1px rgba(111, 71, 255, 0.38), 0 0 18px rgba(36, 213, 245, 0.22), 0 10px 18px rgba(0, 0, 0, 0.42);
}

.player-seat.current {
  border-color: #ffce57;
}

.avatar {
  width: 52px;
  height: 52px;
  border-color: #ffde78;
  box-shadow: 0 0 0 2px rgba(48, 229, 255, 0.7), 0 0 14px rgba(48, 229, 255, 0.48), 0 6px 12px rgba(0, 0, 0, 0.45);
}

.seat-name { color: #ffe7a1; font-family: Georgia, "Songti SC", serif; font-size: 15px; }
.seat-chips { color: #ffd566; font-size: 13px; }
.seat-state { color: #99c7d2; }

.hand-dock {
  right: 24px;
  bottom: 16px;
  left: 24px;
  height: 132px;
  padding: 12px 22px;
  grid-template-columns: minmax(190px, 0.72fr) 280px minmax(360px, 1.5fr);
  gap: 18px;
  border: 1px solid rgba(72, 224, 242, 0.6);
  border-radius: 18px;
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
  background:
    linear-gradient(90deg, rgba(22, 223, 237, 0.08), transparent 30%, transparent 70%, rgba(142, 81, 255, 0.09)),
    linear-gradient(180deg, rgba(17, 29, 48, 0.97), rgba(6, 13, 26, 0.98));
  box-shadow: 0 0 0 2px rgba(104, 70, 239, 0.36), 0 0 24px rgba(35, 222, 245, 0.25), 0 16px 30px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.game-niuniu .hand-dock {
  grid-template-columns: minmax(190px, 0.62fr) 340px minmax(360px, 1.35fr);
}

.my-identity {
  display: grid;
  min-width: 0;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-items: center;
  column-gap: 10px;
}

.my-avatar {
  width: 56px;
  height: 56px;
  grid-row: 1 / 4;
  border: 2px solid #ffdb73;
  border-radius: 50%;
  background: var(--avatar-image) center 18% / cover no-repeat, #1a2438;
  box-shadow: 0 0 0 2px #21dff5, 0 0 16px rgba(33, 223, 245, 0.48), 0 6px 13px rgba(0, 0, 0, 0.5);
}

.my-name-row,
.my-chip-count,
.my-state,
.my-score-change { grid-column: 2; }
.my-name { color: #ffe7a0; font-family: Georgia, "Songti SC", serif; }
.my-chip-count { margin-top: 3px; border-width: 1px; box-shadow: none; }
.my-state { margin-top: 5px; color: #a0cbd3; }

.my-hand { min-height: 105px; }
.my-hand .playing-card { width: 68px; height: 96px; }
.niuniu-hand .playing-card { width: 57px; height: 84px; }

.action-area {
  min-height: 70px;
  flex-wrap: nowrap;
  gap: 12px;
}

.action-button,
.game-action {
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  font-size: 16px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.46), 0 0 18px rgba(42, 181, 255, 0.22), inset 0 2px 0 rgba(255, 255, 255, 0.48);
}

.history-panel {
  position: fixed;
  top: 68px;
  right: 0;
  bottom: 0;
  z-index: 45;
  width: min(360px, 92vw);
  border-left: 1px solid rgba(60, 222, 244, 0.48);
  background: rgba(7, 14, 27, 0.97);
  box-shadow: -18px 0 42px rgba(0, 0, 0, 0.65), -2px 0 16px rgba(45, 220, 255, 0.18);
  transform: translateX(105%);
  transition: transform 210ms var(--ease);
}

.history-panel.open { transform: translateX(0); }
#historyButton { display: inline-grid; }
#closeHistoryButton { display: inline-grid; }

@media (max-width: 800px) {
  .topbar {
    height: 60px;
    padding: 0 8px;
    grid-template-columns: 34px minmax(0, 1fr) 164px;
  }

  .topbar-actions { height: 60px; }
  .topbar-pills { justify-self: start; gap: 4px; }
  .room-code-button { width: 104px; padding: 0 8px; }
  .top-pill.pill-violet {
    display: inline-flex;
    height: 34px;
    padding: 0 8px;
    font-size: 10px;
    white-space: nowrap;
  }
  .top-pill.pill-gold { display: none; }
  .game-layout { height: calc(100vh - 60px); height: calc(100dvh - 60px); }
  .table-stage { min-height: 508px; }

  .table-rail,
  .table-felt {
    top: 68px;
    height: min(45vh, 390px);
    min-height: 300px;
  }

  .table-rail {
    width: calc(100% - 10px);
    transform: translateX(-50%) translateY(-8px);
    box-shadow: inset 0 0 0 7px #0b101b, inset 0 0 0 9px rgba(128, 163, 208, 0.18), 0 16px 28px rgba(0, 0, 0, 0.65);
  }

  .table-felt,
  .game-niuniu .table-felt,
  .game-texas .table-felt {
    width: calc(100% - 30px);
    border-width: 11px;
    box-shadow:
      inset 0 0 0 2px rgba(146, 255, 237, 0.18),
      inset 0 0 38px rgba(0, 27, 31, 0.7),
      0 0 0 4px #26324a,
      0 0 0 6px #22def6,
      0 0 14px 7px rgba(34, 222, 246, 0.42),
      0 0 0 8px rgba(133, 73, 255, 0.72),
      0 0 20px 10px rgba(146, 73, 255, 0.28),
      0 18px 30px rgba(0, 0, 0, 0.58);
  }

  .table-felt::before { inset: 12px; border-width: 1px; }

  .table-plaque {
    top: -39px;
    width: 190px;
    height: 55px;
    font-size: 25px;
    letter-spacing: 3px;
  }

  .table-plaque::before { left: 14px; }
  .table-plaque::after { right: 14px; }

  .table-chip-stack { top: -24px; right: 9%; transform: scale(0.72) rotate(-5deg); transform-origin: right top; }
  .table-brand { top: 18%; font-size: 16px; letter-spacing: 6px; }

  .game-texas .community-cards { top: 34%; gap: 5px; }
  .game-texas .community-card { width: 47px; height: 67px; }

  .game-texas .table-center,
  .table-center {
    top: 68%;
    width: 142px;
    min-height: 76px;
    padding: 7px;
    transform: translate(-50%, -50%);
    border-radius: 13px;
  }

  .pot-value { font-size: 21px; }
  .round-status { max-width: 126px; font-size: 10px; }
  .stake-value { font-size: 9px; }

  .player-seat {
    width: 112px;
    min-height: 58px;
    padding: 6px;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 6px;
  }

  .avatar { width: 38px; height: 38px; }
  .seat-name { font-size: 11px; }
  .seat-chips, .seat-state { font-size: 9px; }

  .players-layer[data-count="1"] .player-seat {
    top: calc(100% + 24px);
    left: 50%;
    right: auto;
    bottom: auto;
    width: calc(100% - 26px);
    min-height: 82px;
    padding: 10px 16px;
    transform: translateX(-50%);
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .players-layer[data-count="1"] .avatar { width: 56px; height: 56px; }
  .players-layer[data-count="1"] .seat-name { font-size: 15px; }
  .players-layer[data-count="1"] .seat-chips { font-size: 13px; }
  .players-layer[data-count="1"] .seat-card-stack { right: 20px; bottom: 12px; }
  .players-layer[data-count="1"] .seat-revealed-hand { right: 18px; bottom: 8px; left: auto; transform: none; }

  .hand-dock {
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    height: 176px;
    padding: 10px 12px;
    grid-template-columns: 112px minmax(150px, 1fr);
    grid-template-rows: 105px 51px;
    gap: 4px 8px;
    border-radius: 15px;
  }

  .game-niuniu .hand-dock {
    grid-template-columns: 112px minmax(150px, 1fr);
    grid-template-rows: 105px 51px;
  }

  .my-identity {
    grid-template-columns: 42px minmax(0, 1fr);
    column-gap: 7px;
  }

  .my-avatar { width: 40px; height: 40px; }
  .my-name { max-width: 66px; font-size: 12px; }
  .my-chip-count { height: 22px; padding: 0 6px; font-size: 10px; }
  .my-state { margin-top: 3px; font-size: 9px; }

  .my-hand .playing-card { width: 54px; height: 78px; }
  .niuniu-hand .playing-card { width: 45px; height: 68px; }
  .niuniu-hand .playing-card + .playing-card { margin-left: -8px; }

  .action-area { min-height: 48px; gap: 6px; }
  .action-button, .game-action { min-height: 43px; padding: 0 6px; font-size: 12px; }
  .history-panel { top: 60px; }
}

@media (max-width: 430px) {
  .room-code-button { width: 100px; font-size: 10px; }
  .room-code-button strong { font-size: 11px; }
  .topbar { grid-template-columns: 32px minmax(0, 1fr) 154px; }
  .topbar-actions .icon-button { width: 29px; height: 29px; }

  .table-rail,
  .table-felt {
    top: 62px;
    height: 43vh;
    min-height: 286px;
  }

  .players-layer[data-count="1"] .player-seat {
    top: calc(100% + 19px);
    min-height: 76px;
  }

  .hand-dock {
    height: 174px;
    grid-template-columns: 105px minmax(145px, 1fr);
  }
}

@media (max-width: 430px) and (max-height: 620px) {
  .table-rail,
  .table-felt {
    top: 35px;
    height: 230px;
    min-height: 230px;
  }

  .table-plaque { top: -29px; width: 160px; height: 43px; font-size: 20px; }
  .table-chip-stack { display: none; }
  .table-brand { display: none; }
  .game-texas .community-cards { top: 32%; }
  .game-texas .community-card { width: 40px; height: 57px; }
  .game-texas .table-center, .table-center { top: 69%; min-height: 65px; transform: translate(-50%, -50%) scale(0.86); }

  .players-layer[data-count="1"] .player-seat {
    top: calc(100% + 7px);
    min-height: 62px;
    padding: 6px 12px;
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .players-layer[data-count="1"] .avatar { width: 40px; height: 40px; }
  .players-layer[data-count="1"] .seat-name { font-size: 12px; }
  .players-layer[data-count="1"] .seat-chips { font-size: 10px; }

  .hand-dock {
    height: 158px;
    grid-template-rows: 87px 47px;
  }

  .my-hand { min-height: 82px; }
  .my-hand .playing-card { width: 46px; height: 66px; }
  .niuniu-hand .playing-card { width: 41px; height: 61px; }
  .niuniu-hand .playing-card + .playing-card { margin-left: -10px; }
  .action-button, .game-action { min-height: 38px; font-size: 11px; }
}

.game-picker {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  row-gap: 8px;
}

.game-sangong .my-hand .playing-card,
.game-magu .my-hand .playing-card {
  border-color: #ffe0a0;
}

@media (max-width: 800px) {
  .game-choice[data-game-type="magu"] {
    grid-column: 2;
  }

  .game-sangong .niuniu-hand .playing-card {
    width: 54px;
    height: 78px;
    margin-left: 0;
  }
}

@media (max-width: 430px) and (max-height: 620px) {
  .game-sangong .niuniu-hand .playing-card {
    width: 46px;
    height: 66px;
  }
}

@media (max-width: 430px) {
  .access-content {
    min-height: 100%;
    padding: 20px 0;
  }

  .access-mark {
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
    border-radius: 18px;
  }

  .access-content h1 {
    font-size: 34px;
  }

  .access-subtitle {
    margin: 8px 0 16px;
  }

  .access-panel {
    padding: 18px;
  }

  .access-contact {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 13px;
  }

  .access-contact-qr {
    width: 96px;
  }
}

@media (max-width: 430px) and (max-height: 620px) {
  .access-content {
    justify-content: flex-start;
    padding: 12px 0;
  }

  .access-mark {
    width: 46px;
    height: 46px;
    margin-bottom: 7px;
    border-radius: 14px;
  }

  .access-mark svg {
    width: 23px;
    height: 23px;
  }

  .access-content h1 {
    margin-top: 3px;
    font-size: 29px;
  }

  .access-subtitle {
    margin: 5px 0 10px;
    font-size: 12px;
  }

  .access-panel {
    padding: 14px 16px;
  }

  .access-panel input {
    height: 46px;
    margin-bottom: 10px;
  }

  .access-panel .primary-button {
    min-height: 42px;
  }

  .access-contact {
    margin-top: 12px;
    padding-top: 12px;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 11px;
  }

  .access-contact-qr {
    width: 86px;
  }

  .access-contact-title {
    font-size: 13px;
  }

  .access-contact-copy {
    font-size: 11px;
  }
}

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