/* Friends Anime Poker — Stylesheet (CSP Compliant, No External Assets) */

:root {
  /* Color Palette: Cozy Anime Lounge */
  --bg-dark: #121018;
  --bg-card: rgba(26, 22, 37, 0.94);
  --bg-card-border: rgba(230, 180, 255, 0.16);
  --bg-input: #1a1627;
  --text-main: #f3f0f7;
  --text-muted: #a69ebb;
  --text-dim: #7a738f;
  
  /* Anime Accent Colors */
  --accent-pink: #ff6b9d;
  --accent-pink-glow: rgba(255, 107, 157, 0.4);
  --accent-rose: #f43f5e;
  --accent-gold: #fbbf24;
  --accent-amber: #f59e0b;
  --accent-blue: #38bdf8;
  --accent-purple: #c084fc;
  --accent-teal: #2dd4bf;
  
  /* Table & Felt Colors */
  --table-felt: #154734;
  --table-felt-inner: #195840;
  --table-rim: #2d1810;
  --table-rim-border: #5a301e;
  --table-gold-line: rgba(251, 191, 36, 0.28);
  
  /* Status Colors */
  --status-success: #10b981;
  --status-warning: #f59e0b;
  --status-danger: #ef4444;
  --status-info: #3b82f6;

  /* Card Colors */
  --card-suit-spade: #1e293b;
  --card-suit-heart: #e11d48;
  --card-suit-diamond: #2563eb;
  --card-suit-club: #059669;
  
  /* Dimensions & Spacing */
  --action-bar-height: 56px;
  --seat-size-mobile: 42px;
  --seat-size-desktop: 52px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  /* Transitions */
  --trans-fast: 150ms ease;
  --trans-normal: 250ms ease;
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.08);
}

/* Reduced Effects Mode (TRD [ED-TA-24]) */
body.reduced-effects *,
body.reduced-effects *::before,
body.reduced-effects *::after {
  animation: none !important;
  transition: none !important;
}

body.reduced-effects .table-effects-layer,
body.reduced-effects .summary-effects-layer {
  display: none !important;
}

/* Vector UI SVG Icon Sizing */
.ui-svg {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  flex-shrink: 0;
}

.ui-svg-xs {
  width: 11px;
  height: 11px;
}

.ui-svg-sm {
  width: 14px;
  height: 14px;
}

.ui-svg-lg {
  width: 22px;
  height: 22px;
}

.ui-svg-hero {
  width: 48px;
  height: 48px;
}

.ui-svg-sakura {
  width: 17px;
  height: 17px;
}

.icon-glyph,
.notice-icon,
.banner-icon,
.btn-icon,
.toast-icon,
.timer-pill-icon,
.compact-win-trophy,
.showdown-trophy,
.confirm-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-label-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.summary-arrow {
  display: inline-flex;
  align-items: center;
  transition: transform var(--trans-fast);
}

details[open] .summary-arrow {
  transform: rotate(180deg);
}

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

.toast.toast-error .toast-icon { color: #fca5a5; }
.toast.toast-success .toast-icon { color: #34d399; }
.toast.toast-info .toast-icon { color: #38bdf8; }

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.4;
  user-select: none;
  -webkit-user-select: none;
}

button, input, select {
  font-family: inherit;
  font-size: 14px;
}

/* Utility Hidden */
.hidden {
  display: none !important;
}

/* Screen Layout Switcher */
.view-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px;
}

.view-screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.view-screen > .screen-card {
  margin: auto 0;
}

#view-table.active {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* System Notifications & Banners */
.banner-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  pointer-events: none;
}

.system-banner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, #991b1b, #7f1d1d);
  color: #fff;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.system-banner.warning {
  background: linear-gradient(90deg, #92400e, #78350f);
}

.system-banner.info {
  background: linear-gradient(90deg, #1e3a8a, #1e40af);
}

.system-banner .banner-text {
  flex: 1;
}

.system-banner .banner-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Toast Container */
.toast-container {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
  max-width: calc(100vw - 24px);
  width: min(360px, calc(100vw - 24px));
}

.toast {
  pointer-events: auto;
  background: rgba(22, 18, 32, 0.96);
  border: 1px solid var(--accent-pink-glow);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastFadeIn 0.25s ease-out;
}

.toast.toast-error {
  border-color: var(--status-danger);
  background: rgba(45, 12, 16, 0.96);
}

.toast.toast-success {
  border-color: var(--status-success);
  background: rgba(10, 38, 26, 0.96);
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards & Containers (Lounge Style) */
.screen-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  backdrop-filter: blur(12px);
}

.home-header, .lobby-header {
  text-align: center;
  margin-bottom: 20px;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255, 107, 157, 0.15);
  border: 1px solid rgba(255, 107, 157, 0.3);
  border-radius: var(--radius-full);
  color: var(--accent-pink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.home-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.home-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Form Controls */
.home-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.form-label-sm {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
  display: block;
}

.form-hint {
  font-size: 11px;
  color: var(--text-dim);
}

.form-input, .form-select-sm, .form-input-sm {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #fff;
  outline: none;
  transition: border-color var(--trans-fast);
}

.form-input:focus, .form-select-sm:focus, .form-input-sm:focus {
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 2px var(--accent-pink-glow);
}

.form-input-sm, .form-select-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-col {
  flex: 1;
  min-width: 0;
}

/* Avatar Selector Grid */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.avatar-option:hover {
  background: rgba(255, 107, 157, 0.08);
  border-color: rgba(255, 107, 157, 0.3);
}

.avatar-option.selected {
  background: rgba(255, 107, 157, 0.18);
  border-color: var(--accent-pink);
  box-shadow: 0 0 10px var(--accent-pink-glow);
}

.avatar-preview-box {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-preview-box svg {
  width: 100%;
  height: 100%;
}

.avatar-option-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-main);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--trans-fast);
}

.btn-primary {
  background: linear-gradient(135deg, #ff6b9d, #f43f5e);
  color: #fff;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover:not(:disabled) {
  color: #fff;
  border-color: var(--accent-pink);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-pink);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

/* Collapsible Settings */
.settings-details {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
}

.settings-summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

.settings-summary::-webkit-details-marker {
  display: none;
}

.settings-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.settings-note {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

/* Divider */
.divider-text {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin: 14px 0;
}

.divider-text::before, .divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

/* Direct Invite Form */
.invite-direct-form {
  margin-bottom: 4px;
}

.invite-input-group {
  display: flex;
  gap: 8px;
}

.invite-input-group .form-input {
  flex: 1;
  min-width: 0;
}

.invite-input-group .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.home-footer, .lobby-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-dim);
}

/* Guest Lobby Meta Card */
.room-meta-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 11px;
  color: var(--text-dim);
}

.meta-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.notice-box {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 14px;
}

.notice-box.info-box {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #bfdbfe;
}

.lobby-waiting-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  font-size: 13px;
  color: var(--accent-gold);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(251, 191, 36, 0.2);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================================================
   WAITING HALL (OPEN TABLES BROWSER + CREATE ROOM)
   ========================================================= */

.home-hall-shell {
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: auto 0;
}

.hall-top-header {
  margin-bottom: 2px;
}

.home-hall-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.home-hall-grid .screen-card {
  max-width: 100%;
}

.hall-mobile-tabs {
  display: flex;
  width: 100%;
  max-width: 560px;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 4px;
}

.hall-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border: none;
  border-radius: calc(var(--radius-md) - 3px);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.hall-tab-btn.active {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.25), rgba(168, 85, 247, 0.25));
  color: #fff;
  box-shadow: 0 2px 10px rgba(255, 107, 157, 0.25);
}

.hall-tab-count {
  background: rgba(255, 107, 157, 0.35);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

@media (max-width: 859px) {
  .home-hall-grid {
    max-width: 560px;
  }

  .hall-panel.is-mobile-hidden {
    display: none;
  }
}

@media (min-width: 860px) {
  .hall-mobile-tabs {
    display: none;
  }

  .home-hall-grid {
    grid-template-columns: 1.12fr 0.88fr;
    gap: 18px;
  }

  .open-rooms-list {
    max-height: 430px;
    overflow-y: auto;
    padding-right: 4px;
  }
}

.hall-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hall-panel-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hall-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.open-rooms-count-pill {
  font-size: 11px;
  font-weight: 700;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.btn-refresh-rooms {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.btn-refresh-rooms:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
}

.open-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 150px;
  margin-bottom: 14px;
}

.hall-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 24px 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
}

.hall-empty-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.hall-empty-sub {
  font-size: 12px;
  color: var(--text-dim);
  max-width: 280px;
}

.open-room-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 107, 157, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  transition: all var(--trans-fast);
}

.open-room-card:hover:not(.is-full) {
  border-color: rgba(255, 107, 157, 0.55);
  box-shadow: 0 4px 18px rgba(255, 107, 157, 0.14);
  transform: translateY(-1px);
}

.open-room-card.is-full {
  opacity: 0.72;
}

.open-room-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.open-room-avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}

.open-room-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.open-room-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.open-room-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-room-state {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.open-room-state.is-waiting {
  color: #fde047;
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.open-room-state.is-playing {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.open-room-state.is-paused {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.open-room-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.room-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.room-meta-chip.is-locked {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
}

.room-meta-chip.is-approval {
  color: #bae6fd;
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.08);
}

.open-room-join-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 12px;
  white-space: nowrap;
}

.label-opt {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-dim);
}

/* Guest Lobby Password & Lock Badges */
.lobby-badges-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.room-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #bae6fd;
}

.room-lock-pill.is-locked {
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde047;
}

.lobby-password-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-md);
}

.password-join-row {
  display: flex;
  gap: 8px;
}

.password-join-row .form-input {
  flex: 1;
  min-width: 0;
}

.password-join-row .btn {
  flex-shrink: 0;
  padding: 8px 14px;
  white-space: nowrap;
}

/* Responsive Waiting Hall & Guest Lobby Breakpoints */
@media (max-width: 600px) {
  .view-screen {
    padding: 10px;
  }

  .screen-card {
    padding: 16px 14px;
  }

  .home-header, .lobby-header {
    margin-bottom: 14px;
  }

  .home-title {
    font-size: 19px;
  }

  .lobby-room-name {
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  .open-room-card {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
  }

  .open-room-avatar {
    width: 40px;
    height: 40px;
  }

  .open-room-join-btn {
    width: 100%;
    margin-top: 2px;
  }
}

@media (max-width: 440px) {
  .invite-input-group,
  .password-join-row,
  #create-settings-details .form-row,
  #host-settings-form .form-row {
    flex-direction: column;
  }

  .invite-input-group .btn,
  .password-join-row .btn {
    width: 100%;
  }

  .avatar-grid {
    gap: 6px;
  }

  .avatar-preview-box {
    width: 38px;
    height: 38px;
  }

  .avatar-option-name {
    font-size: 10px;
  }
}

.host-password-box {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.host-pw-status {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
}

.host-pw-status.is-active {
  color: #fde047;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

/* =========================================================
   POKER TABLE SCREEN (VIEW 3)
   ========================================================= */

/* Top Bar */
.table-top-bar {
  position: relative;
  width: 100%;
  min-height: 46px;
  height: auto;
  background: rgba(18, 16, 24, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  z-index: 150;
  flex-shrink: 0;
}

.table-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.table-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.room-title-text {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-state-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.table-state-badge.state-waiting {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
}

.table-state-badge.state-progress {
  background: rgba(16, 185, 129, 0.15);
  color: var(--status-success);
}

.table-state-badge.state-paused {
  background: rgba(192, 132, 252, 0.15);
  color: var(--accent-purple);
}

.table-blinds-group {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.blinds-badge, .cap-badge {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.table-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  max-width: 100%;
}

.btn-icon-bar, .btn-pill-bar {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--trans-fast);
}

/* Desktop utility menu passes items inline while preserving left-to-right order */
.table-utility-menu {
  display: contents;
}

.table-utility-menu > button {
  order: 1;
}

.table-bar-right > .btn-pill-bar {
  order: 2;
}

#btn-leave-table {
  order: 3;
}

.btn-mobile-menu {
  display: none;
}

@media (max-width: 1240px) {
  .btn-icon-bar .btn-bar-text {
    display: none;
  }

  .btn-icon-bar {
    padding: 5px 7px;
  }
}

@media (max-width: 960px) {
  .table-bar-left {
    flex-wrap: wrap;
    row-gap: 3px;
  }

  #btn-copy-invite .btn-bar-text,
  #btn-quick-pause-toggle .btn-bar-text,
  #btn-sitout-toggle .btn-bar-text,
  #btn-imback-toggle .btn-bar-text {
    display: none;
  }

  .room-title-text {
    max-width: 110px;
  }
}

@media (max-width: 768px) {
  .btn-mobile-menu {
    display: inline-flex;
    order: 99;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .table-utility-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 8px;
    width: min(230px, calc(100vw - 16px));
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: rgba(20, 16, 30, 0.98);
    border: 1px solid rgba(230, 180, 255, 0.25);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    z-index: 400;
  }

  .table-utility-menu.is-open {
    display: flex;
    animation: fadeInDownMenu 0.16s ease-out;
  }

  .table-utility-menu > button,
  #btn-copy-invite {
    width: 100%;
    justify-content: flex-start;
    padding: 9px 12px;
    font-size: 12px;
    gap: 10px;
    border-radius: var(--radius-sm);
    order: 1;
  }

  .table-utility-menu .btn-bar-text {
    display: inline !important;
  }

  .table-utility-menu #btn-leave-table {
    order: 99;
    margin-top: 2px;
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.45);
    color: #fecaca;
  }
}

@keyframes fadeInDownMenu {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 680px) {
  .table-top-bar {
    flex-wrap: wrap;
    padding: 5px 8px;
    gap: 5px;
    min-height: 44px;
  }

  .table-bar-left {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .table-bar-right {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
    overflow: visible;
    gap: 4px;
  }

  .table-bar-right > .btn-pill-bar,
  .btn-mobile-menu {
    padding: 4px 7px;
    font-size: 11px;
  }

  .room-title-text {
    max-width: none;
    flex: 0 1 auto;
    min-width: 0;
    font-size: 12px;
  }

  .toast-container {
    top: 68px;
  }
}

@media (max-width: 380px) {
  .table-bar-right {
    gap: 2.5px;
  }

  .table-bar-right > .btn-pill-bar,
  .btn-mobile-menu {
    padding: 3px 4px;
    font-size: 9.5px;
    gap: 2.5px;
  }

  .table-bar-right > .btn-pill-bar .ui-svg,
  .btn-mobile-menu .ui-svg {
    width: 12px;
    height: 12px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .table-top-bar {
    flex-wrap: nowrap;
    min-height: 36px;
    padding: 3px 8px;
    gap: 6px;
  }

  .table-bar-left {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .table-bar-right {
    flex: 0 1 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    overflow: visible;
    gap: 4px;
  }

  .table-bar-right > .btn-pill-bar .btn-bar-text {
    display: none;
  }

  #btn-quick-start-hand .btn-bar-text,
  #btn-ready-toggle .btn-bar-text {
    display: inline;
  }

  .btn-mobile-menu .mobile-menu-label {
    display: none;
  }

  .cap-badge {
    display: none;
  }

  .room-title-text {
    max-width: 110px;
    font-size: 12px;
  }
}

.btn-icon-bar:hover, .btn-pill-bar:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.btn-icon-bar.active {
  background: rgba(255, 107, 157, 0.2);
  border-color: var(--accent-pink);
  color: #fff;
}

.btn-host-glow {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  position: relative;
}

.pending-badge-counter {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--status-danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-ready {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--status-success);
  color: var(--status-success);
}

.btn-ready.is-ready {
  background: var(--status-success);
  color: #fff;
}

.btn-sitout {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.btn-imback {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.btn-quick-start {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(5, 150, 105, 0.35));
  border-color: var(--status-success);
  color: #6ee7b7;
}

.btn-quick-start:hover {
  background: var(--status-success);
  color: #fff;
}

.btn-quick-pause {
  background: rgba(192, 132, 252, 0.14);
  border-color: rgba(192, 132, 252, 0.45);
  color: #d8b4fe;
}

.btn-quick-pause.is-active {
  background: rgba(192, 132, 252, 0.32);
  border-color: var(--accent-purple);
  color: #fff;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.35);
}

.btn-center-start {
  pointer-events: auto;
  margin-top: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-full);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 14px rgba(255, 107, 157, 0.4);
}

.btn-leave {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* =========================================================
   TABLE FELT & 9-SEAT RESPONSIVE ELLIPSE LAYOUT (TRD-3)
   ========================================================= */

.poker-table-wrapper {
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  container-type: size;
  padding: 20px 16px 34px;
}

/* Felt Container (defaults to Portrait Vertical Oval, overridden in Horizontal/Landscape) */
.poker-felt {
  position: relative;
  width: min(500px, calc(100cqw - 28px), calc((100cqh - 54px) * 0.78));
  height: min(680px, calc(100cqh - 54px), calc((100cqw - 28px) / 0.72));
  background: radial-gradient(ellipse at center, var(--table-felt-inner) 0%, var(--table-felt) 65%, #0d2e21 100%);
  border: 9px solid var(--table-rim);
  border-radius: 50% / 34%;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8), 0 0 0 2px var(--table-gold-line), 0 10px 40px rgba(0, 0, 0, 0.7);
  overflow: visible;
}

/* Center Table Area */
.table-center {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 20;
  pointer-events: none;
}

.pot-display-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.main-pot-badge {
  background: rgba(18, 16, 24, 0.88);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
}

.side-pots-container {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.side-pot-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fef08a;
  border-radius: var(--radius-full);
}

/* Community Cards Board (5 slots) */
.community-board {
  display: flex;
  gap: 5px;
}

.board-card-slot {
  width: 36px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 5px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 400px;
}

.board-card-slot.is-pending-reveal {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.08);
  box-shadow: inset 0 0 8px rgba(251, 191, 36, 0.18);
}

.card-dramatic-flip {
  animation: dramaticCardFlip 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transform-style: preserve-3d;
}

@keyframes dramaticCardFlip {
  0% {
    transform: rotateY(90deg) scale(1.22) translateY(-10px);
    opacity: 0.25;
    box-shadow: 0 0 18px rgba(251, 191, 36, 0.9);
  }
  65% {
    transform: rotateY(-8deg) scale(1.08) translateY(-2px);
    opacity: 1;
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.7);
  }
  100% {
    transform: rotateY(0deg) scale(1) translateY(0);
    opacity: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  }
}

/* Playing Card Component (Non-overlapping Corner Index + Lower-Right Suit Watermark) */
.poker-card {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  border-radius: 5px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 2px 3px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.42);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.card-corner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.92;
}

.card-corner-bottom {
  display: none;
}

.card-rank {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.card-suit {
  font-size: 9px;
  line-height: 1;
  margin-top: 1px;
}

.card-center-suit {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 18px;
  line-height: 1;
  opacity: 0.9;
  z-index: 1;
  pointer-events: none;
}

/* Skin 1 (Default): 4-Color Tinted Card Faces (Distinct Border & Pastel Tint per Suit) */
.poker-card.suit-s {
  color: #0f172a;
  background: linear-gradient(155deg, #ffffff 0%, #e2e8f0 100%);
  border-color: #64748b;
}

.poker-card.suit-h {
  color: #e11d48;
  background: linear-gradient(155deg, #ffffff 0%, #ffe4e6 100%);
  border-color: #fb7185;
}

.poker-card.suit-d {
  color: #1d4ed8;
  background: linear-gradient(155deg, #ffffff 0%, #dbeafe 100%);
  border-color: #60a5fa;
}

.poker-card.suit-c {
  color: #047857;
  background: linear-gradient(155deg, #ffffff 0%, #d1fae5 100%);
  border-color: #34d399;
}

/* Skin 2: 4-Color Vivid Full-Bleed Card Skin */
body.card-skin-4color-vivid .poker-card {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

body.card-skin-4color-vivid .poker-card.suit-s {
  background: linear-gradient(155deg, #334155 0%, #0f172a 100%);
  border-color: #94a3b8;
}

body.card-skin-4color-vivid .poker-card.suit-h {
  background: linear-gradient(155deg, #f43f5e 0%, #be123c 100%);
  border-color: #fda4af;
}

body.card-skin-4color-vivid .poker-card.suit-d {
  background: linear-gradient(155deg, #3b82f6 0%, #1d4ed8 100%);
  border-color: #93c5fd;
}

body.card-skin-4color-vivid .poker-card.suit-c {
  background: linear-gradient(155deg, #10b981 0%, #047857 100%);
  border-color: #6ee7b7;
}

/* Skin 3: Classic 2-Color Deck */
body.card-skin-2color .poker-card.suit-s,
body.card-skin-2color .poker-card.suit-c {
  color: #1e293b;
  background: #ffffff;
  border-color: #cbd5e1;
}

body.card-skin-2color .poker-card.suit-h,
body.card-skin-2color .poker-card.suit-d {
  color: #dc2626;
  background: #ffffff;
  border-color: #cbd5e1;
}

/* Anime Card Back (Pure CSS Geometric Diamond Crest, No Emoji) */
.poker-card-back {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  border-radius: 5px;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.06) 0 2px,
      transparent 2px 6px
    ),
    linear-gradient(145deg, #5b0926, #9d174d);
  border: 1.5px solid rgba(251, 191, 36, 0.85);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.poker-card-back::after {
  content: "";
  width: 44%;
  height: 32%;
  border: 1.5px solid rgba(253, 224, 71, 0.78);
  background: rgba(255, 133, 179, 0.28);
  border-radius: 2px;
  transform: rotate(45deg);
}

/* Announcement Banner */
.table-announcement-banner {
  background: rgba(18, 16, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  color: #fff;
  max-width: min(320px, 76vw);
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  animation: bannerPop 0.3s ease-out;
}

@keyframes bannerPop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================================================
   SEATS RING & 9-SEAT POSITIONS
   ========================================================= */

.seats-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.seat-box {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  z-index: 30;
  width: 70px;
}

/* Avatar Node */
.seat-avatar-wrap {
  position: relative;
  width: var(--seat-size-mobile);
  height: var(--seat-size-mobile);
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seat-avatar-svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.seat-box.is-active-turn .seat-avatar-wrap {
  border-color: var(--accent-gold);
  box-shadow: 0 0 14px var(--accent-gold);
  animation: pulseTurn 1.2s infinite alternate;
}

@keyframes pulseTurn {
  from { transform: scale(1); box-shadow: 0 0 8px var(--accent-gold); }
  to { transform: scale(1.06); box-shadow: 0 0 16px var(--accent-gold); }
}

/* Synchronized Circular Turn Action Clock Overlay */
.seat-countdown-svg {
  position: absolute;
  top: -6px;
  left: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  pointer-events: none;
  transform: rotate(-90deg); /* Start at 12 o'clock */
  z-index: 5;
  overflow: visible;
}

.seat-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 3;
}

.seat-ring-progress {
  fill: none;
  stroke: var(--accent-gold);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 182.21;
  stroke-dashoffset: 0;
  opacity: 0;
  transition: stroke-dashoffset 0.1s linear, stroke 0.2s ease, opacity 0.2s ease;
}

.seat-countdown-svg.is-active .seat-ring-progress {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6));
}

.seat-countdown-svg.is-active.is-time-bank .seat-ring-progress {
  stroke: var(--accent-blue);
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.6));
}

/* Low Time <= 8s Flash/Blink Crimson Red */
.seat-countdown-svg.is-active.is-low-time .seat-ring-progress {
  stroke: #ef4444 !important;
  animation: blink-red-ring 0.45s infinite alternate ease-in-out;
}

@keyframes blink-red-ring {
  0% {
    opacity: 1;
    filter: drop-shadow(0 0 4px #ef4444);
  }
  100% {
    opacity: 0.3;
    filter: drop-shadow(0 0 12px #ff2e4c);
  }
}

.seat-box.is-active-turn.is-low-time .seat-avatar-wrap {
  border-color: #ef4444 !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.8) !important;
  animation: pulse-low-time-wrap 0.45s infinite alternate ease-in-out;
}

@keyframes pulse-low-time-wrap {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.turn-countdown-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--status-danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  z-index: 10;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.turn-countdown-badge .ui-svg {
  width: 10px;
  height: 10px;
}

.turn-countdown-badge.is-low-time {
  background: #ff2e4c !important;
  animation: pulse-low-time-badge 0.45s infinite alternate ease-in-out;
}

@keyframes pulse-low-time-badge {
  0% { transform: scale(1); box-shadow: 0 0 4px #ef4444; }
  100% { transform: scale(1.15); box-shadow: 0 0 12px #ff2e4c; }
}

.turn-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  margin-right: 4px;
}

.turn-timer-pill.is-low-time {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
  animation: pulse-low-time-badge 0.45s infinite alternate ease-in-out;
}

#action-bar-status-msg.is-low-time {
  color: #fca5a5;
  font-weight: 600;
}

/* Nickname & Stack Badge */
.seat-info-pill {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(18, 16, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  width: 100%;
  text-align: center;
  cursor: pointer;
}

.seat-nickname {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-main);
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-stack {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent-gold);
}

/* Seat State & Role Badges */
.seat-role-badges {
  position: absolute;
  top: -6px;
  left: -6px;
  display: flex;
  gap: 2px;
}

.role-badge {
  font-size: 8px;
  font-weight: 800;
  padding: 1px 3px;
  border-radius: 3px;
  line-height: 1;
}

.role-dealer { background: #eab308; color: #000; }
.role-sb { background: #3b82f6; color: #fff; }
.role-bb { background: #8b5cf6; color: #fff; }
.role-host { background: #ec4899; color: #fff; }

.seat-state-tag {
  font-size: 8px;
  font-weight: 600;
  padding: 1px 3px;
  border-radius: 3px;
  margin-top: 1px;
}

.state-tag-sitout { background: rgba(245, 158, 11, 0.3); color: #fde68a; }
.state-tag-held { background: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.state-tag-ready { background: rgba(16, 185, 129, 0.3); color: #a7f3d0; }
.state-tag-allin { background: #dc2626; color: #fff; font-weight: 800; }
.state-tag-refill { background: rgba(56, 189, 248, 0.3); color: #bae6fd; }

/* Hole Cards Container */
.seat-hole-cards {
  display: flex;
  gap: 3px;
  margin-top: 2px;
  z-index: 10;
}

.seat-hole-cards .poker-card,
.seat-hole-cards .poker-card-back {
  width: 24px;
  height: 33px;
}

.seat-hole-cards .card-corner,
.showdown-player-cards .card-corner {
  padding: 1.5px 2.5px;
}

.seat-hole-cards .card-rank,
.showdown-player-cards .card-rank {
  font-size: 9.5px;
}

.seat-hole-cards .card-suit,
.showdown-player-cards .card-suit {
  font-size: 7.5px;
}

.seat-hole-cards .card-center-suit,
.showdown-player-cards .card-center-suit {
  font-size: 13px;
  bottom: 1.5px;
  right: 2.5px;
}

/* Enlarged Own Hole Cards for .seat-pos-0 (TRD-3) */
.seat-box.seat-pos-0 .seat-hole-cards {
  margin-top: 3px;
  gap: 5px;
}

.seat-box.seat-pos-0 .seat-hole-cards .poker-card,
.seat-box.seat-pos-0 .seat-hole-cards .poker-card-back {
  width: 42px;
  height: 58px;
  border-radius: 6px;
}

.seat-box.seat-pos-0 .seat-hole-cards .card-corner {
  padding: 2px 3.5px;
}

.seat-box.seat-pos-0 .seat-hole-cards .card-rank {
  font-size: 13.5px;
}

.seat-box.seat-pos-0 .seat-hole-cards .card-suit {
  font-size: 10px;
}

.seat-box.seat-pos-0 .seat-hole-cards .card-center-suit {
  font-size: 22px;
  bottom: 3px;
  right: 4px;
}

/* Bet Chip Pile in front of seat */
.seat-bet-pile {
  position: absolute;
  background: rgba(18, 16, 24, 0.9);
  border: 1px solid var(--accent-gold);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 25;
}

/* Empty Seat Box */
.seat-box.is-empty .seat-avatar-wrap {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-dim);
  font-size: 11px;
}

.seat-box.is-empty .seat-info-pill {
  opacity: 0.6;
}

/* Folded Seat */
.seat-box.is-folded {
  opacity: 0.45;
}

/* Host Quick Refill Button on Seat */
.btn-seat-quick-refill {
  position: absolute;
  bottom: -16px;
  background: var(--accent-pink);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.btn-seat-mute-emotes {
  position: absolute;
  top: -4px;
  right: -4px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
}

.btn-seat-mute-emotes.is-muted {
  background: var(--status-danger);
  color: #fff;
}

/* =========================================================
   PORTRAIT (DEFAULT / VERTICAL ELLIPSE) 9-SEAT POSITIONS (TRD-3)
   ========================================================= */

/* 9 Seat Coordinates on Vertical Ellipse */
.seat-pos-0 { left: 50%; top: 89%; } /* Bottom center: Own seat */
.seat-pos-1 { left: 13%; top: 76%; } /* Bottom left */
.seat-pos-2 { left: 6%;  top: 50%; } /* Mid left */
.seat-pos-3 { left: 13%; top: 19%; } /* Top left */
.seat-pos-4 { left: 33%; top: 7%;  } /* Top left-center */
.seat-pos-5 { left: 67%; top: 7%;  } /* Top right-center */
.seat-pos-6 { left: 87%; top: 19%; } /* Top right */
.seat-pos-7 { left: 94%; top: 50%; } /* Mid right */
.seat-pos-8 { left: 87%; top: 76%; } /* Bottom right */

/* Bet pile placements pointing inward without colliding with board cards */
.seat-pos-0 .seat-bet-pile { top: -20px; left: 50%; transform: translateX(-50%); }
.seat-pos-1 .seat-bet-pile { top: -14px; right: -14px; }
.seat-pos-2 .seat-bet-pile { top: -16px; right: -10px; }
.seat-pos-3 .seat-bet-pile { bottom: -14px; right: -14px; }
.seat-pos-4 .seat-bet-pile { bottom: -18px; left: 50%; transform: translateX(-50%); }
.seat-pos-5 .seat-bet-pile { bottom: -18px; left: 50%; transform: translateX(-50%); }
.seat-pos-6 .seat-bet-pile { bottom: -14px; left: -14px; }
.seat-pos-7 .seat-bet-pile { top: -16px; left: -10px; }
.seat-pos-8 .seat-bet-pile { top: -14px; left: -14px; }

/* Compact Portrait Phones (<= 420px width or short portrait height) */
@media (max-width: 420px), (max-height: 640px) and (orientation: portrait) {
  .poker-table-wrapper {
    padding: 14px 10px 26px;
  }

  .poker-felt {
    border-width: 7px;
    width: min(500px, calc(100cqw - 20px), calc((100cqh - 42px) * 0.78));
    height: min(680px, calc(100cqh - 42px), calc((100cqw - 20px) / 0.72));
  }

  .seat-box {
    width: 62px;
  }

  .seat-avatar-wrap {
    width: 36px;
    height: 36px;
  }

  .seat-nickname {
    max-width: 54px;
    font-size: 9px;
  }

  .community-board {
    gap: 3px;
  }

  .community-board .board-card-slot {
    width: 30px;
    height: 42px;
  }

  .community-board .card-rank {
    font-size: 11px;
  }

  .community-board .card-suit {
    font-size: 8px;
  }

  .community-board .card-center-suit {
    font-size: 15px;
    bottom: 1.5px;
    right: 2.5px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards {
    margin-top: 2px;
    gap: 4px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .poker-card,
  .seat-box.seat-pos-0 .seat-hole-cards .poker-card-back {
    width: 36px;
    height: 50px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .card-rank {
    font-size: 12px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .card-suit {
    font-size: 9px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .card-center-suit {
    font-size: 18px;
  }
}

/* Tablet Portrait (640px - 899px portrait) */
@media (min-width: 640px) and (max-width: 899px) and (orientation: portrait) {
  .poker-table-wrapper {
    padding: 26px 24px 44px;
  }

  .seat-box {
    width: 82px;
  }

  .seat-avatar-wrap {
    width: 48px;
    height: 48px;
  }

  .seat-nickname {
    max-width: 74px;
    font-size: 11px;
  }

  .community-board {
    gap: 6px;
  }

  .community-board .board-card-slot {
    width: 42px;
    height: 58px;
  }

  .community-board .card-rank {
    font-size: 13.5px;
  }

  .community-board .card-suit {
    font-size: 10px;
  }

  .community-board .card-center-suit {
    font-size: 24px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .poker-card,
  .seat-box.seat-pos-0 .seat-hole-cards .poker-card-back {
    width: 48px;
    height: 67px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .card-rank {
    font-size: 14.5px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .card-suit {
    font-size: 11px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .card-center-suit {
    font-size: 26px;
  }
}

/* =========================================================
   DESKTOP & LANDSCAPE (>= 900px OR LANDSCAPE >= 540px) HORIZONTAL ELLIPSE
   ========================================================= */

@media (min-width: 900px), (orientation: landscape) and (min-width: 540px) {
  .poker-table-wrapper {
    padding: 26px 32px 54px;
  }

  .table-center {
    top: 42%;
  }

  .poker-felt {
    width: min(940px, calc(100cqw - 64px), calc((100cqh - 80px) * 1.88));
    height: min(490px, calc(100cqh - 80px), calc((100cqw - 64px) / 1.88));
    border-width: 12px;
    border-radius: 999px;
  }

  .seat-box {
    width: 88px;
  }

  .seat-avatar-wrap {
    width: var(--seat-size-desktop);
    height: var(--seat-size-desktop);
  }

  .seat-nickname {
    max-width: 80px;
    font-size: 11px;
  }

  .seat-stack {
    font-size: 10px;
  }

  .community-board {
    gap: 6px;
  }

  .community-board .board-card-slot {
    width: 44px;
    height: 62px;
  }

  .community-board .card-rank {
    font-size: 14px;
  }

  .community-board .card-suit {
    font-size: 10.5px;
  }

  .community-board .card-center-suit {
    font-size: 25px;
    bottom: 3px;
    right: 5px;
  }

  .seat-hole-cards .poker-card,
  .seat-hole-cards .poker-card-back {
    width: 28px;
    height: 38px;
  }

  .seat-hole-cards .card-rank {
    font-size: 10.5px;
  }

  .seat-hole-cards .card-suit {
    font-size: 8px;
  }

  .seat-hole-cards .card-center-suit {
    font-size: 15px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .poker-card,
  .seat-box.seat-pos-0 .seat-hole-cards .poker-card-back {
    width: 48px;
    height: 67px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .card-rank {
    font-size: 14.5px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .card-suit {
    font-size: 11px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .card-center-suit {
    font-size: 26px;
    bottom: 4px;
    right: 5px;
  }

  /* 9 Seat Coordinates on Horizontal Ellipse */
  .seat-pos-0 { left: 50%; top: 87%; }
  .seat-pos-1 { left: 26%; top: 84%; }
  .seat-pos-2 { left: 7%;  top: 50%; }
  .seat-pos-3 { left: 20%; top: 14%; }
  .seat-pos-4 { left: 40%; top: 8%;  }
  .seat-pos-5 { left: 60%; top: 8%;  }
  .seat-pos-6 { left: 80%; top: 14%; }
  .seat-pos-7 { left: 93%; top: 50%; }
  .seat-pos-8 { left: 74%; top: 84%; }

  .seat-pos-0 .seat-bet-pile { top: -24px; left: 50%; transform: translateX(-50%); }
  .seat-pos-1 .seat-bet-pile { top: -20px; right: -20px; }
  .seat-pos-2 .seat-bet-pile { top: 50%; right: -28px; transform: translateY(-50%); }
  .seat-pos-3 .seat-bet-pile { bottom: -20px; right: -20px; }
  .seat-pos-4 .seat-bet-pile { bottom: -24px; left: 50%; transform: translateX(-50%); }
  .seat-pos-5 .seat-bet-pile { bottom: -24px; left: 50%; transform: translateX(-50%); }
  .seat-pos-6 .seat-bet-pile { bottom: -20px; left: -20px; }
  .seat-pos-7 .seat-bet-pile { top: 50%; left: -28px; transform: translateY(-50%); }
  .seat-pos-8 .seat-bet-pile { top: -20px; left: -20px; }
}

/* Compact Horizontal Screens (Short Laptops <= 620px height or Tablet/Mobile Landscape <= 960px) */
@media (orientation: landscape) and (max-height: 620px), (orientation: landscape) and (max-width: 960px) and (min-width: 540px) {
  .poker-table-wrapper {
    padding: 16px 26px 28px;
  }

  .poker-felt {
    width: min(780px, calc(100cqw - 52px), calc((100cqh - 44px) * 1.9));
    height: min(400px, calc(100cqh - 44px), calc((100cqw - 52px) / 1.9));
    border-width: 8px;
  }

  .seat-box {
    width: 68px;
  }

  .seat-avatar-wrap {
    width: 38px;
    height: 38px;
  }

  .seat-nickname {
    max-width: 60px;
    font-size: 10px;
  }

  .seat-stack {
    font-size: 9px;
  }

  .community-board {
    gap: 4px;
  }

  .community-board .board-card-slot {
    width: 34px;
    height: 48px;
  }

  .community-board .card-rank {
    font-size: 11.5px;
  }

  .community-board .card-suit {
    font-size: 8.5px;
  }

  .community-board .card-center-suit {
    font-size: 17px;
  }

  .seat-hole-cards .poker-card,
  .seat-hole-cards .poker-card-back {
    width: 22px;
    height: 30px;
  }

  .seat-hole-cards .card-rank {
    font-size: 9px;
  }

  .seat-hole-cards .card-suit {
    display: none;
  }

  .seat-hole-cards .card-center-suit {
    font-size: 12px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards {
    margin-top: 2px;
    gap: 4px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .poker-card,
  .seat-box.seat-pos-0 .seat-hole-cards .poker-card-back {
    width: 36px;
    height: 50px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .card-rank {
    font-size: 12px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .card-suit {
    display: block;
    font-size: 9px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .card-center-suit {
    font-size: 18px;
  }

  .main-pot-badge {
    font-size: 11px;
    padding: 3px 9px;
  }

  .btn-center-start {
    padding: 5px 12px;
    font-size: 11px;
  }
}

/* Ultra-Short Mobile Landscape (e.g. 667x375 or 844x390) */
@media (orientation: landscape) and (max-height: 440px) and (min-width: 540px) {
  .poker-table-wrapper {
    padding: 14px 24px 24px;
  }

  .poker-felt {
    width: min(720px, calc(100cqw - 48px), calc((100cqh - 38px) * 2.05));
    height: min(320px, calc(100cqh - 38px), calc((100cqw - 48px) / 1.9));
    border-width: 6px;
  }

  .table-center {
    top: 42%;
    gap: 3px;
  }

  .btn-center-start {
    margin-top: 2px;
    padding: 4px 12px;
    font-size: 11px;
  }

  .seat-pos-4,
  .seat-pos-5 {
    top: 6%;
  }

  .seat-pos-0 {
    top: 91%;
  }

  .seat-box {
    width: 58px;
  }

  .seat-avatar-wrap {
    width: 32px;
    height: 32px;
  }

  .seat-info-pill {
    padding: 1px 3px;
  }

  .seat-nickname {
    max-width: 52px;
    font-size: 9px;
  }

  .seat-stack {
    font-size: 8px;
  }

  .btn-seat-quick-refill {
    bottom: -13px;
  }

  .community-board {
    gap: 3px;
  }

  .community-board .board-card-slot {
    width: 28px;
    height: 40px;
  }

  .community-board .card-rank {
    font-size: 10.5px;
  }

  .community-board .card-suit {
    display: none;
  }

  .community-board .card-center-suit {
    font-size: 14px;
  }

  .seat-hole-cards .poker-card,
  .seat-hole-cards .poker-card-back {
    width: 20px;
    height: 28px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards {
    margin-top: 1px;
    gap: 3px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .poker-card,
  .seat-box.seat-pos-0 .seat-hole-cards .poker-card-back {
    width: 29px;
    height: 41px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .card-rank {
    font-size: 11px;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .card-suit {
    display: none;
  }

  .seat-box.seat-pos-0 .seat-hole-cards .card-center-suit {
    font-size: 15px;
  }

  .seat-pos-2 .seat-bet-pile { right: -18px; }
  .seat-pos-7 .seat-bet-pile { left: -18px; }
}

/* =========================================================
   BOTTOM ACTION BAR (FIXED 56px, BUTTONS >= 44x44px, TRD-3)
   ========================================================= */

.table-action-bar {
  width: 100%;
  height: var(--action-bar-height);
  flex-shrink: 0;
  background: rgba(14, 12, 20, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  position: relative;
  z-index: 100;
}

.action-bar-status {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-msg {
  font-size: 12px;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-controls-row {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.btn-action {
  min-width: 64px;
  height: 44px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  padding: 2px 8px;
  transition: all var(--trans-fast);
  color: #fff;
  overflow: hidden;
}

.btn-action .act-title,
.btn-action .act-sub {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-action .act-title {
  font-size: 13px;
  line-height: 1.1;
}

.btn-action .act-sub {
  font-size: 10px;
  opacity: 0.8;
  line-height: 1;
}

.btn-fold {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.btn-check-call {
  background: linear-gradient(135deg, #10b981, #047857);
}

.btn-bet-raise {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.btn-allin {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

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

.btn-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Emote Dock & Trigger Bar (Zero-misclick separation from Action Buttons) */
.emote-dock {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.emote-dock.is-cooldown .btn-emote-trigger,
.emote-dock.is-cooldown .btn-emote-dock-toggle {
  opacity: 0.55;
}

.btn-emote-dock-toggle {
  order: 2;
  position: relative;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 107, 157, 0.14);
  border: 1px solid rgba(255, 107, 157, 0.42);
  color: #fce7f3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--trans-fast);
}

.btn-emote-dock-toggle:hover {
  background: rgba(255, 107, 157, 0.25);
  border-color: var(--accent-pink);
  transform: translateY(-1px);
}

.emote-dock.is-open .btn-emote-dock-toggle {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.35), rgba(168, 85, 247, 0.35));
  border-color: var(--accent-pink);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 107, 157, 0.35);
}

.emote-dock-count {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  background: rgba(251, 191, 36, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde047;
}

.emote-trigger-bar {
  order: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-emote-trigger {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px;
  cursor: pointer;
  position: relative;
  color: var(--text-main);
  transition: transform var(--trans-fast), background var(--trans-fast), border-color var(--trans-fast);
}

.emote-trigger-icon {
  width: 24px;
  height: 24px;
  display: block;
  flex-shrink: 0;
}

.emote-trigger-icon .emote-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.emote-trigger-label {
  display: none;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-emote-trigger:hover:not(:disabled) {
  background: rgba(255, 107, 157, 0.22);
  border-color: rgba(255, 107, 157, 0.6);
  transform: scale(1.12);
}

.btn-emote-trigger:active:not(:disabled) {
  transform: scale(0.94);
}

.btn-emote-trigger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Desktop inline limit + 4x4 full-pack popover when open */
@media (min-width: 1024px) and (max-width: 1239px) {
  .emote-dock:not(.is-open) .btn-emote-trigger:nth-child(n + 6) {
    display: none;
  }
}

@media (min-width: 1240px) {
  .emote-dock:not(.is-open) .btn-emote-trigger:nth-child(n + 9) {
    display: none;
  }
}

@media (min-width: 1024px) {
  .emote-dock.is-open .emote-trigger-bar {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 10px;
    width: 312px;
    background: rgba(20, 16, 30, 0.98);
    border: 1px solid rgba(255, 107, 157, 0.35);
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    z-index: 250;
    animation: fadeInDownMenu 0.16s ease-out;
  }

  .emote-dock.is-open .btn-emote-trigger {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    padding: 6px 4px;
    gap: 3px;
  }

  .emote-dock.is-open .emote-trigger-icon {
    width: 30px;
    height: 30px;
  }

  .emote-dock.is-open .emote-trigger-label {
    display: block;
  }
}

/* Mobile & Tablet (<= 1023px): Emote dock floats cleanly ABOVE bottom action bar so Fold/Call/Raise/All-in NEVER replace or overlap emotes */
@media (max-width: 1023px) {
  .action-controls-row {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .btn-action {
    min-width: 0;
    flex: 1;
    padding: 2px 4px;
  }

  .turn-timer-pill {
    position: absolute;
    bottom: calc(var(--action-bar-height) + 8px);
    right: 8px;
    left: auto;
    transform: none;
    margin-right: 0;
    background: rgba(18, 16, 24, 0.94);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
    z-index: 105;
  }

  .turn-timer-pill.is-low-time {
    background: rgba(127, 29, 29, 0.96);
  }

  .action-bar-status {
    min-width: 0;
    justify-content: center;
  }

  .status-msg {
    font-size: 11px;
  }

  .emote-dock {
    position: absolute;
    left: 10px;
    bottom: calc(100% + 8px);
    margin-left: 0;
    z-index: 120;
  }

  .btn-emote-dock-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
  }

  .emote-dock-label {
    display: none;
  }

  .emote-dock-count {
    position: absolute;
    top: -4px;
    right: -4px;
    padding: 0 4px;
    line-height: 14px;
    background: #be185d;
    border-color: #fbcfe8;
    color: #fff;
  }

  .emote-trigger-bar {
    display: none;
  }

  .emote-dock.is-open .emote-trigger-bar {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 10px;
    width: min(276px, calc(100vw - 20px));
    max-height: calc(100dvh - 130px);
    overflow-y: auto;
    background: rgba(20, 16, 30, 0.98);
    border: 1px solid rgba(255, 107, 157, 0.38);
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 250;
    animation: fadeInDownMenu 0.16s ease-out;
  }

  .emote-dock.is-open .btn-emote-trigger {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    padding: 6px 3px;
    gap: 3px;
  }

  .emote-dock.is-open .emote-trigger-icon {
    width: 28px;
    height: 28px;
  }

  .emote-dock.is-open .emote-trigger-label {
    display: block;
    font-size: 9px;
  }
}

@media (max-width: 420px) {
  .turn-timer-pill {
    padding: 3px 7px;
    font-size: 10px;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  :root {
    --action-bar-height: 46px;
  }

  .table-action-bar {
    height: var(--action-bar-height);
    min-height: var(--action-bar-height);
    flex-wrap: nowrap;
    padding: 0 8px;
    gap: 8px;
  }

  .action-controls-row {
    height: 100%;
  }

  .btn-action {
    height: 36px;
  }

  .btn-action .act-title {
    font-size: 12px;
  }

  .btn-action .act-sub {
    font-size: 9px;
  }

  .emote-dock {
    bottom: calc(100% + 6px);
  }

  .btn-emote-dock-toggle {
    width: 36px;
    height: 36px;
  }

  .emote-dock.is-open .emote-trigger-bar {
    gap: 4px;
    padding: 8px;
    max-height: calc(100dvh - 102px);
  }
}

/* Emote Cooldown Overlay */
.emote-cooldown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* Inner Emote SVG Keyframe Animations (idle & floating expressiveness) */
.em-anim-wave,
.em-anim-spin,
.em-anim-spin-slow,
.em-anim-twinkle,
.em-anim-bob,
.em-anim-rise,
.em-anim-drop,
.em-anim-shiver,
.em-anim-tears,
.em-anim-bounce,
.em-anim-flame,
.em-anim-heart,
.em-anim-zzz,
.em-anim-pulse {
  transform-box: fill-box;
  transform-origin: center;
}

.floating-emote .em-anim-wave,
.btn-emote-trigger:hover .em-anim-wave {
  animation: emWaveMotion 0.55s ease-in-out infinite alternate;
}

.floating-emote .em-anim-spin,
.btn-emote-trigger:hover .em-anim-spin {
  animation: emSpinMotion 1.2s linear infinite;
}

.floating-emote .em-anim-spin-slow,
.btn-emote-trigger:hover .em-anim-spin-slow {
  animation: emSpinMotion 3s linear infinite;
}

.floating-emote .em-anim-twinkle,
.btn-emote-trigger:hover .em-anim-twinkle {
  animation: emTwinkleMotion 0.65s ease-in-out infinite alternate;
}

.floating-emote .em-anim-bob,
.btn-emote-trigger:hover .em-anim-bob {
  animation: emBobMotion 0.7s ease-in-out infinite alternate;
}

.floating-emote .em-anim-rise,
.btn-emote-trigger:hover .em-anim-rise {
  animation: emRiseMotion 1.1s ease-in-out infinite;
}

.floating-emote .em-anim-drop,
.btn-emote-trigger:hover .em-anim-drop {
  animation: emDropMotion 0.85s ease-in infinite;
}

.floating-emote .em-anim-shiver,
.btn-emote-trigger:hover .em-anim-shiver {
  animation: emShiverMotion 0.16s ease-in-out infinite alternate;
}

.floating-emote .em-anim-tears,
.btn-emote-trigger:hover .em-anim-tears {
  animation: emTearMotion 0.45s ease-in-out infinite alternate;
}

.floating-emote .em-anim-bounce,
.btn-emote-trigger:hover .em-anim-bounce {
  animation: emBounceMotion 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) infinite alternate;
}

.floating-emote .em-anim-flame,
.btn-emote-trigger:hover .em-anim-flame {
  animation: emFlameMotion 0.35s ease-in-out infinite alternate;
}

.floating-emote .em-anim-heart,
.btn-emote-trigger:hover .em-anim-heart {
  animation: emHeartMotion 0.9s ease-in-out infinite alternate;
}

.floating-emote .em-anim-zzz,
.btn-emote-trigger:hover .em-anim-zzz {
  animation: emZzzMotion 1.2s ease-out infinite;
}

.floating-emote .em-anim-pulse,
.btn-emote-trigger:hover .em-anim-pulse {
  animation: emPulseMotion 0.55s ease-in-out infinite alternate;
}

@keyframes emWaveMotion {
  0% { transform: rotate(-10deg); }
  100% { transform: rotate(12deg); }
}

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

@keyframes emTwinkleMotion {
  0% { transform: scale(0.85) rotate(-8deg); opacity: 0.75; }
  100% { transform: scale(1.18) rotate(8deg); opacity: 1; }
}

@keyframes emBobMotion {
  0% { transform: translateY(1px); }
  100% { transform: translateY(-3px); }
}

@keyframes emRiseMotion {
  0% { transform: translateY(2px); opacity: 0.35; }
  60% { opacity: 1; }
  100% { transform: translateY(-4px); opacity: 0; }
}

@keyframes emDropMotion {
  0% { transform: translateY(-3px) scale(0.9); opacity: 0.85; }
  80% { transform: translateY(4px) scale(1.06); opacity: 1; }
  100% { transform: translateY(6px) scale(0.85); opacity: 0; }
}

@keyframes emShiverMotion {
  0% { transform: translateX(-1.5px) rotate(-2deg); }
  100% { transform: translateX(1.5px) rotate(2deg); }
}

@keyframes emTearMotion {
  0% { transform: scaleY(0.92); opacity: 0.8; }
  100% { transform: scaleY(1.08); opacity: 1; }
}

@keyframes emBounceMotion {
  0% { transform: translateY(1px) scale(0.96); }
  100% { transform: translateY(-4px) scale(1.08); }
}

@keyframes emFlameMotion {
  0% { transform: scaleX(0.94) scaleY(0.98) skewX(-2deg); }
  100% { transform: scaleX(1.06) scaleY(1.08) skewX(2deg); }
}

@keyframes emHeartMotion {
  0% { transform: translateY(1px) scale(0.9); }
  100% { transform: translateY(-4px) scale(1.18); }
}

@keyframes emZzzMotion {
  0% { transform: translate(0, 2px) scale(0.85); opacity: 0.3; }
  50% { opacity: 1; }
  100% { transform: translate(3px, -5px) scale(1.1); opacity: 0; }
}

@keyframes emPulseMotion {
  0% { transform: scale(0.9); }
  100% { transform: scale(1.15); }
}

/* Floating Emote Bubble */
.table-effects-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
}

.floating-emote {
  position: absolute;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  animation: emoteFloat 1.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.78));
}

.floating-emote.emote-allin_fire,
.floating-emote.emote-gg,
.floating-emote.emote-sparkle,
.floating-emote.emote-haha {
  width: 60px;
  height: 60px;
  filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.65)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.75));
}

.floating-emote.emote-shocked,
.floating-emote.emote-crying,
.floating-emote.emote-sweat {
  animation: emoteFloatShake 1.9s ease-out forwards;
}

.floating-emote .emote-svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes emoteFloat {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(0.4); }
  16% { opacity: 1; transform: translate(-50%, -18px) scale(1.26); }
  30% { opacity: 1; transform: translate(-50%, -26px) scale(1.06); }
  80% { opacity: 1; transform: translate(-50%, -44px) scale(1.02); }
  100% { opacity: 0; transform: translate(-50%, -66px) scale(0.82); }
}

@keyframes emoteFloatShake {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(0.45); }
  14% { opacity: 1; transform: translate(calc(-50% - 4px), -18px) scale(1.25); }
  22% { opacity: 1; transform: translate(calc(-50% + 4px), -24px) scale(1.12); }
  30% { opacity: 1; transform: translate(calc(-50% - 3px), -28px) scale(1.06); }
  40% { opacity: 1; transform: translate(-50%, -32px) scale(1.04); }
  80% { opacity: 1; transform: translate(-50%, -44px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -64px) scale(0.8); }
}

/* Celebration Confetti / Sakura Petals / Sparkles */
.celebration-particle {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  opacity: 0;
  animation: celebrationBurst var(--dur, 1100ms) cubic-bezier(0.16, 1, 0.3, 1) var(--delay, 0ms) forwards;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.celebration-particle svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes celebrationBurst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
  }
  18% {
    opacity: 1;
    transform: translate(calc(-50% + var(--tx, 0px) * 0.45), calc(-50% + var(--ty, -40px) * 0.45)) scale(1.15) rotate(calc(var(--rot, 180deg) * 0.35));
  }
  75% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, -40px) + 52px)) scale(0.55) rotate(var(--rot, 180deg));
  }
}

/* Extra keyframes above */

/* Betting Slider Drawer */
.betting-drawer {
  position: absolute;
  bottom: calc(var(--action-bar-height) + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: min(380px, calc(100vw - 16px));
  max-height: calc(100dvh - var(--action-bar-height) - 52px);
  overflow-y: auto;
  background: rgba(20, 17, 30, 0.97);
  border: 1px solid var(--accent-pink-glow);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.78);
  z-index: 135;
  animation: slideUp 0.2s ease-out;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.betting-drawer.is-allin {
  border-color: rgba(168, 85, 247, 0.9);
  box-shadow: 0 -8px 30px rgba(147, 51, 234, 0.35), 0 8px 24px rgba(0, 0, 0, 0.78);
}

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

.betting-drawer-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.betting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.betting-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.betting-drawer.is-allin .betting-title {
  color: #e9d5ff;
}

.btn-close-sm {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

.bet-presets-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.btn-preset {
  padding: 7px 4px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}

.btn-preset:hover {
  background: rgba(255, 255, 255, 0.16);
}

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

.btn-preset.is-active {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.3), rgba(168, 85, 247, 0.28));
  border-color: var(--accent-pink);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(244, 114, 182, 0.25);
}

.bet-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bet-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bet-slider {
  flex: 1;
  min-width: 0;
  accent-color: var(--accent-pink);
  cursor: pointer;
}

.betting-drawer.is-allin .bet-slider {
  accent-color: #a855f7;
}

.bet-slider-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bet-scale-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.bet-scale-tag:hover,
.bet-scale-tag.is-active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.26);
  color: #fff;
}

.bet-scale-tag.bet-scale-allin {
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.32);
  background: rgba(147, 51, 234, 0.14);
}

.bet-scale-tag.bet-scale-allin:hover,
.bet-scale-tag.bet-scale-allin.is-active {
  background: rgba(147, 51, 234, 0.36);
  border-color: rgba(192, 132, 252, 0.85);
  color: #fff;
}

.bet-slider-allin-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #9333ea, #ec4899);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.btn-allin-confirm {
  background: linear-gradient(135deg, #9333ea, #7e22ce) !important;
  border-color: rgba(192, 132, 252, 0.7) !important;
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.45);
}

.bet-number-input {
  width: 76px;
  flex-shrink: 0;
  padding: 6px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 700;
  text-align: right;
}

/* =========================================================
   HOST DRAWER & MODALS
   ========================================================= */

.host-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 100vw);
  max-width: 100vw;
  height: 100%;
  height: 100dvh;
  background: var(--bg-card);
  border-left: 1px solid var(--bg-card-border);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
  z-index: 500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideDrawer 0.25s ease-out;
}

@keyframes slideDrawer {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.host-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.host-drawer-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold);
  min-width: 0;
}

.btn-close-drawer {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.host-drawer-scroll {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.host-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
}

.host-section.danger-zone {
  border-bottom: none;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-count {
  font-size: 10px;
  font-weight: 700;
  background: var(--accent-pink);
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.host-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.host-btn-row .btn {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-size: 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

/* Pending Join Requests List */
.pending-requests-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pending-request-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 10px;
}

.request-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.request-avatar-small {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.request-nickname {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.request-actions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.request-seat-select {
  flex: 1;
  min-width: 110px;
  padding: 6px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 11px;
}

.invite-copy-box {
  display: flex;
  gap: 6px;
}

.invite-link-input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
}

.invite-copy-box .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.empty-list-note {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  padding: 10px 0;
}

/* =========================================================
   SHOWDOWN RESULT PANEL (5-Second Overlay)
   ========================================================= */

.showdown-overlay {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 16px));
  max-height: calc(100% - 16px);
  overflow-y: auto;
  z-index: 85;
  pointer-events: auto;
  animation: fadeInDown 0.25s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translate(-50%, -15px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.showdown-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(30, 22, 48, 0.97), rgba(16, 12, 26, 0.98));
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 24px rgba(251, 191, 36, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  backdrop-filter: blur(14px);
}

.showdown-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(110deg, transparent, rgba(251, 191, 36, 0.12), rgba(255, 107, 157, 0.1), transparent);
  animation: showdownShimmer 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes showdownShimmer {
  0% { left: -80%; }
  60%, 100% { left: 130%; }
}

.showdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.showdown-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.showdown-trophy {
  display: inline-flex;
  align-items: center;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.65));
}

.showdown-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-gold);
}

.showdown-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.showdown-timer-badge {
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.showdown-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 12px;
}

.showdown-progress-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-pink));
  transition: width 0.1s linear;
}

.showdown-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.showdown-board-section {
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.showdown-board-cards {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.showdown-board-cards .poker-card {
  width: 36px;
  height: 50px;
}

.showdown-players-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.showdown-players-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.showdown-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  gap: 8px;
  transition: all var(--trans-fast);
  animation: resultRowSlide 0.32s ease-out backwards;
  animation-delay: var(--row-delay, 0ms);
}

@keyframes resultRowSlide {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.showdown-player-row.is-winner {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.18), rgba(255, 107, 157, 0.1));
  border-color: var(--accent-gold);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.25);
}

.showdown-player-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.showdown-player-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.showdown-player-avatar svg {
  width: 100%;
  height: 100%;
}

.showdown-player-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.showdown-player-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.showdown-player-handname {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-pink);
}

.showdown-player-row.is-winner .showdown-player-handname {
  color: var(--accent-gold);
}

.showdown-player-cards {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.showdown-player-cards .showdown-cards-row {
  display: flex;
  gap: 4px;
}

.showdown-player-cards .poker-card {
  width: 26px;
  height: 36px;
  transition: transform var(--trans-fast), opacity var(--trans-fast);
}

/* Winning hand: larger cards with golden glow */
.showdown-player-cards.is-winner-hand .poker-card {
  width: 38px;
  height: 53px;
  border: 1.5px solid var(--accent-gold) !important;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.75), 0 4px 10px rgba(0, 0, 0, 0.6);
}

.showdown-player-cards.is-winner-hand .card-rank {
  font-size: 13px;
}

.showdown-player-cards.is-winner-hand .card-suit {
  font-size: 9.5px;
}

.showdown-player-cards.is-winner-hand .card-center-suit {
  font-size: 20px;
  bottom: 2.5px;
  right: 4px;
}

/* Losing hands: smaller, dimmed */
.showdown-player-cards.is-loser-hand .poker-card {
  width: 24px;
  height: 33px;
  opacity: 0.68;
  filter: grayscale(0.28);
}

.showdown-player-cards.is-loser-hand .card-suit {
  display: none;
}

.showdown-player-cards.is-loser-hand .card-center-suit {
  font-size: 12px;
}

/* Winner crown above the hand */
.winner-crown {
  width: 30px;
  height: 21px;
  margin-bottom: 2px;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.9));
  animation: crownBob 1.2s ease-in-out infinite alternate;
  pointer-events: none;
}

.winner-crown svg,
.loser-emblem svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Expressive anime gloom emblem above losing hands */
.loser-emblem {
  width: 26px;
  height: 19px;
  margin-bottom: 2px;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.55));
  animation: loserSway 1.5s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes crownBob {
  0% { transform: translateY(0) rotate(-4deg); }
  100% { transform: translateY(-3px) rotate(4deg); }
}

@keyframes loserSway {
  0% { transform: translateY(0) rotate(2deg); opacity: 0.85; }
  100% { transform: translateY(2px) rotate(-3deg); opacity: 1; }
}

.showdown-player-win {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  min-width: 70px;
}

.showdown-win-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.showdown-pot-names {
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 1px;
}

.showdown-loss-badge {
  font-size: 11px;
  font-weight: 700;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.showdown-even-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.showdown-fold-note {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 2px;
}

.showdown-fold-note.winner-note {
  color: var(--accent-gold);
  font-style: normal;
  font-weight: 600;
}

/* Showdown Compact Banner Style (Non-blocking on table) */
.showdown-overlay.is-compact-banner {
  top: 8px;
  width: min(440px, calc(100% - 16px));
}

.showdown-overlay.is-compact-banner .showdown-card {
  padding: 8px 12px;
}

.showdown-overlay.is-compact-banner .showdown-progress-track {
  margin-bottom: 6px;
}

.showdown-overlay.is-compact-banner .showdown-board-section,
.showdown-overlay.is-compact-banner .showdown-players-section {
  display: none !important;
}

.showdown-compact-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: #fff;
  padding: 4px 0;
  text-align: center;
}

.showdown-compact-summary em {
  font-style: normal;
  color: var(--accent-gold);
  font-weight: 700;
}

.showdown-compact-summary strong {
  color: #fef08a;
}

/* Showdown Revealed Cards at Seat Positions */
.seat-hole-cards.is-showdown-revealed {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 35;
  margin-top: 2px;
}

.seat-hole-cards.is-showdown-revealed .showdown-cards-row {
  display: flex;
  gap: 4px;
}

.seat-hole-cards.is-showdown-revealed .poker-card {
  width: 30px;
  height: 42px;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7), 0 0 8px rgba(251, 191, 36, 0.6);
  border: 1px solid #fbbf24;
}

.seat-hole-cards.is-showdown-revealed .card-rank {
  font-size: 11px;
}

.seat-hole-cards.is-showdown-revealed .card-suit {
  font-size: 8px;
}

.seat-hole-cards.is-showdown-revealed .card-center-suit {
  font-size: 15px;
}

@media (min-width: 900px) and (min-height: 621px) {
  .seat-hole-cards.is-showdown-revealed .poker-card {
    width: 38px;
    height: 52px;
  }
}

/* Winning hand at seat: enlarged cards + crown */
.seat-hole-cards.is-showdown-revealed.is-winner-hand {
  z-index: 40;
}

.seat-hole-cards.is-showdown-revealed.is-winner-hand .poker-card {
  width: 40px;
  height: 56px;
  border: 2px solid #fbbf24 !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.75), 0 0 14px rgba(251, 191, 36, 0.95);
}

.seat-hole-cards.is-showdown-revealed.is-winner-hand .card-rank {
  font-size: 13px;
}

.seat-hole-cards.is-showdown-revealed.is-winner-hand .card-suit {
  font-size: 9.5px;
}

.seat-hole-cards.is-showdown-revealed.is-winner-hand .card-center-suit {
  font-size: 21px;
  bottom: 3px;
  right: 4px;
}

.seat-hole-cards.is-showdown-revealed.is-winner-hand .winner-crown {
  width: 34px;
  height: 24px;
  margin-bottom: 2px;
}

.seat-hole-cards.is-showdown-revealed.is-winner-hand .seat-showdown-hand-tag {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1c1917;
  font-size: 10px;
  font-weight: 800;
}

/* Losing hands at seat: smaller and dimmed */
.seat-hole-cards.is-showdown-revealed.is-loser-hand .poker-card {
  width: 26px;
  height: 36px;
  opacity: 0.72;
  filter: grayscale(0.25);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.seat-hole-cards.is-showdown-revealed.is-loser-hand .card-rank {
  font-size: 10px;
}

.seat-hole-cards.is-showdown-revealed.is-loser-hand .card-suit {
  display: none;
}

.seat-hole-cards.is-showdown-revealed.is-loser-hand .card-center-suit {
  font-size: 13px;
}

.seat-hole-cards.is-showdown-revealed.is-loser-hand .seat-showdown-hand-tag {
  border-color: rgba(148, 163, 184, 0.45);
  color: #94a3b8;
  opacity: 0.85;
}

.seat-hole-cards.is-showdown-revealed.is-loser-hand .loser-emblem {
  width: 28px;
  height: 20px;
}

@media (min-width: 900px) and (min-height: 621px) {
  .seat-hole-cards.is-showdown-revealed.is-winner-hand .poker-card {
    width: 50px;
    height: 70px;
  }

  .seat-hole-cards.is-showdown-revealed.is-winner-hand .card-rank {
    font-size: 15px;
  }

  .seat-hole-cards.is-showdown-revealed.is-winner-hand .card-suit {
    font-size: 11px;
  }

  .seat-hole-cards.is-showdown-revealed.is-winner-hand .card-center-suit {
    font-size: 27px;
  }

  .seat-hole-cards.is-showdown-revealed.is-winner-hand .winner-crown {
    width: 44px;
    height: 30px;
  }

  .seat-hole-cards.is-showdown-revealed.is-loser-hand .poker-card {
    width: 32px;
    height: 44px;
  }

  .seat-hole-cards.is-showdown-revealed.is-loser-hand .card-rank {
    font-size: 11px;
  }

  .seat-hole-cards.is-showdown-revealed.is-loser-hand .card-suit {
    display: none;
  }

  .seat-hole-cards.is-showdown-revealed.is-loser-hand .card-center-suit {
    font-size: 15px;
    bottom: 2px;
    right: 3px;
  }

  .seat-hole-cards.is-showdown-revealed.is-loser-hand .loser-emblem {
    width: 36px;
    height: 26px;
  }
}

@media (max-width: 440px) {
  .showdown-card {
    padding: 10px 12px;
  }

  .showdown-player-row {
    padding: 6px 8px;
    gap: 6px;
  }

  .showdown-player-left {
    gap: 6px;
  }

  .showdown-player-handname {
    font-size: 10px;
    line-height: 1.2;
  }

  .showdown-player-cards.is-winner-hand .poker-card {
    width: 32px;
    height: 45px;
  }

  .showdown-player-cards.is-winner-hand .card-rank {
    font-size: 11.5px;
  }

  .showdown-player-cards.is-winner-hand .card-suit {
    font-size: 8.5px;
  }

  .showdown-player-cards.is-winner-hand .card-center-suit {
    font-size: 17px;
  }

  .showdown-player-win {
    min-width: 54px;
  }

  .showdown-win-badge,
  .showdown-loss-badge,
  .showdown-even-badge {
    font-size: 10px;
    padding: 2px 5px;
  }
}

.seat-showdown-hand-tag {
  background: rgba(18, 16, 24, 0.95);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  margin-top: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Previous Hand Showdown cards badge for seat 0 when new hand is already running */
.seat-showdown-prev-cards {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(18, 16, 24, 0.92);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  margin-top: 2px;
  z-index: 35;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.seat-showdown-prev-cards .prev-cards-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dim);
}

.seat-showdown-prev-cards .prev-cards-faces {
  display: flex;
  gap: 2px;
}

.seat-showdown-prev-cards .prev-cards-faces .poker-card {
  width: 21px;
  height: 29px;
}

.seat-showdown-prev-cards .prev-cards-faces .card-corner {
  padding: 1px 2px;
}

.seat-showdown-prev-cards .prev-cards-faces .card-rank {
  font-size: 9px;
}

.seat-showdown-prev-cards .prev-cards-faces .card-suit {
  display: none;
}

.seat-showdown-prev-cards .prev-cards-faces .card-center-suit {
  font-size: 11px;
  bottom: 1px;
  right: 2px;
}

.seat-showdown-prev-cards .seat-showdown-hand-tag {
  margin-top: 0;
  padding: 1px 4px;
  font-size: 8px;
}

/* Golden Winner Highlight at Seat */
.seat-box.is-showdown-winner .seat-avatar-wrap {
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.95), 0 0 34px rgba(255, 107, 157, 0.55) !important;
  animation: winnerPulse 1s infinite alternate ease-in-out;
}

.seat-box.is-showdown-loser .seat-avatar-wrap {
  filter: saturate(0.55) brightness(0.8);
  border-color: rgba(148, 163, 184, 0.45);
}

@keyframes winnerPulse {
  0% { transform: scale(1); box-shadow: 0 0 12px rgba(251, 191, 36, 0.7); }
  100% { transform: scale(1.08); box-shadow: 0 0 24px rgba(251, 191, 36, 1); }
}

/* Floating Chip Result Delta Badge at Seat */
.seat-result-delta {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-top: 2px;
  white-space: nowrap;
  z-index: 35;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.seat-result-delta.is-win {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: 1px solid rgba(16, 185, 129, 0.8);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.6);
  animation: bounceDelta 0.5s ease-out;
}

.seat-result-delta.is-loss {
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  border: 1px solid rgba(239, 68, 68, 0.8);
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
}

@keyframes bounceDelta {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

/* Dialogs & Modals */
.app-dialog {
  border: none;
  background: transparent;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100dvh;
  padding: 12px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  backdrop-filter: blur(8px);
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
}

.app-dialog[open] {
  display: flex;
}

.dialog-content {
  width: min(500px, 100%);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  margin: auto 0;
}

.summary-dialog-card {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 107, 157, 0.16);
}

.summary-effects-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  overflow: hidden;
}

.summary-dialog-header {
  position: relative;
  z-index: 1;
}

.summary-hero-emblem {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 14px rgba(251, 191, 36, 0.6));
  animation: crownBob 1.6s ease-in-out infinite alternate;
}

/* Top-3 MVP Podium */
.summary-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px 4px 4px;
}

.podium-card {
  flex: 1;
  max-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  animation: resultRowSlide 0.35s ease-out backwards;
}

.podium-card.podium-rank-1 {
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.2), rgba(255, 107, 157, 0.12));
  border-color: var(--accent-gold);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.28);
  padding: 10px 8px;
  transform: translateY(-4px);
}

.podium-card.podium-rank-2 {
  border-color: rgba(226, 232, 240, 0.45);
  animation-delay: 60ms;
}

.podium-card.podium-rank-3 {
  border-color: rgba(245, 158, 11, 0.4);
  animation-delay: 120ms;
}

.podium-rank-emblem {
  width: 24px;
  height: 18px;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.podium-rank-emblem svg {
  width: 100%;
  height: 100%;
}

.podium-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 4px;
}

.podium-rank-1 .podium-avatar {
  width: 48px;
  height: 48px;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

.podium-avatar svg {
  width: 100%;
  height: 100%;
}

.podium-name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-net {
  font-size: 11px;
  font-weight: 800;
  margin-top: 2px;
}

.podium-net.is-gain { color: #34d399; }
.podium-net.is-loss { color: #fca5a5; }

.summary-table tbody tr {
  animation: resultRowSlide 0.3s ease-out backwards;
  animation-delay: var(--row-delay, 0ms);
}

.summary-table tbody tr.summary-row-top {
  background: rgba(251, 191, 36, 0.08);
}

.summary-player-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-rank-badge {
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
}

.summary-mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.summary-mini-avatar svg {
  width: 100%;
  height: 100%;
}

.summary-player-name {
  font-weight: 600;
  max-width: 115px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anime-card-sm {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.dialog-header {
  text-align: center;
  margin-bottom: 16px;
}

.dialog-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.dialog-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.entertainment-disclaimer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.1);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  text-align: center;
}

.table-responsive {
  max-height: 220px;
  overflow: auto;
  margin-bottom: 16px;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.summary-table th {
  text-align: left;
  padding: 8px 6px;
  color: var(--text-dim);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.text-right {
  text-align: right;
}

.net-gain {
  color: var(--status-success);
  font-weight: 700;
}

.net-loss {
  color: var(--status-danger);
  font-weight: 700;
}

.dialog-footer {
  display: flex;
  gap: 8px;
}

.dialog-footer .btn {
  flex: 1;
}

@media (max-width: 480px) {
  .summary-podium {
    gap: 5px;
  }

  .podium-card {
    padding: 6px 4px;
    min-width: 0;
  }

  .podium-rank-1 .podium-avatar {
    width: 40px;
    height: 40px;
  }

  .summary-player-name {
    max-width: 82px;
  }

  .summary-table {
    font-size: 11px;
  }

  .summary-table th,
  .summary-table td {
    padding: 6px 4px;
  }

  .dialog-footer {
    flex-direction: column;
  }
}

.dialog-title-sm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.dialog-body-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Tooltip for Exact Stack */
.stack-tooltip {
  position: fixed;
  background: #111;
  color: #fff;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--accent-gold);
  pointer-events: none;
  z-index: 1100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}
