/* ===== CEKIH Card — Green Table Online UI ===== */
:root {
  --felt-dark: #0d4d2b;
  --felt-mid: #157a42;
  --felt-light: #1e9654;
  --felt-glow: #2ecc71;
  --rim-wood: #5c3d1e;
  --rim-gold: #c9a227;
  --bg-room: #0a1628;
  --panel-glass: rgba(8, 20, 40, 0.82);
  --text: #f0f4f8;
  --muted: #94a3b8;
  --gold: #f0c14b;
  --gold-dark: #b8860b;
  --danger: #ef4444;
  --primary: #3b82f6;
  --card-w: 60px;
  --card-h: 80px;
  --card-sm-w: 52px;
  --card-sm-h: 72px;
  --card-discard-w: 82px;
  --card-discard-h: 116px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-room);
  color: var(--text);
  overflow: hidden;
}

.game-audio-unlock {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: transparent;
  pointer-events: none;
}

.game-audio-unlock.is-visible,
.game-audio-unlock:not([hidden]) {
  display: flex;
  pointer-events: auto;
}

.game-audio-unlock[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.game-audio-unlock-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(100%, 280px);
  padding: 22px 20px;
  border-radius: 16px;
  border: 1px solid rgba(240, 193, 75, 0.45);
  background: linear-gradient(180deg, rgba(22, 42, 64, 0.95), rgba(10, 22, 36, 0.95));
  color: var(--text);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.game-audio-unlock-card:disabled {
  opacity: 0.72;
  cursor: default;
  border-color: rgba(240, 193, 75, 0.28);
}

.game-audio-unlock-card.is-acked:not(:disabled) {
  border-color: rgba(120, 220, 160, 0.55);
}

.game-audio-unlock-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold);
}

.game-audio-unlock-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.game-audio-unlock-countdown,
.phase-countdown--endgame {
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffb84d;
  letter-spacing: 0.04em;
}


body.game-audio-unlock-open .table-wrap,
body.game-audio-unlock-open .room-header .header-actions {
  pointer-events: none;
}

/* ===== Animations ===== */
@keyframes dealIn {
  from { opacity: 0; transform: translateY(-40px) scale(0.6) rotate(-8deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes cardPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.08) translateY(-6px); }
  100% { transform: scale(1); }
}

@keyframes floatDeck {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes turnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 193, 75, 0.6); }
  50% { box-shadow: 0 0 0 12px rgba(240, 193, 75, 0); }
}

@keyframes slideToast {
  from { opacity: 0; transform: translateX(-50%) translateY(-16px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes discardFly {
  from { opacity: 0; transform: scale(1.3) rotate(12deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.anim-deal { animation: dealIn 0.45s cubic-bezier(0.34, 1.4, 0.64, 1) both; }

/* Deal awal: transisi fan halus, tanpa kedip innerHTML */
body.deal-animating .seat-hand-fan .card-fan-item {
  transition:
    margin-left 0.28s cubic-bezier(0.25, 0.9, 0.35, 1),
    transform 0.28s cubic-bezier(0.25, 0.9, 0.35, 1);
  will-change: transform, margin-left;
}

body.deal-animating .deal-opponent-stack {
  transition: transform 0.2s ease;
}

body.deal-animating .deck-pile.anim-idle-float {
  animation: none;
}
.anim-pop { animation: cardPop 0.35s ease; }
.anim-idle-float { animation: floatDeck 2.5s ease-in-out infinite; }
.anim-modal-in { animation: modalIn 0.35s ease both; }
.anim-discard-in { animation: discardFly 0.4s cubic-bezier(0.34, 1.2, 0.64, 1) both; }

/* ===== Layout ===== */
.game-room {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.btn-login {
  font-size: 0.78rem;
  padding: 6px 14px;
  white-space: nowrap;
}

.btn-login.is-logged-in {
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  border: none;
  color: #111;
  box-shadow: 0 4px 12px rgba(240, 193, 75, 0.35);
}

.btn-login.is-logged-in:hover {
  filter: brightness(1.08);
  color: #111;
}

.login-panel {
  width: min(360px, calc(100vw - 32px));
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0 8px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

.login-field span {
  color: var(--muted);
  font-weight: 600;
}

.login-field input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 0.95rem;
}

.login-field input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.login-error {
  margin: 0;
  font-size: 0.82rem;
  color: #f87171;
}

.btn-login-submit {
  width: 100%;
  margin-top: 4px;
}

.setting-row--locked {
  opacity: 0.65;
}

.setting-row--locked .toggle {
  cursor: not-allowed;
}

body.mp-spectator #human-hand,
body.mp-spectator .pickup-zone-row,
body.mp-spectator #deck-stack {
  pointer-events: none;
  opacity: 0.85;
}

.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: linear-gradient(180deg, rgba(0,0,0,.5), transparent);
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-wrap: wrap;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 2rem;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}

.brand h1 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.brand p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.header-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.header-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.header-chat-toggle,
.btn-desktop-chat-toggle {
  display: none;
}

.spectator-voice-control {
  display: none;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
}

body.is-multiplayer-mode .header-actions .spectator-voice-control:not([hidden]) {
  display: inline-flex;
}

.spectator-voice-control-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.spectator-voice-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(80, 80, 80, 0.65);
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.spectator-voice-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e8e8e8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}

.spectator-voice-toggle.is-on {
  background: rgba(74, 222, 128, 0.35);
  border-color: rgba(134, 239, 172, 0.55);
}

.spectator-voice-toggle.is-on::after {
  transform: translateX(20px);
}

.header-voice-btn {
  position: relative;
}

.header-voice-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex: 0 0 auto;
}

body.is-multiplayer-mode .header-voice-btn.btn-voice-channel.is-active {
  background: rgba(56, 189, 248, 0.28);
  border-color: rgba(125, 211, 252, 0.65);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

body.is-multiplayer-mode .header-voice-btn.btn-voice-ptt.is-active {
  background: rgba(240, 193, 75, 0.35);
  border-color: rgba(240, 193, 75, 0.85);
  box-shadow: 0 0 14px rgba(240, 193, 75, 0.45);
}

body.is-multiplayer-mode .header-voice-btn.btn-voice-ptt:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

body.is-multiplayer-mode .header-voice-btn.btn-voice-ptt--needs-mic:not(:disabled) {
  border-color: rgba(134, 239, 172, 0.55);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.25);
}

body.is-multiplayer-mode .header-voice-btn:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.voice-remote-audio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.header-chat-toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.btn-desktop-chat-toggle {
  position: relative;
}

.mobile-chat-unread-badge {
  position: absolute;
  top: -4px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* Timer giliran MP — frame sama seperti tombol header (icon-btn / voice) */
.mp-turn-timer.header-voice-btn {
  padding: 0;
  cursor: default;
  pointer-events: none;
  user-select: none;
}

.mp-turn-timer .mp-turn-timer-value {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text);
}

.header-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat-pill {
  background: var(--panel-glass);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  backdrop-filter: blur(8px);
}

.stat-label {
  color: var(--muted);
  margin-right: 4px;
}

.header-tutup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.header-tutup-actions[hidden] {
  display: none !important;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
  row-gap: 8px;
}

/* Desktop: rapikan semua tombol action header agar tinggi, padding, dan alignment konsisten */
.header-actions > .btn,
.header-actions > .icon-btn,
.header-actions > .btn-replay-bot {
  height: 36px;
  min-height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1;
}

.header-actions > .btn {
  padding: 0 12px;
  font-size: 0.8rem;
}

.header-actions > .icon-btn {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.header-actions > .btn-replay-bot {
  padding: 0 12px;
}

.header-actions .header-tutup-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-right: 2px;
}

.btn-replay-bot {
  font-size: 0.78rem;
  padding: 6px 12px;
  white-space: nowrap;
}

.btn-replay-bot[hidden] {
  display: none !important;
}

body.is-multiplayer-mode #btn-undo-turn,
body.is-multiplayer-mode #btn-continue-turn,
body.is-multiplayer-mode #btn-settings,
body.is-multiplayer-mode #btn-new,
body.is-multiplayer-mode #btn-login {
  display: none !important;
}

.mp-livechat {
  position: fixed;
  top: 73px;
  right: 1px;
  width: min(360px, 42vw);
  min-width: 280px;
  max-height: 44vh;
  z-index: 230;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  color: #fff;
}

.mp-livechat.is-mobile-closed {
  display: none !important;
}

.mp-livechat-head {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.92);
}

.mp-livechat-list {
  overflow: auto;
  min-height: 120px;
  max-height: calc(25vh - 84px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

.mp-chat-row {
  font-size: 0.74rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.95);
  word-break: break-word;
}

.mp-chat-name {
  color: #f5d05e;
  font-weight: 700;
  margin-right: 6px;
}

.mp-chat-row--system {
  color: var(--gold);
  font-size: 0.82rem;
  font-style: italic;
  opacity: 0.95;
}

.mp-chat-spectator-tag {
  color: #9ca3af;
  font-weight: 700;
  margin-right: 4px;
}

.mp-livechat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.mp-livechat-form input {
  min-width: 0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  color: #fff;
  padding: 8px 10px;
  font-size: 16px;
}

.mp-livechat-form input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.table-wrap {
  flex: 1;
  display: flex;
  gap: 0;
  min-height: calc(100vh - 70px);
  position: relative;
}

/* ===== Green Table ===== */
.table-surface {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.table-rim {
  position: absolute;
  inset: 6px;
  border-radius: 50% / 39%;
  background: linear-gradient(145deg, var(--rim-wood), #3d2814);
  box-shadow:
    inset 0 4px 20px rgba(0,0,0,.6),
    0 8px 40px rgba(0,0,0,.7),
    0 0 0 6px var(--rim-gold);
}

.table-felt {
  position: relative;
  width: min(1180px, 98vw);
  height: min(760px, 82vh);
  border-radius: 50% / 39%;
  background:
    radial-gradient(ellipse 80% 70% at 50% 45%, var(--felt-light) 0%, var(--felt-mid) 45%, var(--felt-dark) 100%);
  box-shadow: inset 0 0 80px rgba(0,0,0,.35);
  overflow: visible;
  -webkit-user-select: none;
  user-select: none;
}

.table-felt::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50% / 39%;
  border: 2px dashed rgba(255,255,255,.08);
  pointer-events: none;
}

/* Zona drop buang kartu — meja hijau tengah */
.table-discard-drop {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: 78%;
  height: 62%;
  max-width: 760px;
  border-radius: 50% / 46%;
  z-index: 6;
  pointer-events: none;
  border: 2px dashed transparent;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.table-discard-drop.is-active {
  pointer-events: auto;
  cursor: copy;
  /* Jangan menutupi hand pemain di bawah meja */
  top: 32%;
  height: 50%;
  width: 72%;
}

.table-discard-drop.drag-over {
  border-color: rgba(240, 193, 75, 0.65);
  background: rgba(240, 193, 75, 0.1);
  box-shadow: inset 0 0 40px rgba(240, 193, 75, 0.12);
}

.table-felt--discard-target::after {
  color: rgba(240, 193, 75, 0.22);
}

.table-felt::after {
  content: "AKSICEKIH";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.table-online-watermark {
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  z-index: 1;
  font-size: clamp(0.58rem, 1.45vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.2);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  white-space: nowrap;
}

/* ===== Seats ===== */
.seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: filter 0.3s;
  z-index: 2;
}

.seat-active {
  filter: drop-shadow(0 0 12px rgba(240, 193, 75, 0.8));
}

.seat-active .seat-info {
  animation: turnPulse 1.5s ease infinite;
  border-color: var(--gold);
}

.seat-top {
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
}

.seat-bottom {
  bottom: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  max-width: 100%;
  z-index: 25;
  pointer-events: none;
}

.seat-bottom .human-play-zone,
.seat-bottom .seat-cards-wrap,
.seat-bottom .pickup-zone-row,
.seat-bottom .pickup-zone-center,
.seat-bottom .seat-locked,
.seat-bottom .pickup-staging-drop,
.seat-bottom .seat-hand,
.seat-bottom .seat-hand .card,
.seat-bottom .seat-info {
  pointer-events: auto;
}

/* ===== Human hand row ===== */
.human-play-zone {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: max-content;
  max-width: min(720px, 94vw);
  margin: 0 auto;
}

/* Pickup manual — highlight kartu */
.card.pickup-hl-combo {
  box-shadow:
    0 0 0 3px rgba(240, 193, 75, 0.95),
    0 0 18px rgba(240, 193, 75, 0.45);
}

.card.pickup-hl-hand {
  box-shadow:
    0 0 0 3px rgba(56, 189, 248, 0.95),
    0 0 16px rgba(56, 189, 248, 0.4);
}

.card.pickup-hl-combo.pickup-hl-hand {
  box-shadow:
    0 0 0 3px rgba(240, 193, 75, 0.95),
    0 0 0 6px rgba(56, 189, 248, 0.5);
}

.pickup-staging-drop {
  width: 100%;
  min-height: 48px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px dashed rgba(240, 193, 75, 0.35);
  background: rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.pickup-staging-drop--hand-modal-step {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.08);
}

.pickup-staging-drop--hand-modal-step .pickup-staging-label {
  color: rgba(125, 211, 252, 0.95);
}

.seat-locked-human.pickup-staging-drop--over .pickup-staging-drop,
.pickup-staging-drop--over,
.seat-locked-human--drop-over .pickup-staging-drop {
  border-color: rgba(240, 193, 75, 0.95);
  background: rgba(240, 193, 75, 0.14);
  box-shadow:
    inset 0 0 24px rgba(240, 193, 75, 0.15),
    0 0 20px rgba(240, 193, 75, 0.35);
}

.pickup-staging-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(240, 193, 75, 0.8);
  margin-bottom: 6px;
  text-align: center;
}

.pickup-staging-label--status {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 0.58rem;
  color: rgba(240, 193, 75, 0.72);
}

#seat-1 .pickup-staging-cards {
  flex-wrap: nowrap;
}

.pickup-staging-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  min-height: 36px;
  align-items: center;
}

.pickup-staging-placeholder {
  color: rgba(255, 255, 255, 0.25);
  font-size: 1.2rem;
  letter-spacing: 0.2em;
}

.pickup-staging-card-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.pickup-staging-undo {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.92);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.pickup-staging-undo:hover {
  background: #dc2626;
}

/* Cancel (kiri) · frame zona lock · Finish (kanan) */
.pickup-zone-center {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: min(360px, calc(100vw - 11rem));
  gap: 6px;
  position: relative;
  z-index: 45;
  pointer-events: auto;
}

.pickup-mode-tabs {
  display: flex;
  gap: 4px;
  width: 100%;
  padding: 2px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(240, 193, 75, 0.2);
  position: relative;
  z-index: 2;
  pointer-events: auto;
  isolation: isolate;
}

.pickup-mode-tabs[hidden],
.pickup-mode-tabs.pickup-mode-tabs--hidden {
  display: none !important;
}

.pickup-mode-tab {
  flex: 1;
  min-height: 32px;
  padding: 4px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 1;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.pickup-mode-tab:disabled,
.pickup-mode-tab[aria-disabled="true"] {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}

.pickup-mode-tab:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
}

.pickup-mode-tab.is-active {
  background: rgba(240, 193, 75, 0.22);
  color: #fde68a;
  box-shadow: inset 0 0 0 1px rgba(240, 193, 75, 0.45);
}

.pickup-mode-tab:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.8);
  outline-offset: 1px;
}

.pickup-zone-row,
.pickup-zone-toolbar {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: min(720px, 96vw);
  margin: 0 auto 4px;
  flex-shrink: 0;
  pointer-events: auto;
  position: relative;
  z-index: 45;
  overflow: visible;
}

.pickup-zone-row[hidden],
.pickup-zone-toolbar[hidden],
.pickup-zone-btn[hidden] {
  display: none !important;
  pointer-events: none !important;
}

/* Pamer kartu saat bukan giliran: frame emas saja, tanpa tab / OK / Cancel */
.pickup-zone-row--showcase .pickup-zone-btn--side,
.pickup-zone-row--showcase .pickup-mode-tabs {
  display: none !important;
}

.pickup-zone-row .seat-locked-human,
.pickup-zone-toolbar .seat-locked-human {
  flex: 1 1 auto;
  min-width: min(360px, calc(100vw - 11rem));
  max-width: min(640px, 92vw);
  margin: 0;
  align-self: stretch;
}

.pickup-zone-btn--side {
  flex: 0 0 auto;
  align-self: center;
  min-width: 72px;
}

.pickup-zone-btn--side.pickup-zone-btn--primary {
  min-width: 80px;
}

.pickup-zone-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 5px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.pickup-zone-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.pickup-zone-btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.pickup-zone-btn--ghost {
  color: rgba(255, 255, 255, 0.88);
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.22);
}

.pickup-zone-btn--ghost:not(:disabled):hover {
  background: rgba(127, 29, 29, 0.5);
  border-color: rgba(252, 165, 165, 0.5);
  color: #fee2e2;
}

.pickup-zone-btn--primary {
  color: #1a2e1f;
  background: linear-gradient(180deg, #f5d76e 0%, #c9a227 100%);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  min-width: 88px;
}

.pickup-zone-btn--primary.is-ready:not(:disabled) {
  box-shadow: 0 0 14px rgba(240, 193, 75, 0.45), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.pickup-zone-btn-sub {
  display: block;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.85;
  line-height: 1.2;
  margin-top: 1px;
}

.pickup-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 10px;
  font-size: 0.68rem;
}

.pickup-legend-item {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
}

.pickup-legend-combo {
  border: 1px solid rgba(240, 193, 75, 0.5);
  color: rgba(240, 193, 75, 0.95);
}

.pickup-legend-hand {
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: rgba(125, 211, 252, 0.95);
}

body.card-drag-from-pile .discard-ring-host {
  pointer-events: auto;
}

body.card-drag-from-pile #human-hand {
  pointer-events: none;
  z-index: 5;
}

body.card-drag-from-pile #pickup-zone-toolbar:not([hidden]),
body.card-drag-from-pile #locked-0 {
  position: relative;
  z-index: 20000;
  pointer-events: auto;
}

.seat-left {
  left: 2%;
  top: 50%;
  transform: translateY(-50%);
}

.seat-right {
  right: 2%;
  top: 50%;
  transform: translateY(-50%);
}

.seat-info {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--panel-glass);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 4px 12px;
  text-align: center;
  backdrop-filter: blur(6px);
  font-size: 0.78rem;
}

.seat-info:has(.seat-ingame-kick-btn) {
  padding-top: 6px;
  padding-right: 28px;
}

.seat-ingame-kick-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 6;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(69, 24, 24, 0.96) 0%, rgba(45, 14, 14, 0.98) 100%);
  color: #fca5a5;
  box-shadow:
    0 0 0 1px rgba(248, 113, 113, 0.4),
    0 2px 5px rgba(0, 0, 0, 0.32);
  font-size: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease,
    color 0.15s ease;
}

.seat-ingame-kick-btn::before,
.seat-ingame-kick-btn::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 1.5px;
  margin: -0.75px 0 0 -5px;
  border-radius: 1px;
  background: currentColor;
}

.seat-ingame-kick-btn::before {
  transform: rotate(45deg);
}

.seat-ingame-kick-btn::after {
  transform: rotate(-45deg);
}

.seat-ingame-kick-btn:hover {
  color: #fff;
  background: linear-gradient(180deg, rgba(185, 40, 40, 0.98) 0%, rgba(127, 29, 29, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(252, 165, 165, 0.55),
    0 3px 8px rgba(127, 29, 29, 0.42);
  transform: translateY(-1px);
}

.seat-ingame-kick-btn:active {
  transform: translateY(0) scale(0.94);
}

.seat-ingame-kick-btn:focus-visible {
  outline: 2px solid rgba(252, 165, 165, 0.75);
  outline-offset: 2px;
}

.seat-take-btn {
  margin-left: 6px;
  padding: 2px 9px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(34, 86, 54, 0.96) 0%, rgba(20, 60, 38, 0.98) 100%);
  color: #bbf7d0;
  box-shadow:
    0 0 0 1px rgba(74, 222, 128, 0.45),
    0 2px 5px rgba(0, 0, 0, 0.32);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.3;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.seat-take-btn:hover {
  color: #fff;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.98) 0%, rgba(21, 128, 61, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(134, 239, 172, 0.6),
    0 3px 8px rgba(21, 128, 61, 0.42);
  transform: translateY(-1px);
}

.seat-take-btn:active {
  transform: translateY(0) scale(0.95);
}

.seat-take-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.seat-take-btn:focus-visible {
  outline: 2px solid rgba(134, 239, 172, 0.75);
  outline-offset: 2px;
}

.seat-sticker-btn {
  margin-left: 2px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(55, 48, 90, 0.96) 0%, rgba(36, 30, 62, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(167, 139, 250, 0.45),
    0 2px 5px rgba(0, 0, 0, 0.32);
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.seat-sticker-btn:hover {
  background: linear-gradient(180deg, rgba(109, 40, 217, 0.92) 0%, rgba(76, 29, 149, 0.96) 100%);
  box-shadow:
    0 0 0 1px rgba(196, 181, 253, 0.65),
    0 3px 8px rgba(76, 29, 149, 0.42);
  transform: translateY(-1px) scale(1.05);
}

.seat-sticker-btn:active {
  transform: translateY(0) scale(0.94);
}

.seat-sticker-btn:focus-visible {
  outline: 2px solid rgba(196, 181, 253, 0.75);
  outline-offset: 2px;
}

/* —— Sticker picker & FX —— */
.sticker-picker {
  z-index: 12000;
}

.sticker-picker-panel {
  max-width: min(92vw, 380px);
  padding-bottom: 14px;
}

.sticker-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sticker-picker-close {
  flex-shrink: 0;
}

.sticker-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 8px 14px 4px;
}

.sticker-picker-item {
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(12, 18, 28, 0.72);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.12s ease;
}

.sticker-picker-item:hover {
  border-color: rgba(196, 181, 253, 0.55);
  background: rgba(76, 29, 149, 0.28);
  transform: scale(1.06);
}

.sticker-picker-item:active {
  transform: scale(0.95);
}

.sticker-picker-preview {
  pointer-events: none;
}

/* Preview bom di popup: ulang animasi meledak (bukan sekali lalu hilang). */
.sticker-picker-preview.sticker-fx--explode .sticker-fx-emoji {
  animation: sticker-bomb-arm 2.3s ease-in-out infinite;
}

.sticker-picker-preview.sticker-fx--explode::before {
  animation: sticker-bomb-flash 2.3s ease-out infinite;
}

.sticker-picker-preview.sticker-fx--explode::after {
  animation: sticker-bomb-burst 2.3s ease-out infinite;
}

.sticker-fx {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

.sticker-fx img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.sticker-fx-emoji {
  line-height: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Ukuran diatur dari JS (STICKER_SIZE_* × STICKER_EMOJI_SCALE), bukan clamp CSS. */
  font-size: var(--sticker-emoji-size, 3rem);
}

.sticker-fx--bounce .sticker-fx-emoji {
  animation: sticker-bounce 0.55s ease-in-out infinite;
}

.sticker-fx--pulse .sticker-fx-emoji {
  animation: sticker-pulse 0.7s ease-in-out infinite;
}

.sticker-fx--shake .sticker-fx-emoji {
  animation: sticker-shake 0.45s ease-in-out infinite;
}

.sticker-fx--punch .sticker-fx-emoji {
  animation: sticker-punch-hit 0.28s ease-in-out infinite;
}

.sticker-fx--smoke {
  position: relative;
}

.sticker-fx--smoke .sticker-fx-emoji {
  animation: sticker-smoke-idle 2.4s ease-in-out infinite;
}

.sticker-fx--smoke::before,
.sticker-fx--smoke::after {
  content: '💨';
  position: absolute;
  left: 58%;
  top: 8%;
  font-size: calc(var(--sticker-emoji-size, 3rem) * 0.42);
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  filter: blur(0.3px);
}

.sticker-fx--smoke::before {
  animation: sticker-smoke-wisp 1.6s ease-out infinite;
}

.sticker-fx--smoke::after {
  left: 62%;
  top: 12%;
  font-size: calc(var(--sticker-emoji-size, 3rem) * 0.34);
  animation: sticker-smoke-wisp 1.6s ease-out 0.75s infinite;
}

.sticker-fx--wobble .sticker-fx-emoji {
  animation: sticker-wobble 0.8s ease-in-out infinite;
}

.sticker-fx--spin .sticker-fx-emoji {
  animation: sticker-spin 1.4s linear infinite;
}

.sticker-fx--bow .sticker-fx-emoji {
  animation: sticker-bow 1s ease-in-out infinite;
}

.sticker-fx--pop .sticker-fx-emoji {
  animation: sticker-pop 0.65s ease-in-out infinite;
}

.sticker-fx--cheers .sticker-fx-emoji {
  animation: sticker-cheers 0.85s ease-in-out infinite;
}

.sticker-fx--clap .sticker-fx-emoji {
  animation: sticker-clap 0.5s ease-in-out infinite;
}

.sticker-fx--flicker .sticker-fx-emoji {
  animation: sticker-flicker 0.35s ease-in-out infinite;
}

.sticker-fx--explode {
  position: relative;
}

.sticker-fx--explode .sticker-fx-emoji {
  animation: sticker-bomb-arm 2.3s ease-in-out forwards;
}

.sticker-fx--explode::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40%;
  height: 40%;
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 220, 100, 0.98) 0%,
    rgba(255, 120, 30, 0.75) 38%,
    rgba(255, 60, 0, 0.35) 58%,
    transparent 72%
  );
  opacity: 0;
  pointer-events: none;
  animation: sticker-bomb-flash 2.3s ease-out forwards;
}

.sticker-fx--explode::after {
  content: '💥';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: var(--sticker-emoji-size, 3rem);
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 12px rgba(255, 140, 0, 0.85));
  animation: sticker-bomb-burst 2.3s ease-out forwards;
}

.sticker-fx--poop .sticker-fx-emoji {
  animation: sticker-poop 0.55s ease-in-out infinite;
}

.sticker-fx--party .sticker-fx-emoji {
  animation: sticker-party 0.6s ease-in-out infinite;
}

.sticker-fx--peek .sticker-fx-emoji {
  animation: sticker-peek 1s ease-in-out infinite;
}

.sticker-fx--float .sticker-fx-emoji {
  animation: sticker-float 1.2s ease-in-out infinite;
}

@keyframes sticker-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-18%) scale(1.08); }
}

@keyframes sticker-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

@keyframes sticker-shake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-8%) rotate(-8deg); }
  75% { transform: translateX(8%) rotate(8deg); }
}

@keyframes sticker-punch-hit {
  0%, 100% { transform: scale(0.92) translateX(0); }
  35% { transform: scale(1.42) translateX(6%); }
  70% { transform: scale(0.88) translateX(0); }
}

@keyframes sticker-smoke-idle {
  0%, 100% { transform: rotate(-10deg) translateY(0); }
  50% { transform: rotate(-6deg) translateY(-2%); }
}

@keyframes sticker-smoke-wisp {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.45);
  }
  20% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(22%, -62%) scale(1.15);
  }
}

@keyframes sticker-wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(12deg); }
}

@keyframes sticker-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes sticker-bow {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  35% { transform: rotate(14deg) translateY(8%); }
  55% { transform: rotate(14deg) translateY(8%); }
  75% { transform: rotate(0deg) translateY(0); }
}

@keyframes sticker-pop {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.25); }
  60% { transform: scale(0.92); }
}

@keyframes sticker-cheers {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50% { transform: rotate(8deg) translateY(-5%); }
}

@keyframes sticker-clap {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(0.82); }
}

@keyframes sticker-flicker {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.12); }
}

@keyframes sticker-bomb-arm {
  0%, 48% { transform: scale(1) rotate(0deg); opacity: 1; }
  52%, 62% { transform: scale(1.06) rotate(-7deg); opacity: 1; }
  66%, 76% { transform: scale(1.06) rotate(7deg); opacity: 1; }
  80%, 82% { transform: scale(1.12) rotate(0deg); opacity: 1; }
  86% { transform: scale(0.35); opacity: 0; }
  100% { transform: scale(0); opacity: 0; }
}

@keyframes sticker-bomb-burst {
  0%, 78% { opacity: 0; transform: translate(-50%, -50%) scale(0.15); }
  82% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  90% { opacity: 0.9; transform: translate(-50%, -50%) scale(1.75); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.5); filter: blur(4px); }
}

@keyframes sticker-bomb-flash {
  0%, 80% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
  84% { opacity: 1; transform: translate(-50%, -50%) scale(2.8); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(4.2); }
}

@keyframes sticker-poop {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  30% { transform: translateY(-8%) rotate(-8deg) scale(1.06); }
  60% { transform: translateY(-4%) rotate(8deg) scale(0.98); }
}

@keyframes sticker-party {
  0%, 100% { transform: scale(1) rotate(0deg); }
  33% { transform: scale(1.1) rotate(-10deg); }
  66% { transform: scale(1.1) rotate(10deg); }
}

@keyframes sticker-peek {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6%); }
}

@keyframes sticker-float {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(-14%); opacity: 1; }
}

.seat-cekih-badge {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: rgba(240, 193, 75, 0.22);
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.seat-cekih-badge[hidden] {
  display: none !important;
}

.seat-phase-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.seat-phase-badge[hidden] {
  display: none !important;
}

.seat-ready-badge {
  border: 1px solid rgba(74, 222, 128, 0.65);
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.seat-finish-badge {
  border: 1px solid rgba(96, 165, 250, 0.65);
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.seat-info-human {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-cekih-declare {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: rgba(240, 193, 75, 0.12);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn-cekih-declare:hover:not(:disabled) {
  background: rgba(240, 193, 75, 0.28);
  box-shadow: 0 0 12px rgba(240, 193, 75, 0.35);
}

.btn-cekih-declare.is-declared,
.btn-cekih-declare:disabled {
  opacity: 0.85;
  cursor: default;
  background: rgba(240, 193, 75, 0.22);
}

.seat-avatar { font-size: 1.2rem; }

.seat-name {
  font-weight: 700;
  color: var(--gold);
  display: block;
}

.seat-online-dot {
  line-height: 1;
  margin-right: 4px;
}

.seat-online-dot--online {
  color: #22c55e;
}

.seat-online-dot--offline {
  color: #ef4444;
}

.seat-online-dot--away {
  color: #f59e0b;
}

.seat-voice-icons {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 5px;
  vertical-align: middle;
  line-height: 1;
}

.seat-voice-icon {
  font-size: 0.72rem;
  opacity: 0.95;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.45));
}

.seat-voice-icon--channel {
  color: #7dd3fc;
}

.seat-voice-icon--mic {
  color: #fbbf24;
}

/* Banner koneksi server terputus (multiplayer) */
.mp-connection-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10050;
  padding: 10px 14px;
  background: rgba(153, 27, 27, 0.97);
  color: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.mp-connection-banner.hidden {
  display: none;
}

.mp-connection-banner--reconnecting {
  background: rgba(180, 83, 9, 0.97);
}

.mp-connection-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  max-width: 720px;
  margin: 0 auto;
}

.mp-connection-banner__text {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.mp-connection-banner__btn {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 0.85rem;
}

.seat-meta {
  color: var(--muted);
  font-size: 0.68rem;
}

/* Hand + locked: locked di belakang (z-index lebih rendah) */
.seat-cards-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: var(--card-sm-h);
}

.seat-cards-wrap-human {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: max-content;
  max-width: 100%;
  min-height: 0;
}

.seat-cards-wrap-vertical {
  align-items: center;
  min-height: calc(var(--card-sm-h) + 24px);
}

.seat-hand {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: var(--card-sm-h);
}

.seat-hand-opponent-groups {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  max-width: min(360px, 42vw);
}

.seat-hand-opponent-groups--vertical {
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: min(180px, 22vw);
}

.opponent-hand-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 7px;
  border: 1px solid rgba(245, 208, 94, 0.24);
  border-radius: 14px;
  background: rgba(8, 15, 28, 0.36);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.opponent-hand-item {
  display: flex;
  align-items: flex-end;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.opponent-hand-group-cards {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2px;
}

.seat-hand-opponent-groups--vertical .opponent-hand-group-cards {
  justify-content: flex-start;
}

.seat-hand-fan {
  min-height: calc(var(--card-h) + 28px);
  width: max-content;
  max-width: min(640px, 90vw);
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-end;
  padding: 0 4px 4px;
  margin: 0 auto;
}

#human-hand {
  --fan-overlap: -14px;
  --fan-step: 10px;
  position: relative;
  z-index: 30;
}

.seat-hand-vertical {
  flex-direction: column;
  align-items: center;
}

.seat-locked {
  position: absolute;
  z-index: 1;
  display: flex;
  gap: 4px;
  justify-content: center;
  pointer-events: none;
  max-width: min(320px, 90vw);
}

/* Posisi locked di belakang hand per arah kursi */
.seat-top .seat-locked {
  left: 50%;
  bottom: 115px;
  transform: translateX(-50%) translateY(8px) scale(0.92);
  transform-origin: center bottom;
}

.seat-bottom .seat-locked {
  left: 50%;
  right: auto;
  top: 0;
  bottom: auto;
  transform: translateX(-50%);
  transform-origin: center top;
}

/* Human: lock di atas hand — alur normal, tidak absolute menumpuk */
.seat-cards-wrap-human .seat-locked-human {
  position: relative;
  left: auto;
  top: auto;
  bottom: auto;
  transform: none;
  width: 100%;
  max-width: min(640px, 92vw);
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.seat-left .seat-locked {
  top: 50%;
  right: 75px;
  transform: translateY(-50%) translateX(10px) scale(0.9);
  transform-origin: center right;
  flex-direction: column;
  flex-wrap: nowrap;
  max-width: none;
}

.seat-right .seat-locked {
  top: 50%;
  left: 75px;
  transform: translateY(-50%) translateX(-10px) scale(0.9);
  transform-origin: center left;
  flex-direction: column;
  flex-wrap: nowrap;
  max-width: none;
}

.seat-locked-human {
  max-width: min(720px, 92vw);
}

.seat-cards-wrap-human .seat-hand-fan {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}

.seat-locked-human .pickup-staging-drop {
  width: 100%;
  min-width: 100%;
  min-height: 72px;
  height: auto;
  max-height: none;
  margin-bottom: 0;
  padding: 8px 10px;
  overflow: visible;
  box-sizing: border-box;
}

.seat-locked-human .pickup-staging-cards {
  min-height: 40px;
  max-height: none;
  overflow-y: visible;
  flex-wrap: wrap;
}

.seat-locked-human:not(:has(.pickup-staging-drop)) {
  display: none;
  min-height: 0;
  margin: 0;
  padding: 0;
}

/* Combo sudah terkunci — di bawah hand pemain */
.human-locked-combos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  max-width: min(640px, 92vw);
  margin-top: 2px;
  flex-shrink: 0;
  pointer-events: none;
  z-index: 2;
}

.human-locked-combos .locked-combo {
  max-width: 100%;
  flex-shrink: 0;
  pointer-events: none;
}

.human-locked-combos:empty,
.human-locked-combos[hidden] {
  display: none;
}

/* ===== Table center ===== */
.table-center {
  position: absolute;
  top: 37%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: min(980px, 94vw);
  height: min(360px, 48vh);
  pointer-events: none;
}

.table-phase-hint {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translate(-50%, -50%);
  z-index: 12;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font-size: clamp(0.92rem, 2.7vw, 1.1rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  background-image: linear-gradient(
    180deg,
    #fff8dc 0%,
    var(--gold) 42%,
    var(--gold-dark) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 0 10px rgba(240, 193, 75, 0.42))
    drop-shadow(0 2px 6px rgba(0, 0, 0, 0.72));
  animation: tablePhaseHintGlow 2.5s ease-in-out infinite;
}

.table-phase-hint::before,
.table-phase-hint::after {
  content: '';
  flex: 0 0 auto;
  width: clamp(20px, 6vw, 36px);
  height: 1px;
  opacity: 0.85;
}

.table-phase-hint::before {
  background: linear-gradient(90deg, transparent, rgba(240, 193, 75, 0.9));
}

.table-phase-hint::after {
  background: linear-gradient(90deg, rgba(240, 193, 75, 0.9), transparent);
}

.table-phase-hint[hidden] {
  display: none !important;
}

@keyframes tablePhaseHintGlow {
  0%, 100% {
    filter:
      drop-shadow(0 0 7px rgba(240, 193, 75, 0.32))
      drop-shadow(0 2px 5px rgba(0, 0, 0, 0.65));
    opacity: 0.88;
  }
  50% {
    filter:
      drop-shadow(0 0 16px rgba(240, 193, 75, 0.62))
      drop-shadow(0 2px 8px rgba(0, 0, 0, 0.78));
    opacity: 1;
  }
}

.discard-area {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.discard-area-label {
  margin: 0 0 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,.55);
  text-align: center;
  z-index: 2;
}

.discard-ring-host {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.discard-ring-host .card--discard-row[draggable="true"],
.discard-ring-host .card--discard-row.card-draggable {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

.discard-ring-host .card--discard-row .card-rank-tl,
.discard-ring-host .card--discard-row .card-suit-hero,
.discard-ring-host .card--discard-row .card-joker-glyph {
  pointer-events: none;
}

.discard-ring-host .card--discard-row.card-dragging {
  cursor: grabbing;
  opacity: 0.65;
}

/* Discard — desktop 12 kartu/baris; mobile dibatasi via JS menjadi 10 */
.discard-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 6px 20px 4px;
}

.discard-row {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: nowrap;
  max-width: 100%;
}

.discard-row--wrap {
  margin-top: 2px;
}

.discard-row-slot {
  flex-shrink: 0;
  position: relative;
  transition: margin 0.25s ease;
}

.discard-row-slot--last .card {
  box-shadow:
    0 0 0 3px var(--gold),
    0 10px 26px rgba(0,0,0,.5);
}

.card--discard-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 6px 6px 10px;
  width: var(--card-discard-w);
  height: var(--card-discard-h);
  overflow: hidden;
}

.card--discard-row .card-rank-tl {
  align-self: flex-start;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  margin-left: 2px;
}

.card--discard-row .card-suit-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  width: 100%;
  text-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.card-red .card-suit-hero { color: #dc2626; }
.card-black .card-suit-hero { color: #1e293b; }

.deck-pile-center {
  position: absolute;
  left: 40%;
  top: 72%;
  transform: translate(-50%, -50%);
  z-index: 800;
  pointer-events: none;
}

.mobile-pickup-toggle {
  display: none;
  position: absolute;
  left: 8%;
  top: 72%;
  transform: translateY(-50%);
  z-index: 805;
  min-width: 104px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(240, 193, 75, 0.4);
  border-radius: 12px;
  background: rgba(5, 18, 34, 0.78);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-align: center;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.mobile-pickup-toggle[hidden] {
  display: none !important;
}

.mobile-pickup-toggle.is-open {
  background: rgba(240, 193, 75, 0.16);
  border-color: rgba(240, 193, 75, 0.72);
  box-shadow:
    0 0 0 2px rgba(240, 193, 75, 0.16),
    0 10px 24px rgba(0, 0, 0, 0.28);
}

.mobile-pickup-close {
  display: none;
  position: absolute;
  top: -10px;
  left: -6px;
  /* Di atas .pickup-zone-center (z-index 45) dan frame lock zone emas */
  z-index: 120;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.mobile-pickup-close[hidden] {
  display: none !important;
}

.deck-pile-center.deck-pile--empty .card-back {
  opacity: 0.35;
  filter: grayscale(0.85);
}

.deck-pile-center.deck-pile--empty .pile-count {
  color: rgba(255, 255, 255, 0.55);
}

.deck-pile-center.deck-pile--clickable {
  pointer-events: auto;
  cursor: pointer;
}

.deck-pile-center.deck-pile--clickable::before,
.deck-pile-center.deck-pile--clickable::after {
  content: '';
  position: absolute;
  border-radius: 12px;
  pointer-events: none;
}

.deck-pile-center.deck-pile--clickable::before {
  inset: -6px;
  border: none;
  box-shadow:
    0 0 18px rgba(250, 214, 106, 0.62),
    0 0 36px rgba(245, 158, 11, 0.42),
    0 0 58px rgba(250, 214, 106, 0.28);
  animation: deckTurnGlowPulse 0.95s ease-in-out infinite;
}

.deck-pile-center.deck-pile--clickable::after {
  inset: -12px;
  background: radial-gradient(circle, rgba(250, 214, 106, 0.34) 0%, rgba(245, 158, 11, 0.14) 52%, transparent 78%);
  filter: blur(4px);
  animation: deckTurnHaloPulse 1.05s ease-in-out infinite;
}

.deck-pile-center.deck-pile--clickable:hover .card-back {
  transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(0,0,0,.55);
}

.deck-pile-center.deck-pile-drawing .card-back {
  animation: deckDrawPulse 0.5s ease infinite;
}

@keyframes deckDrawPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.03); }
}

@keyframes deckTurnGlowPulse {
  0%, 100% { opacity: 0.72; box-shadow: 0 0 16px rgba(250, 214, 106, 0.5), 0 0 30px rgba(245, 158, 11, 0.28); }
  50% { opacity: 1; box-shadow: 0 0 36px rgba(250, 214, 106, 0.92), 0 0 54px rgba(245, 158, 11, 0.58), 0 0 72px rgba(250, 214, 106, 0.3); }
}

@keyframes deckTurnHaloPulse {
  0%, 100% { opacity: 0.56; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.card-draw-from-deck {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

body.card-drag-from-hand .table-discard-drop.is-active {
  border-color: rgba(255, 255, 255, 0.18);
}

body.card-drag-from-hand .table-discard-drop.is-active::before {
  content: "Lepaskan untuk buang";
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(240, 193, 75, 0.75);
  pointer-events: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

body.deck-draw-animating .deck-pile--clickable,
body.discard-animating .seat-hand-fan .card-draggable {
  pointer-events: none;
}

body.deck-draw-animating #human-hand,
body.deck-draw-animating #human-hand .card-fan-item {
  pointer-events: none !important;
  touch-action: none;
  cursor: default;
}

.deck-pile-center.deck-pile--clickable:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 12px;
}

.pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pile-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,.5);
}

.pile-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--gold);
  color: #111;
  font-size: 0.7rem;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}

.deck-pile {
  position: relative;
  cursor: default;
}

.turn-indicator {
  position: absolute;
  inset: 0;
  border-radius: 50% / 42%;
  border: 3px solid var(--gold);
  pointer-events: none;
  animation: turnPulse 1.5s ease infinite;
  z-index: 1;
}

/* ===== Cards ===== */
.card {
  width: var(--card-w);
  height: var(--card-h);
  border: 2px solid #fff;
  border-radius: 8px;
  background: linear-gradient(160deg, #fff 0%, #e8ecf0 100%);
  color: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.45);
  transition: transform 0.2s cubic-bezier(0.34, 1.3, 0.64, 1), box-shadow 0.2s;
  padding: 4px;
  flex-shrink: 0;
  position: relative;
  user-select: none;
}

.card-sm {
  width: var(--card-sm-w);
  height: var(--card-sm-h);
  font-size: 0.7rem;
  border-radius: 6px;
}

.card-back {
  background: repeating-linear-gradient(
    45deg,
    #1a3a6e,
    #1a3a6e 8px,
    #224b8a 8px,
    #224b8a 16px
  );
  border-color: #fff;
  cursor: default;
}

.card-back::after {
  content: "♠";
  font-size: 1.4rem;
  color: rgba(255,255,255,.25);
}

.card-back-lg {
  width: var(--card-w);
  height: var(--card-h);
}

.card-back-sm {
  width: var(--card-sm-w);
  height: var(--card-sm-h);
}

.card-fan-item {
  margin-left: var(--fan-overlap, -14px);
  --fan-x: 0px;
  --fan-rot: 0deg;
  transform: translateX(var(--fan-x)) rotate(var(--fan-rot));
  transition: transform 0.25s cubic-bezier(0.34, 1.3, 0.64, 1), margin 0.25s, box-shadow 0.2s;
  position: relative;
  touch-action: manipulation;
}

.card-fan-item:first-child { margin-left: 0; }

.card-fan-item.card-draggable {
  cursor: grab;
  touch-action: none;
}

.card-fan-item .card-rank,
.card-fan-item .card-suit,
.card-fan-item .card-joker-glyph {
  pointer-events: none;
}

.card-hand-drag-ghost {
  position: fixed;
  z-index: 25000;
  pointer-events: none;
  margin: 0 !important;
  transform: translate(-50%, -50%) scale(1.08) rotate(var(--fan-rot, 0deg)) !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6);
  opacity: 1;
}

body.hand-card-dragging #pickup-zone-toolbar:not([hidden]) {
  position: relative;
  z-index: 20000;
}

body.hand-card-dragging #human-hand {
  z-index: 5;
}

.card-fan-item.card-draggable:active {
  cursor: grabbing;
}

.card-fan-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.card-fan-item.card-dragging {
  z-index: 24000 !important;
  opacity: 0.2;
  cursor: grabbing;
}

.seat-hand-fan.hand-drag-over {
  outline: 2px dashed rgba(240, 193, 75, 0.45);
  outline-offset: 6px;
  border-radius: 12px;
}

/* Petunjuk slot saat menggeser kartu di hand */
.card-fan-item.hand-drop-before::before,
.card-fan-item.hand-drop-after::after {
  content: '';
  position: absolute;
  top: -10px;
  bottom: -6px;
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffe9a8, var(--gold));
  box-shadow: 0 0 14px rgba(240, 193, 75, 0.85);
  z-index: 200;
  pointer-events: none;
}

.card-fan-item.hand-drop-before::before {
  left: -3px;
}

.card-fan-item.hand-drop-after::after {
  right: -3px;
}

.card-fan-item.card-dragging {
  transition: opacity 0.15s ease;
}

.card-fan-item:hover {
  transform: translateX(var(--fan-x)) translateY(-16px) rotate(var(--fan-rot)) scale(1.05) !important;
  z-index: 50 !important;
  margin-left: -6px;
  margin-right: 6px;
}

.card-fan-item.card-selected {
  transform: translateX(var(--fan-x)) translateY(-18px) rotate(var(--fan-rot)) scale(1.04) !important;
  z-index: 45 !important;
}

.card:hover:not(.card-disabled):not(.card-back) {
  transform: translateY(-10px);
  box-shadow: 0 12px 28px rgba(0,0,0,.55);
}

.card-selected {
  outline: 3px solid var(--gold);
  box-shadow: 0 14px 32px rgba(240, 193, 75, 0.4);
  z-index: 15;
}

.card-fan-item.card-selected {
  outline: 3px solid var(--gold);
  box-shadow: 0 14px 32px rgba(240, 193, 75, 0.4);
}

.card-disabled, .card-back {
  cursor: default;
}

.card-red { color: #dc2626; }
.card-black { color: #1e293b; }

.card-joker {
  background: linear-gradient(145deg, #581c87, #9333ea);
  color: #fff;
  border-color: #c084fc;
  padding: 3px;
  overflow: hidden;
}

.card-joker .card-joker-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  font-size: calc(min(var(--card-w), var(--card-h)) * 0.78);
}

.card-sm.card-joker .card-joker-glyph {
  font-size: calc(min(var(--card-sm-w), var(--card-sm-h)) * 0.78);
}

.card--discard-row.card-joker .card-joker-glyph {
  font-size: calc(min(var(--card-discard-w), var(--card-discard-h)) * 0.78);
}

.card-rank { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.card-suit { font-size: 3rem; line-height: 1; font-weight: 700; }

.card--discard .card-rank { font-size: 1.5rem; }
.card--discard .card-suit { font-size: 2.2rem; }

.card-sm .card-rank { font-size: 1.05rem; }
.card-sm .card-suit { font-size: 1.35rem; }

.card-count-badge {
  position: absolute;
  bottom: -10px;
  right: -6px;
  background: var(--gold);
  color: #111;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.locked-combo {
  background: rgba(0,0,0,.4);
  border: 1px dashed rgba(46, 204, 113, 0.55);
  border-radius: 8px;
  padding: 3px 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  opacity: 0.92;
}

.locked-combo-ghost {
  border: 2px solid var(--gold);
  box-shadow: 0 0 20px rgba(240, 193, 75, 0.45);
  animation: lockedGhostPulse 1.2s ease infinite;
  min-width: 120px;
}

.locked-combo-ghost-label {
  color: var(--gold) !important;
}

.locked-cards-ghost {
  display: flex;
  gap: 3px;
  justify-content: center;
  min-height: var(--card-sm-h);
  padding: 4px 2px;
}

.locked-ghost-slot {
  flex-shrink: 0;
}

@keyframes lockedGhostPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(240, 193, 75, 0.35); }
  50% { box-shadow: 0 0 28px rgba(240, 193, 75, 0.65); }
}

/* Pickup discard animation highlights */
.card-pickup-from-hand {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 18px rgba(240, 193, 75, 0.65) !important;
  animation: pickupHandPulse 0.7s ease infinite;
  z-index: 60 !important;
}

.card-pickup-to-lock {
  outline: 3px solid #22c55e;
  outline-offset: 2px;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.7) !important;
  animation: pickupLockPulse 0.65s ease infinite;
  z-index: 55 !important;
}

.card-pickup-to-hand {
  outline: 3px solid #38bdf8;
  outline-offset: 2px;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.55) !important;
  animation: pickupHandInPulse 0.8s ease infinite;
  z-index: 50 !important;
}

.card-pickup-source-hidden {
  opacity: 0.15 !important;
  pointer-events: none;
}

.card-flying {
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
  transform: none !important;
  margin: 0 !important;
  flex-shrink: 0;
  overflow: hidden;
}

body.pickup-animating .player-pickup-dock,
body.pickup-animating .seat-hand-fan .card-draggable,
body.bot-turn-active .player-pickup-dock,
body.bot-turn-active .seat-hand-fan .card-draggable {
  pointer-events: none;
}

.card-pickup-hand-pulse {
  outline: 2px dashed rgba(240, 193, 75, 0.5);
  outline-offset: 4px;
  border-radius: 10px;
  animation: pickupHandPulse 0.7s ease infinite;
}

.pickup-fly-temp {
  box-shadow: 0 10px 28px rgba(0,0,0,.5);
}

.discard-fly-target-ghost {
  width: var(--card-discard-w);
  height: var(--card-discard-h);
  flex-shrink: 0;
  pointer-events: none;
  visibility: hidden;
}

.card-flying-discard {
  transform: none !important;
  margin: 0 !important;
}

.discard-pile-receiving .discard-stack,
#discard-pile.discard-pile-receiving:empty {
  outline: 2px dashed rgba(240, 193, 75, 0.45);
  outline-offset: 6px;
  border-radius: 12px;
  animation: pickupHandPulse 0.7s ease infinite;
}

@keyframes pickupHandPulse {
  0%, 100% { transform: translateX(var(--fan-x)) translateY(-6px) rotate(var(--fan-rot)) scale(1.03); }
  50% { transform: translateX(var(--fan-x)) translateY(-12px) rotate(var(--fan-rot)) scale(1.06); }
}

@keyframes pickupLockPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}

@keyframes pickupHandInPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

.locked-type {
  display: block;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--felt-glow);
  margin-bottom: 2px;
}

.locked-cards {
  display: flex;
  gap: 2px;
}

.btn {
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
}

.btn:active { transform: scale(0.96); }

.btn-action {
  width: 100%;
  padding: 9px 10px;
  margin-bottom: 0;
  font-size: 0.8rem;
}

.btn-gold {
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  color: #111;
  padding: 8px 16px;
  box-shadow: 0 4px 12px rgba(240, 193, 75, 0.35);
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: #475569; color: #fff; }
.btn-warn { background: var(--danger); color: #fff; }
.btn-ghost {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.2);
  color: var(--text);
}

.btn-icon { margin-right: 4px; }

.icon-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}

.btn-fullscreen.is-active {
  background: rgba(46, 204, 113, 0.18);
  border-color: rgba(46, 204, 113, 0.45);
  color: #d1fae5;
}

.select-dark {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.4);
  color: var(--text);
  font-size: 0.78rem;
}

/* ===== Modal & overlays ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.is-open {
  display: flex;
}

.modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 20px;
  width: min(360px, 90vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h2 { margin: 0; font-size: 1.1rem; color: var(--gold); }

body.bot-locked-popover-open {
  overflow: hidden;
}

.bot-locked-popover-panel {
  width: min(420px, 92vw);
  max-height: min(78vh, 640px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bot-locked-popover-header {
  margin-bottom: 0;
}

.bot-locked-popover-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.bot-locked-popover-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.bot-locked-popover-list .locked-combo {
  margin: 0;
}

.bot-locked-popover-empty {
  padding: 10px 2px 2px;
  text-align: center;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
}

.setting-row p {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.toggle {
  width: 44px;
  height: 24px;
  accent-color: var(--felt-glow);
  cursor: pointer;
}

/* Toggle switch styling via checkbox */
input.toggle {
  appearance: none;
  background: #475569;
  border-radius: 999px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

input.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

input.toggle:checked {
  background: var(--felt-glow);
}

input.toggle:checked::after {
  transform: translateX(20px);
}

.toast {
  position: fixed;
  top: max(72px, calc(env(safe-area-inset-top) + 56px));
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.85);
  border: 1px solid var(--gold);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.85rem;
  z-index: 200;
  animation: slideToast 0.35s ease both;
  max-width: 90vw;
  text-align: center;
}

.cekih-prompt {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: auto;
}

.tutup-prompt {
  z-index: 300;
}

.cekih-prompt[hidden] {
  display: none !important;
}

.cekih-prompt-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}

.cekih-prompt-card {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  width: min(100%, 380px);
  padding: 28px 28px 24px;
  text-align: center;
  background: linear-gradient(165deg, rgba(24, 14, 10, 0.98), rgba(8, 4, 2, 0.99));
  border: 2px solid var(--gold);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 36px rgba(240, 193, 75, 0.2);
}

.cekih-prompt-badge {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(240, 193, 75, 0.45);
}

.cekih-prompt-title {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.cekih-prompt-body {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.cekih-prompt-need {
  margin: 0 0 22px;
  font-size: 1rem;
  font-weight: 700;
  color: #f5d98a;
}

.cekih-prompt-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.cekih-prompt-actions .btn {
  min-width: 128px;
}

body.cekih-prompt-open .table-wrap {
  pointer-events: none;
}

body.tutup-prompt-open .table-wrap {
  pointer-events: none;
}

.tutup-prompt-card {
  background: linear-gradient(165deg, rgba(20, 12, 4, 0.98), rgba(8, 5, 1, 0.99));
}

/* Saat prompt tutup terbuka, header tetap di atas overlay agar tombol Mundur bisa dipakai. */
body.tutup-prompt-open .room-header {
  position: relative;
  z-index: 260;
}

.cekih-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 250;
  min-width: 220px;
  padding: 28px 36px 24px;
  text-align: center;
  background: linear-gradient(165deg, rgba(20, 12, 8, 0.96), rgba(8, 4, 2, 0.98));
  border: 2px solid var(--gold);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65), 0 0 40px rgba(240, 193, 75, 0.25);
  animation: cekihPopIn 0.4s cubic-bezier(0.34, 1.4, 0.64, 1) both;
  pointer-events: none;
}

.cekih-popup[hidden] {
  display: none !important;
}

.cekih-popup-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1.45;
}

.cekih-popup-name:only-child,
.cekih-popup:has(#cekih-popup-title[hidden]) .cekih-popup-name {
  font-size: 1.35rem;
  padding: 4px 0 2px;
}

.cekih-popup-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(240, 193, 75, 0.45);
}

@keyframes cekihPopIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.82);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.greedy-penalty-modal {
  position: fixed;
  inset: 0;
  z-index: 280;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.greedy-penalty-modal[hidden] {
  display: none !important;
}

.greedy-penalty-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.greedy-penalty-card {
  position: relative;
  z-index: 1;
  width: min(420px, 94vw);
  padding: 24px 22px 20px;
  text-align: center;
  background: linear-gradient(165deg, rgba(28, 10, 10, 0.97), rgba(10, 4, 4, 0.99));
  border: 2px solid #e85d5d;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65), 0 0 36px rgba(232, 93, 93, 0.28);
}

.greedy-penalty-badge {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ff8a80;
}

.greedy-penalty-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  color: var(--gold);
}

.greedy-penalty-sub {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.75));
}

.greedy-penalty-stage {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 72px;
  margin-bottom: 12px;
}

.greedy-penalty-stage .greedy-anim-card {
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  opacity: 0.55;
}

.greedy-penalty-stage .greedy-anim-card.is-pick-flash {
  opacity: 1;
  transform: scale(1.08) translateY(-6px);
  box-shadow: 0 0 18px rgba(255, 120, 80, 0.65);
}

.greedy-penalty-result {
  margin: 0 0 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

.greedy-penalty-result .greedy-burn-line {
  display: block;
  margin: 4px 0;
}

.greedy-penalty-result .greedy-total {
  margin-top: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: #ff8a80;
}

body.greedy-penalty-active .table-wrap {
  pointer-events: none;
}

body.hand-trim-active .pickup-zone-row {
  box-shadow: 0 0 0 2px rgba(240, 193, 75, 0.35);
}

.log-toggle {
  position: fixed;
  bottom: 24px;
  right: 240px;
  background: var(--panel-glass);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  backdrop-filter: blur(8px);
  z-index: 50;
}

.log-drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(320px, 90vw);
  background: var(--panel-glass);
  border-left: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(12px);
  z-index: 90;
  display: none;
  flex-direction: column;
}

.log-drawer:not([hidden]) {
  display: flex;
  animation: modalIn 0.3s ease;
}

.log-drawer[hidden] {
  display: none !important;
}

.log-drawer header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.log-drawer h3 { margin: 0; font-size: 0.9rem; color: var(--gold); }

.log-table-status {
  flex-shrink: 0;
  max-height: 42vh;
  overflow-y: auto;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.2);
}

.log-discard-status {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.log-players-status {
  padding: 10px 16px 12px;
}

.log-panel-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: 6px;
}

.log-panel-text {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}

.log-players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-player-row {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  font-size: 0.72rem;
  line-height: 1.4;
}

.log-player-row--active {
  border-color: rgba(240, 193, 75, 0.45);
  background: rgba(240, 193, 75, 0.08);
}

.log-player-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.log-player-head strong {
  color: var(--text);
  font-size: 0.78rem;
}

.log-player-turn {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
}

.log-player-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.68rem;
}

.log-player-k {
  color: var(--muted);
  font-size: 0.65rem;
  text-transform: uppercase;
  margin-right: 4px;
}

.log-player-hand,
.log-player-locked {
  word-break: break-word;
  color: #d4e4f8;
}

.log-player-locked {
  margin-top: 2px;
  color: #b8e6c8;
}

.log-player-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.65rem;
}

.game-log {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  font-size: 0.75rem;
}

.log-line {
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: var(--muted);
}

.log-line:first-child { color: var(--text); }

.log-line-discard {
  color: #a8d4f0;
  font-size: 0.72rem;
}

.log-line-players {
  color: #c5d9b8;
  font-size: 0.7rem;
}

.log-toggle-debug {
  bottom: 168px;
  background: rgba(59, 130, 246, 0.35);
  border-color: rgba(59, 130, 246, 0.5);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.75rem;
}

.endgame-action-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 220;
  display: flex;
  justify-content: center;
  pointer-events: auto;
}

.endgame-action-bar[hidden] {
  display: none !important;
}

.btn-endgame-finish {
  min-width: 200px;
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.endgame-lock-drop {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 100%;
  min-height: 72px;
  height: auto;
  max-height: none;
  box-sizing: border-box;
}

.endgame-lock-drop .pickup-staging-cards {
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  max-height: none;
}

.endgame-lock-drop .pickup-staging-placeholder--lock-zone {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0 4px;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.28);
  text-transform: none;
}

.endgame-lock-drop .endgame-lock-zone-hint {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 236, 190, 0.72);
  letter-spacing: 0.01em;
  padding: 6px 8px;
}

.endgame-lock-drop > .pickup-staging-placeholder--lock-zone {
  flex-shrink: 0;
  padding-top: 2px;
  padding-bottom: 1px;
}

body.endgame-lock-active .endgame-lock-drop {
  border-color: rgba(240, 193, 75, 0.85);
  box-shadow:
    0 0 0 2px rgba(240, 193, 75, 0.35),
    inset 0 0 24px rgba(240, 193, 75, 0.08);
  animation: endgameLockPulse 1.6s ease-in-out infinite;
}

body.hand-trim-active .endgame-lock-drop {
  border-color: rgba(240, 193, 75, 0.85);
  box-shadow:
    0 0 0 2px rgba(240, 193, 75, 0.35),
    inset 0 0 24px rgba(240, 193, 75, 0.08);
}

@keyframes endgameLockPulse {
  0%, 100% { border-color: rgba(240, 193, 75, 0.55); }
  50% { border-color: rgba(240, 193, 75, 0.95); }
}

.pickup-zone-row--endgame {
  pointer-events: auto;
}

.human-locked-combos--endgame {
  pointer-events: none;
}

.endgame-lock-drop .endgame-staging-card {
  cursor: pointer;
}

.endgame-lock-drop .endgame-staging-card:hover .card {
  outline: 2px solid rgba(239, 68, 68, 0.65);
  outline-offset: 1px;
}

.endgame-lock-drop .endgame-staging-undo {
  width: 24px;
  height: 24px;
  top: -8px;
  right: -8px;
  font-size: 16px;
  font-weight: 700;
}

.endgame-lock-bar-hint {
  margin: 0 0 14px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}

.endgame-lock-bar-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

body.endgame-lock-active .table-wrap {
  padding-bottom: 120px;
}

/* Endgame — panel skor akhir (#endgame-panel.endgame-overlay) */
.endgame-overlay {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  box-sizing: border-box;
  pointer-events: none;
}

.endgame-overlay[hidden] {
  display: none !important;
}

.endgame-overlay:not([hidden]) {
  pointer-events: auto;
}

.endgame-overlay .endgame-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.endgame-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(440px, 100%);
  max-height: min(88vh, 88dvh);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 28px 24px 22px;
  text-align: center;
  border-radius: 20px;
  border: 2px solid rgba(240, 193, 75, 0.85);
  background: linear-gradient(180deg, rgba(9, 20, 33, 0.98), rgba(10, 34, 27, 0.96));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72);
  pointer-events: auto;
}

.endgame-overlay.is-open:not([hidden]) .endgame-card.anim-modal-in {
  animation: modalIn 0.35s ease both;
}

.endgame-card h2 {
  margin: 0;
  padding-right: 28px;
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  line-height: 1.25;
  color: var(--gold);
}

.endgame-dismiss-x {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

#endgame-scores {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  text-align: left;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#endgame-scores .score-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  line-height: 1.35;
}

#endgame-scores .score-row:last-child {
  border-bottom: none;
}

#endgame-scores .score-row > span:last-child {
  text-align: right;
  flex: 1 1 55%;
  min-width: 0;
}

#endgame-scores .score-row-winner {
  color: var(--gold);
  font-weight: 800;
}

.endgame-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}

.endgame-actions .btn {
  flex: 1 1 calc(33.333% - 8px);
  min-width: min(120px, 100%);
}

.endgame-reopen {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 225;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: min(280px, calc(100vw - 32px));
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  color: #111;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(240, 193, 75, 0.35);
  animation: endgameReopenPulse 2s ease-in-out infinite;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.endgame-reopen:hover {
  filter: brightness(1.12);
  transform: translateX(-50%) scale(1.03);
}

.endgame-reopen:active {
  transform: translateX(-50%) scale(0.98);
}

.endgame-reopen:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.endgame-reopen[hidden] {
  display: none !important;
  animation: none;
}

@keyframes endgameReopenPulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(240, 193, 75, 0.35);
  }
  50% {
    box-shadow: 0 6px 20px rgba(240, 193, 75, 0.55);
  }
}

.muted { color: var(--muted); font-size: 0.85rem; }

.btn-scoresheet[hidden] {
  display: none !important;
}

.scoresheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 165;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  box-sizing: border-box;
  pointer-events: none;
}

.scoresheet-overlay[hidden] {
  display: none !important;
}

.scoresheet-overlay:not([hidden]) {
  pointer-events: auto;
}

.scoresheet-overlay .endgame-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.scoresheet-card {
  position: relative;
  z-index: 1;
  width: min(920px, 96vw);
  max-height: min(92vh, 92dvh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 24px 20px;
  border-radius: 20px;
  border: 2px solid rgba(240, 193, 75, 0.75);
  background: linear-gradient(180deg, rgba(9, 20, 33, 0.98), rgba(10, 34, 27, 0.96));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72);
  pointer-events: auto;
  min-height: 0;
}

.scoresheet-head,
.scoresheet-replay-bar,
.scoresheet-summary,
.scoresheet-card > .endgame-actions {
  flex-shrink: 0;
}

.scoresheet-head {
  text-align: center;
}

.scoresheet-head h2 {
  margin: 0;
  color: var(--gold);
}

.scoresheet-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.scoresheet-replay-bar {
  margin: 0 auto;
}

.btn-match-replay {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: #1a252f;
  background: linear-gradient(180deg, #f7dc6f 0%, #f0b429 100%);
  box-shadow: 0 4px 14px rgba(211, 84, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-match-replay:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(211, 84, 0, 0.32);
}

.btn-match-replay:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-match-replay.is-running {
  opacity: 0.85;
  cursor: wait;
}

.match-replay-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.match-replay-status {
  min-height: 1.2em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.scoresheet-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.scoresheet-summary-card {
  padding: 12px 10px;
  border-radius: 14px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.scoresheet-summary-card--high {
  border-color: rgba(46, 204, 113, 0.35);
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.14), rgba(46, 204, 113, 0.05));
}

.scoresheet-summary-card--low {
  border-color: rgba(231, 76, 60, 0.35);
  background: linear-gradient(180deg, rgba(231, 76, 60, 0.14), rgba(231, 76, 60, 0.05));
}

.scoresheet-summary-name {
  display: block;
  font-weight: 800;
  color: #e2e8f0;
}

.scoresheet-summary-score {
  display: block;
  margin-top: 4px;
  font-size: 1.7rem;
  font-weight: 900;
  color: #fff;
}

.player-rank {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 2px;
}

.scoresheet-turns {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(42vh, 360px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 14px 14px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
}

.scoresheet-turn-empty {
  color: var(--muted);
  text-align: center;
  padding: 18px 8px;
}

.scoresheet-turn-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.45;
}

.scoresheet-turn-title {
  font-weight: 800;
  color: var(--gold);
}

.scoresheet-turn-line {
  margin-top: 4px;
  color: #e2e8f0;
  font-size: 0.9rem;
}

.scoresheet-turn-line .rank-green {
  color: #4ade80;
  font-weight: 700;
}

.scoresheet-turn-line .rank-red,
.scoresheet-turn-line .red {
  color: #f87171;
  font-weight: 700;
}

.scoresheet-turn-note {
  margin-top: 6px;
  color: #fca5a5;
  font-weight: 700;
}

/* Scoreboard overlay — full screen */
.scoreboard-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 10001;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  pointer-events: none;
  box-sizing: border-box;
  background: linear-gradient(
    180deg,
    rgba(0, 30, 60, 0.97) 0%,
    rgba(0, 0, 0, 0.98) 45%,
    rgba(0, 20, 50, 0.97) 100%
  );
  animation: fireBlastFadeIn 0.2s ease-out forwards;
}

.scoreboard-overlay.hidden {
  display: none;
}

.scoreboard-panel {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  animation: fxContentPop 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.scoreboard-title {
  display: none;
}

.scoreboard-rows {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  flex: 1;
  width: 100%;
  min-height: 0;
  gap: 0;
  padding: clamp(8px, 2vmin, 16px) 0;
  box-sizing: border-box;
}

.scoreboard-player {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(2px, 1vmin, 8px);
  padding: clamp(4px, 1.5vmin, 12px) clamp(12px, 4vw, 24px);
  box-sizing: border-box;
}

.sb-name {
  margin: 0;
  padding: 0;
  font-weight: 800;
  font-size: clamp(1.1rem, 5.5vmin, 1.65rem);
  line-height: 1.1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b3e5fc;
  text-shadow:
    0 2px 12px rgba(0, 0, 0, 0.9),
    0 0 24px rgba(79, 195, 247, 0.55),
    0 0 40px rgba(41, 182, 246, 0.25);
}

.sb-score {
  margin: 0;
  padding: 0;
  display: block;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  font-size: clamp(2.8rem, 14vmin, 5rem);
  color: #ffffff;
  letter-spacing: -0.02em;
  text-shadow:
    0 4px 16px rgba(0, 0, 0, 0.95),
    0 0 32px rgba(255, 255, 255, 0.35),
    0 0 48px rgba(100, 181, 246, 0.2);
  transition: transform 0.06s ease, color 0.12s ease, text-shadow 0.12s ease;
}

.sb-score.sb-up {
  color: #b9f6ca;
  text-shadow:
    0 4px 16px rgba(0, 0, 0, 0.9),
    0 0 28px rgba(105, 240, 174, 0.85),
    0 0 56px rgba(0, 230, 118, 0.45);
}

.sb-score.sb-down {
  color: #ffab91;
  text-shadow:
    0 4px 16px rgba(0, 0, 0, 0.9),
    0 0 28px rgba(255, 138, 128, 0.85),
    0 0 56px rgba(255, 87, 34, 0.4);
}

/* Full-screen FX overlays */
.fx-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(255, 80, 0, 0.35) 0%, rgba(120, 0, 0, 0.85) 55%, rgba(0, 0, 0, 0.92) 100%);
  animation: fireBlastFadeIn 0.25s ease-out forwards;
}

.fx-overlay.hidden {
  display: none;
}

.fx-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.fx-bolts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.fx-extra {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.fx-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  animation: fxContentPop 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.fx-content .fx-extra {
  position: relative;
  bottom: auto;
  inset: auto;
  height: auto;
  width: 100%;
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.fx-line {
  margin: 0;
  line-height: 1.15;
}

.fx-line + .fx-line {
  margin-top: 10px;
}

.fx-kaduruk,
.fx-modar {
  background: radial-gradient(circle at center, rgba(255, 80, 0, 0.35) 0%, rgba(120, 0, 0, 0.85) 55%, rgba(0, 0, 0, 0.92) 100%);
}

.fx-kaduruk .fx-bg::before,
.fx-modar .fx-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 220, 100, 0.7) 0%, transparent 55%);
  animation: fxFlashOnce 0.55s ease-out forwards;
}

.fx-modar .fx-line {
  color: #ff1744;
  font-size: clamp(2.5rem, 12vw, 5rem);
  font-weight: 900;
  text-shadow:
    0 3px 8px rgba(0, 0, 0, 0.95),
    0 0 24px #ff1744,
    0 0 48px #ff5722,
    0 0 72px rgba(255, 23, 68, 0.85),
    3px 3px 0 #4a0000,
    -1px -1px 0 rgba(0, 0, 0, 0.8);
  animation: fxPulse 0.35s ease-in-out infinite alternate;
}

.fx-kaduruk .fx-line {
  color: #fff;
  font-size: clamp(2.5rem, 12vw, 5rem);
  font-weight: 900;
  text-shadow: 0 0 10px #ff5722, 0 0 30px #ff9800, 0 0 50px #ff5722;
  animation: fxPulse 0.4s ease-in-out infinite alternate;
}

.fx-kaduruk .fx-flames {
  margin-bottom: 0;
}

.fx-flames {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  height: 80px;
  align-items: flex-end;
}

.fx-flames span {
  display: block;
  width: 18px;
  border-radius: 50% 50% 20% 20%;
  background: linear-gradient(to top, #b71c1c, #ff5722 40%, #ffeb3b 85%, transparent);
  animation: fxFlame 0.35s ease-in-out infinite alternate;
}

.fx-flames span:nth-child(odd) { height: 55px; }
.fx-flames span:nth-child(even) { height: 70px; }

.fx-jackpot250,
.fx-nutup {
  background: radial-gradient(circle at center, rgba(0, 255, 140, 0.3) 0%, rgba(0, 50, 35, 0.92) 55%, #000 100%);
}

.fx-jackpot250 .fx-bg::before,
.fx-nutup .fx-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 0%, rgba(0, 230, 118, 0.35), transparent 45%),
    radial-gradient(circle at 70% 100%, rgba(118, 255, 3, 0.25), transparent 40%);
  animation: fxJokerPulse 0.7s ease-in-out infinite alternate;
}

.fx-jackpot250 .fx-line,
.fx-nutup .fx-line {
  color: #00e676;
  font-size: clamp(3rem, 14vw, 6rem);
  font-weight: 900;
  text-shadow:
    0 3px 10px rgba(0, 0, 0, 0.95),
    0 0 28px #00e676,
    0 0 56px #00e676,
    0 0 80px rgba(0, 230, 118, 0.75),
    2px 2px 0 #004d25,
    -2px 2px 0 #004d25;
}

.fx-nutup .fx-line:nth-child(2) {
  font-size: clamp(2.2rem, 11vw, 4.5rem);
  letter-spacing: 0.06em;
}

.bolt {
  position: absolute;
  width: 8px;
  background: linear-gradient(to bottom, transparent, currentColor 40%, #fff 70%, currentColor);
  opacity: 0;
  transform-origin: top center;
}

.bolt-green { color: #00e676; filter: drop-shadow(0 0 14px #00e676); }
.bolt-lime { color: #76ff03; filter: drop-shadow(0 0 14px #76ff03); }
.bolt-mint { color: #69f0ae; filter: drop-shadow(0 0 12px #69f0ae); }

.fx-jackpot500 {
  background: radial-gradient(ellipse at center, #1a0033 0%, #0d001a 45%, #000 100%);
  animation: fxJokerBgFestive 0.1s steps(2) infinite;
}

.fx-jackpot500 .fx-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(255, 23, 68, 0.55), transparent),
    radial-gradient(ellipse 70% 35% at 20% 0%, rgba(124, 77, 255, 0.45), transparent),
    radial-gradient(ellipse 70% 35% at 80% 0%, rgba(255, 109, 0, 0.4), transparent),
    radial-gradient(ellipse 80% 40% at 50% 100%, rgba(224, 64, 251, 0.5), transparent),
    radial-gradient(ellipse 60% 30% at 15% 100%, rgba(255, 215, 0, 0.4), transparent),
    radial-gradient(ellipse 60% 30% at 85% 100%, rgba(0, 229, 255, 0.35), transparent);
  animation: fxJokerPulse 0.45s ease-in-out infinite alternate;
}

.fx-jackpot500 .fx-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, #ffd700 2px, transparent 2px),
    radial-gradient(circle, #ff1744 1.5px, transparent 1.5px);
  background-size: 55px 55px, 80px 80px;
  opacity: 0.35;
  animation: fxSparkleDrift 2.5s linear infinite;
}

.fx-jackpot500 .fx-line {
  color: #fff;
  font-size: clamp(2.5rem, 12vw, 5rem);
  font-weight: 900;
  text-shadow:
    0 3px 12px rgba(0, 0, 0, 0.95),
    0 0 24px #ff1744,
    0 0 48px #e040fb,
    0 0 64px #ffd700,
    3px 3px 0 #4a0080;
  animation: fxPulse 0.18s ease-in-out infinite alternate;
}

.bolt-red { color: #ff1744; filter: drop-shadow(0 0 16px #ff1744); }
.bolt-gold { color: #ffd700; filter: drop-shadow(0 0 14px #ffd700); }
.bolt-purple { color: #7c4dff; filter: drop-shadow(0 0 14px #7c4dff); }
.bolt-magenta { color: #e040fb; filter: drop-shadow(0 0 14px #e040fb); }
.bolt-orange { color: #ff6d00; filter: drop-shadow(0 0 14px #ff6d00); }
.bolt-cyan { color: #00e5ff; filter: drop-shadow(0 0 14px #00e5ff); }

.bolt-storm {
  width: 10px;
  animation: boltStormStrike ease-out infinite;
}

.bolt-from-top {
  top: 0;
  height: 100vh;
  min-height: 100%;
  transform-origin: top center;
}

.bolt-from-bottom {
  bottom: 0;
  height: 100vh;
  min-height: 100%;
  transform-origin: bottom center;
  animation-name: boltStormStrikeBottom;
}

.fx-champion {
  background: radial-gradient(circle at center, rgba(255, 215, 0, 0.45) 0%, rgba(180, 120, 0, 0.85) 45%, rgba(40, 20, 0, 0.95) 100%);
}

.fx-champion .fx-bg::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 215, 0, 0.35), transparent 30%);
  animation: fxRaysSpin 4s linear infinite;
}

.fx-champion .fx-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, #ffeb3b 3px, transparent 3px),
    radial-gradient(circle, #ffd54f 2px, transparent 2px);
  background-size: 70px 70px, 110px 110px;
  opacity: 0.5;
  animation: fxConfetti 2s linear infinite;
}

.fx-champion .fx-line {
  color: #ffeb3b;
  font-size: clamp(2rem, 10vw, 4.5rem);
  font-weight: 900;
  text-shadow:
    0 3px 10px rgba(0, 0, 0, 0.95),
    0 0 28px #ffd700,
    0 0 56px rgba(255, 215, 0, 0.85),
    0 0 80px rgba(255, 193, 7, 0.6),
    3px 3px 0 #8b6914,
    -2px 2px 0 #5c4a0a;
  animation: fxPulse 0.5s ease-in-out infinite alternate;
}

@keyframes boltStormStrike {
  0%, 100% { opacity: 0; transform: rotate(var(--bolt-rot, 0deg)) scaleY(0.08); }
  6% { opacity: 1; transform: rotate(var(--bolt-rot, 0deg)) scaleY(1); }
  18% { opacity: 0.15; }
  28% { opacity: 1; transform: rotate(var(--bolt-rot, 0deg)) scaleY(0.92); }
  42% { opacity: 0; }
  55% { opacity: 0.9; transform: rotate(var(--bolt-rot, 0deg)) scaleY(1); }
  68% { opacity: 0; }
}

@keyframes boltStormStrikeBottom {
  0%, 100% { opacity: 0; transform: rotate(var(--bolt-rot, 0deg)) scaleY(-0.08); }
  6% { opacity: 1; transform: rotate(var(--bolt-rot, 0deg)) scaleY(-1); }
  18% { opacity: 0.15; }
  28% { opacity: 1; transform: rotate(var(--bolt-rot, 0deg)) scaleY(-0.92); }
  42% { opacity: 0; }
  55% { opacity: 0.9; transform: rotate(var(--bolt-rot, 0deg)) scaleY(-1); }
  68% { opacity: 0; }
}

@keyframes fxJokerBgFestive {
  0%, 100% { filter: hue-rotate(0deg) brightness(1); }
  50% { filter: hue-rotate(15deg) brightness(1.15); }
}

@keyframes fxJokerPulse {
  from { opacity: 0.65; }
  to { opacity: 1; }
}

@keyframes fxSparkleDrift {
  from { transform: translateY(0); }
  to { transform: translateY(60px); opacity: 0.2; }
}

@keyframes fxContentPop {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fxFlashOnce {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes fxPulse {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

@keyframes fxFlame {
  from { transform: scaleY(0.85); filter: brightness(1); }
  to { transform: scaleY(1.15); filter: brightness(1.3); }
}

@keyframes fxRaysSpin {
  to { transform: rotate(360deg); }
}

@keyframes fxConfetti {
  from { transform: translateY(0); }
  to { transform: translateY(80px); opacity: 0.3; }
}

@keyframes fireBlastFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.match-replay-playing .fx-overlay:not(.hidden),
body.match-replay-playing .scoreboard-overlay:not(.hidden) {
  display: flex !important;
  z-index: 100000;
}

@media (max-width: 900px) {
  .endgame-card {
    width: min(96vw, 420px);
    max-height: min(94vh, 94dvh);
    padding: 22px 16px 18px;
  }

  .endgame-actions {
    flex-direction: column;
  }

  .endgame-actions .btn {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  .endgame-reopen {
    left: 12px;
    right: 12px;
    bottom: max(16px, env(safe-area-inset-bottom));
    transform: none;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 16px 20px;
    font-size: 0.95rem;
  }

  .endgame-reopen:hover {
    transform: scale(1.02);
  }

  .endgame-reopen:active {
    transform: scale(0.98);
  }

  .scoresheet-card {
    width: min(96vw, 720px);
    max-height: min(92dvh, 92vh);
    margin: 0 auto;
    padding: 22px 16px 16px;
  }

  .scoresheet-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .log-toggle:not(.log-toggle-debug),
  #log-drawer {
    display: none !important;
  }

  .card--discard-row .card-suit-hero {
    font-size: 2rem;
  }

  .deck-pile-center {
    top: 90%;
  }

  .mobile-pickup-toggle:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    top: 90%;
    left: 7%;
  }

  .mobile-pickup-close:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 130;
    top: -12px;
    left: 4px;
    width: 36px;
    height: 36px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
  }

  :root {
    --card-w: 56px;
    --card-h: 78px;
    --card-sm-w: 38px;
    --card-sm-h: 54px;
    --card-discard-w: 70px;
    --card-discard-h: 98px;
  }

  .room-header {
    position: sticky;
    top: 0;
    padding: 10px 12px 12px;
    gap: 10px;
    backdrop-filter: blur(10px);
    background: linear-gradient(180deg, rgba(3, 10, 22, 0.92), rgba(3, 10, 22, 0.72));
  }

  .brand {
    width: 100%;
    justify-content: center;
  }

  .brand p {
    text-align: center;
  }

  .header-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 6px;
  }

  .stat-pill {
    padding: 6px 10px;
    text-align: center;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }

  .table-wrap {
    flex-direction: column;
    min-height: calc(100svh - 64px);
  }

  .human-play-zone {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
  }

  .table-surface {
    align-items: stretch;
    padding: 8px 6px max(8px, env(safe-area-inset-bottom));
    min-height: calc(100svh - 64px);
  }

  .table-rim {
    inset: 4px;
  }

  .table-felt {
    width: min(100%, 760px);
    height: calc(100svh - 84px);
    min-height: 680px;
    max-height: none;
    border-radius: 28px;
    overflow: hidden;
  }

  .table-felt::before {
    inset: 12px;
    border-radius: 22px;
  }

  .seat-left,
  .seat-top,
  .seat-right {
    top: 8px;
    bottom: auto;
    gap: 4px;
  }

  .seat-left,
  .seat-right {
    display: flex;
    width: min(29vw, 116px);
  }

  .seat-left {
    left: 6px;
    transform: none;
    align-items: flex-start;
  }

  .seat-right {
    right: 6px;
    transform: none;
    align-items: flex-end;
  }

  .seat-top {
    width: min(34vw, 138px);
  }

  .seat-left .seat-info,
  .seat-top .seat-info,
  .seat-right .seat-info {
    width: 100%;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 9px;
    font-size: 0.64rem;
  }

  .seat-left .seat-info:has(.seat-ingame-kick-btn),
  .seat-top .seat-info:has(.seat-ingame-kick-btn),
  .seat-right .seat-info:has(.seat-ingame-kick-btn) {
    padding-top: 5px;
    padding-right: 24px;
  }

  .seat-left .seat-name,
  .seat-top .seat-name,
  .seat-right .seat-name {
    font-size: 0.72rem;
  }

  .seat-left .seat-meta,
  .seat-top .seat-meta,
  .seat-right .seat-meta {
    font-size: 0.54rem;
    line-height: 1.15;
  }

  .seat-left .seat-cekih-badge,
  .seat-top .seat-cekih-badge,
  .seat-right .seat-cekih-badge,
  .seat-left .seat-phase-badge,
  .seat-top .seat-phase-badge,
  .seat-right .seat-phase-badge {
    padding: 2px 5px;
    font-size: 0.52rem;
    letter-spacing: 0.05em;
  }

  .seat-left .seat-cards-wrap,
  .seat-top .seat-cards-wrap,
  .seat-right .seat-cards-wrap {
    min-height: 0;
    width: 100%;
    transform: scale(0.82);
    transform-origin: top center;
  }

  .seat-left .seat-cards-wrap {
    justify-content: flex-start;
    transform-origin: top left;
  }

  .seat-right .seat-cards-wrap {
    justify-content: flex-end;
    transform-origin: top right;
  }

  .seat-left .seat-hand-opponent-groups--vertical,
  .seat-right .seat-hand-opponent-groups--vertical {
    width: max-content;
    max-width: none;
    gap: 6px;
  }

  .seat-left .seat-hand-opponent-groups--vertical {
    align-items: flex-start;
  }

  .seat-right .seat-hand-opponent-groups--vertical {
    align-items: flex-end;
  }

  .seat-left .seat-hand-opponent-groups--vertical .opponent-hand-group-cards,
  .seat-right .seat-hand-opponent-groups--vertical .opponent-hand-group-cards {
    flex-direction: column;
    align-items: center;
  }

  .seat-top .seat-hand-opponent-groups {
    width: max-content;
    max-width: none;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .seat-locked-tappable {
    box-shadow: 0 0 0 1px rgba(245, 208, 94, 0.35), 0 8px 18px rgba(0, 0, 0, 0.2);
  }

  .seat-left .seat-locked,
  .seat-top .seat-locked,
  .seat-right .seat-locked {
    display: none;
  }

  .human-locked-combos {
    display: none !important;
  }

  .table-center {
    top: 44%;
    width: min(92vw, 720px);
    height: min(290px, 40svh);
  }

  .table-phase-hint {
    top: auto;
    bottom: 36%;
    transform: translateX(-50%);
    font-size: 0.86rem;
    letter-spacing: 0.1em;
    gap: 8px;
  }

  .table-phase-hint::before,
  .table-phase-hint::after {
    width: 18px;
  }

  .discard-area {
    justify-content: flex-start;
    padding-top: 0;
    top: -40px;
  }

  .discard-ring-host {
    inset: 0 0 auto 0;
    top: 0;
    bottom: auto;
    height: auto;
    min-height: 112px;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0;
  }

  .discard-stack {
    justify-content: flex-start;
    padding-top: 0;
  }

  .seat-bottom {
    bottom: max(48px, calc(env(safe-area-inset-bottom) + 48px));
    width: calc(100% - 12px);
    gap: 2px;
  }

  .seat-cards-wrap-human {
    width: 100%;
    max-width: min(100%, 720px);
    gap: 6px;
    transform: translateY(-38px);
    transform-origin: bottom center;
  }

  .pickup-zone-row,
  .pickup-zone-toolbar {
    max-width: 100%;
    gap: 6px;
  }

  .pickup-zone-center,
  .pickup-zone-row .seat-locked-human,
  .pickup-zone-toolbar .seat-locked-human {
    min-width: 0;
    max-width: none;
  }

  .seat-info-human {
    width: min(100%, 720px);
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(5, 18, 34, 0.68);
    border: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(8px);
    margin-top: 0;
  }

  .btn,
  .pickup-zone-btn {
    min-height: 40px;
  }

  .log-toggle {
    right: 14px;
    bottom: 110px;
  }

  .log-drawer {
    width: min(380px, 100vw);
  }

  .endgame-action-bar {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: none;
  }

  .toast {
    top: max(64px, calc(env(safe-area-inset-top) + 52px));
    right: 12px;
    width: auto;
    max-width: none;
    transform: none;
  }

  .btn-endgame-finish {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 680px) {
  .room-header {
    padding: 10px 10px 12px;
  }

  .header-menu-toggle {
    display: inline-flex;
    margin-left: auto;
    flex: 0 0 auto;
  }

  body.is-multiplayer-mode .header-voice-btn:not([hidden]) {
    display: inline-flex;
  }

  body.is-multiplayer-mode .btn-desktop-voice-channel,
  body.is-multiplayer-mode .btn-desktop-voice-ptt {
    display: none !important;
  }

  body.is-multiplayer-mode .header-chat-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    margin-right: 0;
    flex: 0 0 auto;
  }

  .mp-turn-timer .mp-turn-timer-value {
    font-size: 0.88rem;
  }

  body.is-multiplayer-mode .header-voice-btn.btn-voice-channel {
    margin-left: auto;
    margin-right: 0;
  }

  body.is-multiplayer-mode .header-voice-btn.btn-voice-ptt {
    margin-right: 0;
  }

  body.is-multiplayer-mode .header-menu-toggle {
    margin-left: 0;
  }

  body.is-multiplayer-mode .btn-desktop-chat-toggle {
    display: none !important;
  }

  body.is-multiplayer-mode .btn-desktop-voice-channel,
  body.is-multiplayer-mode .btn-desktop-voice-ptt {
    display: none !important;
  }

  .mobile-pickup-toggle:not([hidden]) {
    left: 5%;
    min-width: 96px;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.68rem;
  }

  .mobile-pickup-close:not([hidden]) {
    z-index: 130;
    top: -10px;
    left: 2px;
    width: 34px;
    height: 34px;
    min-width: 44px;
    min-height: 44px;
    font-size: 0.9rem;
  }

  .pickup-zone-toolbar .pickup-zone-center {
    z-index: 1;
  }

  .room-header.is-mobile-collapsed {
    align-items: center;
    padding-bottom: 10px;
  }

  .room-header.is-mobile-collapsed .brand {
    width: auto;
    max-width: calc(100% - 52px);
  }

  .room-header.is-mobile-collapsed .brand p,
  .room-header.is-mobile-collapsed .header-stats,
  .room-header.is-mobile-collapsed .header-actions {
    display: none !important;
  }

  .room-header:not(.is-mobile-collapsed) .header-menu-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .room-header:not(.is-mobile-collapsed) .header-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .room-header:not(.is-mobile-collapsed) .header-menu-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .brand {
    width: auto;
    flex: 1 1 auto;
    justify-content: flex-start;
    gap: 10px;
  }

  .brand-icon {
    font-size: 1.55rem;
  }

  .brand h1 {
    font-size: 1.05rem;
  }

  .brand p {
    font-size: 0.7rem;
    text-align: left;
  }

  .header-stats {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 4px;
    width: 100%;
    overflow-x: auto;
    padding: 0 1px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .header-stats::-webkit-scrollbar {
    display: none;
  }

  .stat-pill {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-radius: 10px;
    padding: 4px 7px;
    min-width: 0;
  }

  .stat-label {
    margin-right: 0;
    font-size: 0.54rem;
    line-height: 1;
  }

  .stat-pill strong {
    font-size: 0.72rem;
    line-height: 1.05;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  body.is-multiplayer-mode .header-actions .spectator-voice-control:not([hidden]) {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: space-between;
    margin: 0 0 2px;
    padding: 8px 10px;
  }

  .header-actions > .btn,
  .header-actions > .icon-btn,
  .header-actions > .btn-replay-bot {
    width: 100%;
    justify-content: center;
  }

  .header-actions > .icon-btn {
    width: 100%;
    height: 38px;
  }

  body.is-multiplayer-mode .mp-livechat {
    top: 58px;
    right: 10px;
    left: 10px;
    width: auto;
    min-width: 0;
    max-height: 38vh;
  }

  .header-tutup-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: stretch;
  }

  .header-tutup-actions .btn {
    flex: 1 1 0;
  }

  .table-surface {
    padding: 6px 4px max(4px, env(safe-area-inset-bottom));
  }

  .table-felt {
    height: calc(100svh - 60px);
    min-height: 620px;
    border-radius: 24px;
  }

  .seat-left,
  .seat-right {
    width: min(30vw, 108px);
  }

  .seat-top {
    width: min(35vw, 126px);
  }

  .seat-info {
    max-width: calc(100% - 8px);
    padding: 6px 10px;
  }

  .seat-info:has(.seat-ingame-kick-btn) {
    padding-top: 7px;
    padding-right: 26px;
  }

  .seat-name {
    font-size: 0.82rem;
  }

  .seat-meta {
    font-size: 0.64rem;
  }

  .seat-left .seat-cards-wrap,
  .seat-top .seat-cards-wrap,
  .seat-right .seat-cards-wrap {
    transform: scale(0.76);
  }

  .table-center {
    top: 45%;
    height: min(270px, 38svh);
  }

  .discard-ring-host {
    min-height: 104px;
  }

  .seat-bottom {
    bottom: max(52px, calc(env(safe-area-inset-bottom) + 52px));
  }

  .table-discard-drop.is-active {
    top: 36%;
    width: 86%;
    height: 60%;
    border-radius: 28px;
  }

  .pickup-zone-row,
  .pickup-zone-toolbar {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .pickup-zone-center {
    order: 1;
    width: 100%;
  }

  .pickup-zone-btn--side {
    flex: 1 1 calc(50% - 3px);
    min-width: 0;
    min-height: 44px;
  }

  #btn-pickup-cancel {
    order: 2;
  }

  #btn-pickup-finish {
    order: 3;
  }

  .pickup-mode-tab {
    min-height: 38px;
    font-size: 0.66rem;
  }

  .pickup-staging-drop {
    min-height: 60px;
    padding: 10px 8px;
  }

  .seat-hand-fan {
    min-height: calc(var(--card-h) + 22px);
    width: 100%;
    max-width: 100%;
    padding: 0 0 2px;
  }

  #human-hand {
    width: 100%;
    padding: 0 6px 4px;
  }

  .seat-info-human {
    gap: 6px;
    justify-content: center;
    margin-top: 0;
  }

  .human-locked-combos {
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 6px 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    pointer-events: auto;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
  }

  .human-locked-combos .locked-combo {
    flex: 0 0 auto;
    scroll-snap-align: start;
    pointer-events: auto;
  }

  .btn-cekih-declare {
    min-height: 34px;
    padding: 6px 12px;
  }

  .log-toggle {
    right: 10px;
    bottom: 92px;
    padding: 10px 12px;
  }

  .log-drawer {
    width: 100vw;
  }
}

/* Scoresheet — layar penuh, satu area scroll (nyaman di iOS/Android) */
@media (max-width: 680px) {
  .scoresheet-overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
  }

  .scoresheet-card {
    width: 100%;
    max-width: none;
    max-height: none;
    height: 100%;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
    border-width: 0;
    border-top: 2px solid rgba(240, 193, 75, 0.45);
    gap: 10px;
    padding:
      max(10px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: y contain;
    touch-action: pan-y;
  }

  .scoresheet-card .endgame-dismiss-x {
    top: max(6px, env(safe-area-inset-top));
    right: max(6px, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .scoresheet-head {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0 -4px;
    padding: 32px 8px 10px;
    background: linear-gradient(
      180deg,
      rgba(9, 20, 33, 1) 0%,
      rgba(9, 20, 33, 0.97) 75%,
      rgba(9, 20, 33, 0) 100%
    );
  }

  .scoresheet-head h2 {
    font-size: 1.12rem;
    line-height: 1.25;
  }

  .scoresheet-head p {
    display: none;
  }

  .scoresheet-replay-bar {
    width: 100%;
    padding: 0 4px;
  }

  .scoresheet-replay-bar .btn-match-replay {
    width: 100%;
    max-width: none;
    min-height: 44px;
    font-size: 16px;
  }

  .match-replay-status {
    font-size: 0.82rem;
  }

  .scoresheet-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .scoresheet-summary-card {
    padding: 10px 8px;
    border-radius: 12px;
  }

  .scoresheet-summary-name {
    font-size: 0.82rem;
    line-height: 1.2;
    word-break: break-word;
  }

  .scoresheet-summary-score {
    font-size: 1.45rem;
    margin-top: 2px;
  }

  .scoresheet-turns {
    flex: none;
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding: 10px 10px 4px;
    flex-direction: column;
    gap: 8px;
  }

  .scoresheet-turn-item {
    padding: 12px;
    font-size: 16px;
  }

  .scoresheet-turn-line {
    font-size: 16px;
    line-height: 1.5;
  }

  .scoresheet-turn-title {
    font-size: 1rem;
  }

  .scoresheet-card > .endgame-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0 -4px;
    padding: 12px 4px max(8px, env(safe-area-inset-bottom));
    background: linear-gradient(
      0deg,
      rgba(10, 34, 27, 1) 0%,
      rgba(10, 34, 27, 0.97) 70%,
      rgba(10, 34, 27, 0) 100%
    );
  }

  .scoresheet-card > .endgame-actions .btn {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  :root {
    --card-w: 50px;
    --card-h: 70px;
    --card-sm-w: 34px;
    --card-sm-h: 48px;
    --card-discard-w: 62px;
    --card-discard-h: 88px;
  }

  .scoresheet-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-header {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  .header-stats {
    gap: 4px;
    padding-bottom: 0;
  }

  .header-stats .stat-pill:nth-child(4),
  .header-stats .stat-pill:nth-child(5) {
    display: none;
  }

  .stat-pill {
    padding: 4px 6px;
    border-radius: 9px;
  }

  .stat-label {
    display: none;
  }

  .stat-pill strong {
    font-size: 0.74rem;
  }

  .table-surface {
    padding: 4px 3px max(2px, env(safe-area-inset-bottom));
  }

  .mobile-pickup-toggle:not([hidden]) {
    left: 4%;
    min-width: 88px;
    min-height: 38px;
    padding: 7px 9px;
    border-radius: 10px;
    font-size: 0.64rem;
  }

  .mobile-pickup-close:not([hidden]) {
    z-index: 130;
    top: -8px;
    left: 2px;
    width: 32px;
    height: 32px;
    min-width: 44px;
    min-height: 44px;
    font-size: 0.82rem;
  }

  .table-felt {
    height: calc(100svh - 56px);
    min-height: 560px;
    border-radius: 20px;
  }

  .seat-left,
  .seat-right {
    width: min(31vw, 96px);
  }

  .seat-top {
    width: min(36vw, 112px);
  }

  .seat-left .seat-info,
  .seat-top .seat-info,
  .seat-right .seat-info {
    padding: 3px 5px;
    gap: 3px;
  }

  .seat-left .seat-cards-wrap,
  .seat-top .seat-cards-wrap,
  .seat-right .seat-cards-wrap {
    transform: scale(0.7);
  }

  .opponent-hand-group {
    padding: 4px 5px;
    gap: 3px;
  }

  .bot-locked-popover-panel {
    width: min(94vw, 360px);
    padding: 16px;
    border-radius: 14px;
  }

  .bot-locked-popover-list {
    gap: 8px;
  }

  .seat-left .seat-hand-opponent-groups--vertical,
  .seat-right .seat-hand-opponent-groups--vertical,
  .seat-top .seat-hand-opponent-groups {
    gap: 4px;
  }

  .seat-top .opponent-hand-group-cards {
    gap: 1px;
  }

  .table-center {
    top: 40%;
    height: min(500px, 40svh);
  }

  .discard-ring-host {
    min-height: 96px;
  }

  .seat-bottom {
    bottom: max(44px, calc(env(safe-area-inset-bottom) + 44px));
  }

  .seat-cards-wrap-human {
    transform: translateY(-36px);
  }

  .table-discard-drop.is-active {
    top: 38%;
    width: 90%;
    height: 64%;
  }

  .pile-label,
  .discard-area-label {
    font-size: 0.62rem;
  }

  #human-hand {
    --fan-overlap: -16px;
    --fan-step: 6px;
  }

  .btn-sm {
    padding: 8px 10px;
    font-size: 0.72rem;
  }

  .modal-panel,
  .cekih-prompt-card,
  .greedy-penalty-card {
    width: min(94vw, 420px);
  }
}

@media (min-width: 521px) and (max-width: 600px) {
  #human-hand { --fan-overlap: -18px; --fan-step: 8px; }
}

/* ===== Mode simulasi (?mode=simulation) ===== */
body.simulation-page {
  overflow: auto;
  background: #0a1218;
}

.simulation-setup {
  position: fixed;
  inset: 0;
  z-index: 50000;
  overflow: auto;
  padding: 16px;
  background: linear-gradient(165deg, #0f1a24 0%, #060c12 100%);
}

.simulation-setup-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.simulation-setup-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.simulation-setup-head h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  color: var(--gold);
}

.simulation-setup-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.simulation-format-help {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.simulation-format-help code {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

.sim-card-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 120px;
  overflow: auto;
  padding: 10px;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.sim-pool-chip {
  font: inherit;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(240, 193, 75, 0.35);
  background: rgba(20, 36, 52, 0.9);
  color: var(--text);
  cursor: pointer;
}

.sim-pool-chip:hover {
  border-color: var(--gold);
  background: rgba(40, 60, 80, 0.95);
}

.sim-templates-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 8px;
}

.sim-templates-select-wrap {
  flex: 1 1 280px;
  min-width: 0;
  margin: 0;
}

.sim-template-desc {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: #9ec4ff;
  line-height: 1.4;
}

.sim-hands-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

@media (min-width: 800px) {
  .sim-hands-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.sim-extra-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.sim-field-block--wide {
  grid-column: 1 / -1;
}

.sim-field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}

.sim-field-block textarea,
.sim-field-block select,
.sim-field-block input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 16px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(8, 16, 24, 0.9);
  color: var(--text);
  resize: vertical;
}

.sim-status {
  min-height: 1.4em;
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: #8fd4a8;
}

.sim-status--error {
  color: #ff8a80;
}

.sim-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.simulation-mode .mp-livechat,
body.simulation-page .mp-livechat {
  display: none !important;
}

body.simulation-mode .header-chat-toggle,
body.simulation-mode .btn-desktop-chat-toggle {
  display: none !important;
}

body.simulation-mode .room-header::after {
  content: 'SIM';
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 6px;
  background: rgba(240, 193, 75, 0.2);
  color: var(--gold);
  vertical-align: middle;
}
