:root {
  --gold: #ffd54f;
  --gold-deep: #f59e0b;
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --panel-bg: rgba(15, 29, 58, 0.84);
  --panel-border: rgba(255, 213, 79, 0.32);
  --text-main: #f8fafc;
  --text-sub: #cbd5e1;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: #0b1b33;
  color: var(--text-main);
}

.hidden {
  display: none !important;
}

.view {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
}

.view.active {
  display: flex;
}

/* ==================== BUTTONS ==================== */
.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 17px; }

.btn-yellow {
  background: linear-gradient(180deg, #ffe066 0%, #f59e0b 55%, #d97706 100%);
  color: #451a03;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-blue {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 60%, #1d4ed8 100%);
}
.btn-green {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 60%, #15803d 100%);
}
.btn-red {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 60%, #b91c1c 100%);
}
.btn-purple {
  background: linear-gradient(180deg, #c084fc 0%, #9333ea 60%, #7e22ce 100%);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 29, 58, 0.78);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s, background 0.12s;
}
.circle-btn.sm { width: 34px; height: 34px; font-size: 15px; }
.circle-btn.muted { opacity: 0.5; filter: grayscale(1); }
.circle-btn:hover { background: rgba(37, 99, 235, 0.6); transform: scale(1.06); }

/* Master Volume Pill */
.volume-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(15, 29, 58, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text-sub);
}
.volume-pill.sm {
  padding: 4px 10px;
}
.volume-pill .vol-label {
  white-space: nowrap;
  font-weight: 600;
}
.volume-pill .vol-val {
  min-width: 32px;
  text-align: right;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.volume-range {
  width: 78px;
  accent-color: var(--gold);
  cursor: pointer;
}
.volume-pill.sm .volume-range {
  width: 68px;
}

/* ==================== LOBBY VIEW ==================== */
.lobby-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 15%, rgba(56, 189, 248, 0.25), transparent 60%),
    linear-gradient(160deg, #0d2144 0%, #0a3652 50%, #0b243f 100%);
  z-index: 0;
}

.lobby-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(180deg, rgba(8, 17, 36, 0.85), rgba(8, 17, 36, 0.25));
  border-bottom: 1px solid rgba(255, 213, 79, 0.18);
}

.lobby-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lobby-logo {
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.lobby-subtitle {
  font-size: 13px;
  color: var(--gold);
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(255, 213, 79, 0.35);
  padding: 4px 12px;
  border-radius: 999px;
}

.lobby-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 29, 58, 0.86);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 5px 16px 5px 6px;
}

.pill-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: contain;
  background: radial-gradient(circle, #3b82f6, #1e3a8a);
  border: 2px solid var(--gold);
}

.pill-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 15px;
}

.icon-mini-btn {
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: var(--gold);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 12px;
}

.pill-beans-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--gold);
  font-weight: 700;
}

.bean-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.btn-free-beans {
  margin-left: 6px;
  border: none;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  background: #22c55e;
  color: #fff;
  cursor: pointer;
  animation: pulse 1.4s infinite;
}

.lobby-main {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 22px;
  padding: 20px 28px 26px;
  min-height: 0;
}

.lobby-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  min-height: 0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--gold);
}

.hint-tag {
  font-size: 12px;
  color: var(--text-sub);
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 9px;
  border-radius: 999px;
}

.nickname-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.nickname-bar label {
  font-size: 13px;
  color: var(--text-sub);
  white-space: nowrap;
}

.nickname-bar input,
.room-quick-bar input,
.form-row input[type="text"] {
  background: rgba(8, 17, 36, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 8px 12px;
  color: #fff;
  font-size: 14px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.nickname-bar input { flex: 1; min-width: 0; }
.nickname-bar input:focus,
.room-quick-bar input:focus,
.form-row input[type="text"]:focus {
  border-color: var(--gold);
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.char-item {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.16s ease;
}

.char-item:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.char-item.active {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.3);
}

.char-item img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  margin-bottom: 6px;
}

.char-name { font-weight: 700; font-size: 14px; }
.char-tag { font-size: 11px; color: var(--text-sub); margin-top: 2px; }

.room-quick-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.room-quick-bar input { width: 135px; }

.room-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.empty-rooms {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  text-align: center;
}
.empty-rooms p { margin: 4px 0; font-size: 16px; }
.empty-rooms .sub { font-size: 13px; opacity: 0.75; }

.room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 12px 16px;
  gap: 14px;
}

.room-row-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-id-pill {
  font-size: 12px;
  background: rgba(255, 213, 79, 0.2);
  color: var(--gold);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: monospace;
}

.room-row-meta {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.room-row-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-status-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}
.room-status-badge.waiting { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.room-status-badge.playing { background: rgba(245, 158, 11, 0.2); color: #fde68a; }

/* ==================== GAME TABLE VIEW ==================== */
.table-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 42%, #1b5e7a 0%, #0d3b54 55%, #071f33 100%);
  z-index: 0;
}

.table-felt {
  position: absolute;
  inset: 58px 24px 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.table-felt-img {
  width: min(82vw, 1080px);
  height: min(62vh, 540px);
  object-fit: fill;
  opacity: 0.44;
  border-radius: 50%;
  filter: drop-shadow(0 20px 45px rgba(0, 0, 0, 0.55));
}

.table-center-logo {
  position: absolute;
  width: 190px;
  opacity: 0.22;
  pointer-events: none;
}

/* Top HUD */
.game-topbar {
  position: relative;
  z-index: 10;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 18px;
  background: linear-gradient(180deg, rgba(6, 18, 36, 0.88), rgba(6, 18, 36, 0.2));
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-hud {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 29, 58, 0.78);
  color: #fff;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-hud:hover { background: rgba(37, 99, 235, 0.65); }

.room-badge {
  background: rgba(15, 29, 58, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
}
.room-badge strong { color: var(--gold); font-family: monospace; font-size: 14px; }
.copy-hint { font-size: 11px; color: #93c5fd; margin-left: 5px; }

.round-badge {
  font-size: 12px;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.1);
  padding: 5px 11px;
  border-radius: 999px;
}

/* Bottom 3 cards HUD */
.bottom-cards-bar {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(7, 20, 42, 0.9);
  border: 1px solid rgba(255, 213, 79, 0.38);
  border-top: none;
  border-radius: 0 0 18px 18px;
  padding: 8px 16px 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.48);
}

.bottom-cards-slots {
  display: flex;
  gap: 8px;
  min-height: 98px;
  align-items: center;
}

.score-mult-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-top: 3px;
  color: var(--text-sub);
}

.score-mult-row strong { color: var(--gold); }
.mult-num { font-size: 14px; color: #fde047 !important; }
.cap-tag {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Opponent Seats (positioned closer to table center & vertical midpoint) */
.opponent-seat {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  z-index: 6;
  width: 224px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seat-left { left: clamp(24px, 7vw, 130px); align-items: flex-start; }
.seat-right { right: clamp(24px, 7vw, 130px); align-items: flex-end; }

.opp-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 24, 48, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 8px 12px;
  min-width: 196px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.opp-card.active-turn {
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(255, 213, 79, 0.55);
}

.opp-card.empty-seat {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.35);
  gap: 8px;
}

.avatar-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.avatar-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: contain;
  background: radial-gradient(circle, #38bdf8 0%, #1e3a8a 100%);
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.landlord-hat {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.landlord-hat.hat-animate {
  animation: hatDrop 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.role-pill {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
}
.role-pill.landlord { background: linear-gradient(90deg, #f59e0b, #ef4444); color: #fff; }
.role-pill.farmer { background: linear-gradient(90deg, #22c55e, #0ea5e9); color: #fff; }

.bot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  background: #1d4ed8;
  border-radius: 50%;
  border: 1.5px solid #93c5fd;
  padding: 2px;
  object-fit: contain;
}

.opp-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.opp-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 112px;
}

.opp-beans {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
}

.opp-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.mini-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.mini-tag.double { background: #f59e0b; color: #451a03; }
.mini-tag.super { background: #a855f7; color: #fff; }
.mini-tag.mingpai { background: #0ea5e9; color: #fff; }
.mini-tag.ready { background: #22c55e; color: #fff; }
.mini-tag.offline { background: #64748b; color: #fff; }

.opp-card-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 4px 10px;
  font-weight: 800;
  font-size: 15px;
}

.opp-card-counter.alarm {
  border-color: #ef4444;
  background: rgba(220, 38, 38, 0.65);
  color: #fef08a;
  animation: alarmPulse 0.7s infinite;
}

.opp-played-wrap {
  position: absolute;
  top: 24px;
  width: max-content;
  max-width: 42vw;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.seat-left .opp-played-wrap { left: 214px; align-items: flex-start; }
.seat-right .opp-played-wrap { right: 214px; align-items: flex-end; }

.opp-mingpai-hand {
  display: flex;
  flex-wrap: wrap;
  max-width: 245px;
  padding-left: 16px;
}
.opp-mingpai-hand .poker-card { margin-left: -16px; margin-bottom: 2px; }

.chat-bubble {
  position: absolute;
  top: -42px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  z-index: 20;
  animation: popIn 0.2s ease;
}

/* Turn Clock (Official Alarm Clock Sprite) */
.turn-clock {
  position: relative;
  width: 58px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.turn-clock .clock-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 52px;
  object-fit: contain;
  pointer-events: none;
}

.turn-clock .clock-top {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 10px;
  object-fit: contain;
  pointer-events: none;
}

.turn-clock .clock-bell {
  position: absolute;
  top: 5px;
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
}

.turn-clock .clock-bell-left { left: 2px; }
.turn-clock .clock-bell-right { right: 2px; transform: scaleX(-1); }

.turn-clock .clock-num {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  font-size: 20px;
  font-weight: 900;
  color: #7c2d12;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.turn-clock.urgent {
  animation: clockRing 0.4s infinite;
}

.turn-clock.urgent .clock-num {
  color: #dc2626;
}

/* Cannot-Beat Toast Banner */
.cannot-beat-toast {
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid rgba(255, 213, 79, 0.65);
  color: #fef08a;
  font-size: 16px;
  font-weight: 800;
  padding: 7px 24px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  letter-spacing: 1px;
  animation: popIn 0.2s ease;
}

/* Played Cards & Action Banner */
.played-area {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 98px;
  padding-left: 30px;
}
.played-area .poker-card {
  margin-left: -30px;
  animation: cardDrop 0.16s ease-out;
}
.opp-played-cards {
  flex-wrap: nowrap;
  padding-left: 38px;
}
.opp-played-cards .poker-card {
  margin-left: -38px;
}
.seat-left .opp-played-cards { justify-content: flex-start; }
.seat-right .opp-played-cards { justify-content: flex-end; }

.action-banner {
  font-size: 24px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.75);
  background: rgba(0, 0, 0, 0.42);
  padding: 4px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 213, 79, 0.4);
  white-space: nowrap;
}

/* Waiting Overlay */
.waiting-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.waiting-box {
  pointer-events: auto;
  background: rgba(9, 22, 45, 0.88);
  border: 1.5px solid var(--panel-border);
  border-radius: 22px;
  padding: 22px 32px;
  text-align: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  max-width: 480px;
}

.waiting-box h3 { margin: 0 0 10px; font-size: 20px; color: var(--gold); }
.waiting-rules {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}
.rule-chip {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: 999px;
}
.waiting-btns { display: flex; justify-content: center; gap: 12px; }
.waiting-tip { margin: 12px 0 0; font-size: 12px; color: var(--text-sub); }

/* Center Stage (Self Played + Action Buttons) */
.center-stage {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(192px + clamp(22px, 4.5vh, 54px));
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.action-buttons-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 46px;
  pointer-events: auto;
}

/* Self Dock */
.self-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(22px, 4.5vh, 54px);
  height: 182px;
  z-index: 9;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 clamp(22px, 5vw, 90px) 12px;
  background: transparent;
}

.self-info-panel {
  width: 210px;
  flex-shrink: 0;
}

.hand-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
  height: 162px;
  padding: 0 12px;
}

/* Plane Ready-to-Launch Preview centered above action buttons & clock */
.plane-ready-dock {
  position: absolute;
  bottom: 300px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 16;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: planeReadyEnter 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.plane-ready-rig {
  position: relative;
  width: 170px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: planeIdleRumble 0.14s ease-in-out infinite alternate;
}

.plane-ready-body {
  position: relative;
  z-index: 2;
  width: 136px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55));
}

.plane-ready-flame {
  position: absolute;
  left: -10px;
  bottom: 22px;
  z-index: 1;
  width: 58px;
  height: auto;
  object-fit: contain;
  transform: rotate(-12deg);
  mix-blend-mode: screen;
  animation: planeFlameFlicker 0.12s ease-in-out infinite alternate;
}

.plane-ready-prop {
  position: absolute;
  right: 12px;
  top: 14px;
  z-index: 3;
  width: 54px;
  height: 54px;
  object-fit: contain;
  opacity: 0.85;
  animation: propSpin 0.18s linear infinite;
}

.plane-ready-tag {
  font-size: 12px;
  font-weight: 800;
  color: #e0f2fe;
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.9), rgba(37, 99, 235, 0.9));
  border: 1px solid #7dd3fc;
  padding: 2px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.45);
}

@keyframes planeReadyEnter {
  from { opacity: 0; transform: translate(-50%, 20px) scale(0.75); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes planeIdleRumble {
  from { transform: translate(-1.5px, -1px) rotate(-1.2deg); }
  to { transform: translate(1.5px, 1.5px) rotate(1.2deg); }
}

@keyframes planeFlameFlicker {
  from { transform: rotate(-12deg) scale(0.86); opacity: 0.75; }
  to { transform: rotate(-12deg) scale(1.16); opacity: 1; }
}

@keyframes propSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.my-hand-cards {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-left: 44px;
  max-width: 100%;
  touch-action: none;
}

.my-hand-cards .poker-card {
  margin-left: -44px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.my-hand-cards .poker-card:hover {
  transform: translateY(-8px);
}

.my-hand-cards .poker-card.selected {
  transform: translateY(-24px);
  box-shadow: 0 10px 22px rgba(255, 213, 79, 0.55), 0 0 0 2px var(--gold);
}

/* Removed trustee overlay */

.self-side-tools {
  position: relative;
  width: 210px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.bottom-mult-pill {
  background: rgba(10, 24, 48, 0.88);
  border: 1.5px solid var(--panel-border);
  border-radius: 14px;
  padding: 6px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.42);
}

.bottom-mult-pill .mult-line {
  font-size: 13px;
  color: var(--text-sub);
  white-space: nowrap;
}

.bottom-mult-pill .mult-num {
  font-size: 17px;
  color: #fde047 !important;
  font-weight: 900;
}

.bottom-mult-pill .cap-line {
  font-size: 11px;
  color: #93c5fd;
  white-space: nowrap;
}

.card-played-gray {
  filter: grayscale(1) brightness(0.55);
  opacity: 0.62;
  transition: filter 0.25s ease, opacity 0.25s ease;
}

.quick-chat-popup {
  position: absolute;
  bottom: 52px;
  right: 0;
  width: 256px;
  background: rgba(11, 25, 52, 0.96);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  z-index: 30;
}

.chat-popup-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.quick-chat-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}

.chat-item-btn {
  text-align: left;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.chat-item-btn:hover { background: rgba(37, 99, 235, 0.55); }

/* ==================== OFFICIAL SPRITE POKER CARDS ==================== */
.poker-card {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 85%, #e2e8f0 100%);
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: -2px 4px 10px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  flex-shrink: 0;
}

.card-lg { width: 92px; height: 132px; }
.card-md { width: 68px; height: 98px; border-radius: 8px; }
.card-sm { width: 42px; height: 60px; border-radius: 6px; }
.card-xs { width: 32px; height: 44px; border-radius: 5px; }

.card-back {
  background: #d8cdb4;
  border-color: #fff;
}
.card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-corner {
  position: absolute;
  top: 5px;
  left: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 2;
}

.card-lg .card-rank-img { height: 22px; width: auto; max-width: 24px; object-fit: contain; }
.card-lg .card-suit-sm { width: 16px; height: 16px; object-fit: contain; }
.card-lg .card-joker-text { width: 14px; height: 64px; object-fit: contain; }
.card-lg .card-suit-lg { position: absolute; right: 8px; bottom: 10px; width: 46px; height: 46px; object-fit: contain; }
.card-lg .card-joker-art { position: absolute; right: 4px; bottom: 4px; width: 66px; height: 96px; object-fit: contain; }

.card-md .card-corner { top: 4px; left: 4px; gap: 1px; }
.card-md .card-rank-img { height: 18px; width: auto; max-width: 20px; object-fit: contain; }
.card-md .card-suit-sm { width: 13px; height: 13px; object-fit: contain; }
.card-md .card-joker-text { width: 11px; height: 48px; object-fit: contain; }
.card-md .card-suit-lg { position: absolute; right: 5px; bottom: 6px; width: 34px; height: 34px; object-fit: contain; }
.card-md .card-joker-art { position: absolute; right: 2px; bottom: 2px; width: 48px; height: 70px; object-fit: contain; }

.card-sm .card-corner { top: 2px; left: 3px; gap: 1px; }
.card-sm .card-rank-img { height: 12px; width: auto; max-width: 14px; object-fit: contain; }
.card-sm .card-suit-sm { width: 9px; height: 9px; object-fit: contain; }
.card-sm .card-joker-text { width: 8px; height: 32px; object-fit: contain; }
.card-sm .card-suit-lg { position: absolute; right: 3px; bottom: 3px; width: 20px; height: 20px; object-fit: contain; }
.card-sm .card-joker-art { position: absolute; right: 1px; bottom: 1px; width: 28px; height: 42px; object-fit: contain; }

.card-xs .card-corner { top: 2px; left: 2px; gap: 1px; }
.card-xs .card-rank-img { height: 10px; width: auto; max-width: 11px; object-fit: contain; }
.card-xs .card-suit-sm { width: 8px; height: 8px; object-fit: contain; }
.card-xs .card-joker-text { width: 6px; height: 24px; object-fit: contain; }
.card-xs .card-suit-lg { position: absolute; right: 2px; bottom: 2px; width: 15px; height: 15px; object-fit: contain; }
.card-xs .card-joker-art { position: absolute; right: 1px; bottom: 1px; width: 22px; height: 32px; object-fit: contain; }

.card-landlord-ribbon {
  position: absolute;
  top: 4px;
  right: -14px;
  background: linear-gradient(90deg, #f59e0b, #dc2626);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 16px;
  transform: rotate(35deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ==================== FX OVERLAY (RICH ANIMATIONS) ==================== */
.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  overflow: hidden;
}

.fx-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fx-flash {
  position: absolute;
  inset: 0;
  animation: fxFlash 0.55s ease-out forwards;
}
.fx-flash-orange { background: radial-gradient(circle, rgba(255, 224, 102, 0.72), rgba(239, 68, 68, 0.25) 55%, transparent 80%); }
.fx-flash-gold { background: radial-gradient(circle, rgba(255, 255, 255, 0.85), rgba(250, 204, 21, 0.4) 50%, transparent 82%); }

.fx-shockwave {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 6px solid rgba(251, 146, 60, 0.95);
  box-shadow: 0 0 36px rgba(239, 68, 68, 0.9), inset 0 0 24px rgba(253, 224, 71, 0.8);
  animation: fxShockwave 0.75s cubic-bezier(0.12, 0.8, 0.25, 1) forwards;
}
.fx-shockwave-gold {
  border-color: #fef08a;
  box-shadow: 0 0 50px rgba(250, 204, 21, 1), inset 0 0 30px rgba(192, 132, 252, 0.8);
}

.fx-particle {
  position: absolute;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
  animation: fxParticleBurst 0.85s cubic-bezier(0.15, 0.8, 0.3, 1) forwards;
}

/* Bomb Fly & Explode */
.fx-bomb-fly {
  position: absolute;
  width: 118px;
  height: 118px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.7));
  animation: fxBombArc 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.fx-fire-sheet {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 0 22px rgba(251, 146, 60, 0.85));
}

.fx-rocket-launch {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fxRocketUp 0.52s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.fx-rocket-img {
  width: 210px;
  height: auto;
  object-fit: contain;
  transform: rotate(-90deg);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.65));
}

.fx-rocket-flame {
  width: 110px;
  height: auto;
  margin-top: 24px;
  transform: rotate(90deg);
  mix-blend-mode: screen;
  filter: brightness(1.25);
}

.fx-lightning-arc {
  position: absolute;
  z-index: 4;
  width: 340px;
  height: 115px;
  pointer-events: none;
}
.fx-lightning-arc svg {
  width: 100%;
  height: 100%;
  animation: fxLightningFlash 0.68s ease-out forwards;
}
.fx-lightning-1 { transform: translate(-115px, -38px) rotate(-24deg); }
.fx-lightning-2 { transform: translate(115px, -28px) rotate(24deg) scaleX(-1); }

.fx-shard {
  position: absolute;
  width: 34px;
  height: 34px;
  object-fit: contain;
  animation: fxShardFly 0.85s cubic-bezier(0.16, 0.8, 0.3, 1) forwards;
}

/* Rocket / Wangzha */
.fx-joker-clash {
  position: absolute;
  width: 145px;
  height: 185px;
  object-fit: contain;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.7));
}
.fx-joker-left { animation: fxJokerLeft 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.fx-joker-right { animation: fxJokerRight 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

.fx-wangzha-art {
  position: relative;
  z-index: 5;
  width: 300px;
  max-width: 68vw;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(250, 204, 21, 0.9)) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.75));
  animation: fxTitleSlam 1.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fx-sub-badge {
  position: absolute;
  margin-top: 165px;
  z-index: 6;
  background: linear-gradient(90deg, #dc2626, #f59e0b);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  padding: 5px 22px;
  border-radius: 999px;
  border: 2px solid #fef08a;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  animation: fxTitleSlam 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Plane Fly-by */
.fx-plane-fly {
  position: absolute;
  display: flex;
  align-items: center;
  animation: fxPlaneFly 1.45s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.fx-plane-img {
  width: 230px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.55));
  animation: fxPlaneBob 0.22s ease-in-out infinite alternate;
}

.fx-plane-trail {
  width: 220px;
  height: 74px;
  object-fit: fill;
  margin-right: -55px;
  opacity: 0.78;
  mix-blend-mode: screen;
  filter: hue-rotate(175deg) brightness(1.4);
}

.fx-cloud {
  position: absolute;
  width: 150px;
  opacity: 0;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.25));
  animation: fxCloudDrift 1.4s ease-out forwards;
}

.fx-speed-line {
  position: absolute;
  left: -30%;
  width: 36vw;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(186, 230, 253, 0.9), transparent);
  animation: fxSpeedLine 0.75s linear forwards;
}

/* Straight / Pair Straight Ribbon */
.fx-ribbon {
  position: absolute;
  width: 110vw;
  height: 92px;
  animation: fxRibbonSweep 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.fx-ribbon-straight {
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.72), rgba(253, 224, 71, 0.82), rgba(56, 189, 248, 0.72), transparent);
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.7);
}
.fx-ribbon-pair {
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.75), rgba(244, 114, 182, 0.85), rgba(253, 224, 71, 0.75), transparent);
  box-shadow: 0 0 40px rgba(192, 132, 252, 0.75);
}

/* Spring Petals */
.fx-spring-glow {
  position: absolute;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253, 224, 71, 0.55), rgba(74, 222, 128, 0.25) 55%, transparent 75%);
  animation: fxSpringAura 1.9s ease-out forwards;
}

.fx-petal {
  position: absolute;
  top: -24px;
  width: 16px;
  height: 12px;
  border-radius: 80% 0 80% 0;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.5);
  animation: fxPetalFall 1.7s ease-in forwards;
}

/* Deal Animation */
.fx-deal-deck {
  position: absolute;
  width: 68px;
  height: 98px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 3px 3px 0 #cbd5e1, 6px 6px 0 #94a3b8;
  animation: fxDealDeckPop 0.95s ease forwards;
}

.fx-deal-fly {
  position: absolute;
  width: 62px;
  height: 88px;
  border-radius: 7px;
  opacity: 0;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  animation: fxDealFly 0.36s cubic-bezier(0.2, 0.75, 0.3, 1) forwards;
}

.card-deal-in {
  opacity: 0;
  animation: cardDealIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Shared Title Stamp */
.fx-title-stamp {
  position: relative;
  z-index: 6;
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 5px;
  padding: 8px 34px;
  border-radius: 18px;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.85), 0 0 20px rgba(255, 213, 79, 0.75);
  animation: fxTitleSlam 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.fx-title-stamp span {
  font-size: 32px;
  color: #fef08a;
}
.fx-title-bomb { color: #fef08a; -webkit-text-stroke: 2px #991b1b; }
.fx-title-plane { color: #e0f2fe; -webkit-text-stroke: 2px #0369a1; margin-top: 150px; font-size: 42px; }
.fx-title-straight { color: #fef08a; -webkit-text-stroke: 2px #0369a1; font-size: 46px; }
.fx-title-pair { color: #fdf4ff; -webkit-text-stroke: 2px #7e22ce; font-size: 46px; }
.fx-title-spring { color: #fef08a; -webkit-text-stroke: 2px #15803d; font-size: 50px; }

.shake-screen { animation: screenShake 0.42s ease; }
.shake-heavy { animation: screenShakeHeavy 0.6s ease; }

/* ==================== MODALS ==================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 22, 0.72);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  z-index: 2;
  width: min(92vw, 520px);
  background: linear-gradient(180deg, #13284f 0%, #0b1933 100%);
  border: 1.5px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: popIn 0.2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.modal-header h3 { margin: 0; font-size: 18px; color: var(--gold); }
.modal-close {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row label { font-size: 13px; color: var(--text-sub); font-weight: 600; }

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.chip.active {
  background: linear-gradient(180deg, #fde047, #f59e0b);
  color: #451a03;
  border-color: #fde047;
  font-weight: 800;
}

.switch-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
}
.toggle-switch .slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .slider { background: #22c55e; }
.toggle-switch input:checked + .slider::before { transform: translateX(22px); }

.modal-footer {
  padding: 14px 22px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Result Modal */
.result-dialog { width: min(94vw, 580px); }
.result-banner {
  position: relative;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1d4ed8, #0f172a);
}
.result-banner.win { background: linear-gradient(135deg, #d97706, #b45309); }
.result-banner.lose { background: linear-gradient(135deg, #334155, #1e293b); }
.result-banner-img {
  position: absolute;
  height: 90%;
  object-fit: contain;
  opacity: 0.35;
}
.result-banner-text {
  position: relative;
  z-index: 2;
  font-size: 34px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
}

.result-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px 0;
}

.result-table {
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 10px 14px;
}
.result-row.is-me {
  border: 1.5px solid var(--gold);
  background: rgba(245, 158, 11, 0.16);
}
.result-row-left { display: flex; align-items: center; gap: 10px; }
.result-row-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: contain; background: #1e3a8a; }
.result-delta { font-size: 18px; font-weight: 900; }
.result-delta.pos { color: #4ade80; }
.result-delta.neg { color: #f87171; }
.result-footer { justify-content: center; }

/* Toast (positioned near lower-center above action buttons for easy visibility) */
.toast {
  position: fixed;
  bottom: 248px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: rgba(15, 23, 42, 0.94);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  padding: 9px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

/* ==================== ANIMATIONS ==================== */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes alarmPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes clockRing {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-9deg) scale(1.06); }
  75% { transform: rotate(9deg) scale(1.06); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes cardDrop {
  from { opacity: 0; transform: translateY(-14px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes hatDrop {
  from { opacity: 0; transform: translate(-50%, -24px) scale(1.4); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes fxBurst {
  0% { opacity: 0; transform: scale(0.4); }
  22% { opacity: 1; transform: scale(1.12); }
  75% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.22); }
}

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-7px, 5px); }
  40% { transform: translate(7px, -5px); }
  60% { transform: translate(-5px, -4px); }
  80% { transform: translate(5px, 4px); }
}

@keyframes screenShakeHeavy {
  0%, 100% { transform: translate(0, 0); }
  12% { transform: translate(-12px, 8px); }
  25% { transform: translate(12px, -9px); }
  38% { transform: translate(-10px, -7px); }
  52% { transform: translate(10px, 7px); }
  68% { transform: translate(-6px, 5px); }
  84% { transform: translate(5px, -4px); }
}

@keyframes fxFlash {
  0% { opacity: 0.95; }
  100% { opacity: 0; }
}

@keyframes fxShockwave {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(8.5); opacity: 0; }
}

@keyframes fxParticleBurst {
  0% { transform: translate(0, 0) scale(1.2); opacity: 1; }
  75% { opacity: 0.9; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

@keyframes fxBombArc {
  0% { transform: translate(-180px, 160px) scale(0.6) rotate(-180deg); opacity: 0.7; }
  65% { transform: translate(0, -35px) scale(1.25) rotate(20deg); opacity: 1; }
  100% { transform: translate(0, 0) scale(0.2) rotate(90deg); opacity: 0; }
}

@keyframes fxFireball {
  0% { transform: scale(0.25) rotate(0deg); opacity: 1; }
  45% { transform: scale(1.25) rotate(18deg); opacity: 0.95; }
  100% { transform: scale(1.65) rotate(35deg); opacity: 0; }
}

@keyframes fxShardFly {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.35) rotate(var(--rot)); opacity: 0; }
}

@keyframes fxRocketUp {
  0% { transform: translateY(42vh) scale(0.7); opacity: 0.4; }
  55% { transform: translateY(-4vh) scale(1.12); opacity: 1; }
  85% { transform: translateY(-18vh) scale(1.25); opacity: 1; }
  100% { transform: translateY(-48vh) scale(0.8); opacity: 0; }
}

@keyframes fxJokerLeft {
  0% { transform: translate(-360px, 40px) scale(0.8) rotate(-18deg); opacity: 0; }
  70% { transform: translate(-25px, 0) scale(1.15) rotate(6deg); opacity: 1; }
  100% { transform: translate(0, -10px) scale(0.3); opacity: 0; }
}

@keyframes fxJokerRight {
  0% { transform: translate(360px, 40px) scale(0.8) rotate(18deg); opacity: 0; }
  70% { transform: translate(25px, 0) scale(1.15) rotate(-6deg); opacity: 1; }
  100% { transform: translate(0, -10px) scale(0.3); opacity: 0; }
}

@keyframes fxLightningFlash {
  0% { opacity: 0; transform: scale(0.7); }
  20% { opacity: 1; transform: scale(1.15); }
  45% { opacity: 0.4; }
  65% { opacity: 1; transform: scale(1.25); }
  100% { opacity: 0; transform: scale(1.35); }
}

@keyframes fxTitleSlam {
  0% { opacity: 0; transform: scale(2.1); }
  22% { opacity: 1; transform: scale(0.94); }
  32% { transform: scale(1.04); }
  78% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.12); }
}

@keyframes fxPlaneFly {
  0% { transform: translate(-65vw, 90px) rotate(-8deg) scale(0.85); opacity: 0; }
  12% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate(68vw, -95px) rotate(-6deg) scale(1.15); opacity: 0; }
}

@keyframes fxPlaneBob {
  from { transform: translateY(-4px); }
  to { transform: translateY(4px); }
}

@keyframes fxCloudDrift {
  0% { transform: translateX(60px) scale(0.7); opacity: 0; }
  25% { opacity: 0.72; }
  100% { transform: translateX(-140px) scale(1.15); opacity: 0; }
}

@keyframes fxSpeedLine {
  0% { transform: translateX(-10vw); opacity: 0; }
  30% { opacity: 0.9; }
  100% { transform: translateX(135vw); opacity: 0; }
}

@keyframes fxRibbonSweep {
  0% { transform: translateX(-100vw) skewX(-18deg); opacity: 0; }
  28% { transform: translateX(0) skewX(-18deg); opacity: 0.95; }
  75% { transform: translateX(0) skewX(-18deg); opacity: 0.85; }
  100% { transform: translateX(100vw) skewX(-18deg); opacity: 0; }
}

@keyframes fxSpringAura {
  0% { transform: scale(0.3); opacity: 0; }
  30% { transform: scale(1.15); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes fxDealDeckPop {
  0% { opacity: 0; transform: scale(0.7); }
  12% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; transform: scale(0.96); }
  100% { opacity: 0; transform: scale(0.6); }
}

@keyframes fxDealFly {
  0% { opacity: 0.95; transform: translate(0, 0) scale(0.9) rotate(0deg); }
  75% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.78) rotate(var(--rot)); }
}

@keyframes cardDealIn {
  0% { opacity: 0; transform: translateY(-70px) scale(0.78); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fxPetalFall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  15% { opacity: 0.95; }
  100% { transform: translate(var(--sway), 105vh) rotate(540deg); opacity: 0; }
}

/* Responsive adjustments */
@media (max-width: 960px) {
  .lobby-main { grid-template-columns: 1fr; overflow-y: auto; }
  .card-lg { width: 70px; height: 100px; }
  .my-hand-cards { padding-left: 34px; }
  .my-hand-cards .poker-card { margin-left: -34px; }
  .self-info-panel { width: 150px; }
}
