:root {
  --felt-center: #145a3a;
  --felt-mid: #0e432b;
  --felt-edge: #072718;
  --wood-rim: #4b2612;
  --wood-highlight: #6f3b1e;
  --gold: #f5c451;
  --gold-strong: #ffd978;
  --ivory: #fbf7ee;
  --text-muted: #c6d8ce;
  --danger: #e05a5a;
  --success: #38c97a;
  --panel-bg: rgba(8, 30, 20, 0.88);
  --panel-border: rgba(245, 196, 81, 0.34);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  --font-display: 'Georgia', 'Times New Roman', serif;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  background: #061d12;
  color: var(--ivory);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

#app {
  width: 100%;
  min-height: 100dvh;
}

.screen {
  display: none;
  width: 100%;
  min-height: 100dvh;
}

.screen.active {
  display: flex;
}

/* ==================== BOTONES Y ELEMENTOS COMUNES ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  font-family: inherit;
  text-decoration: none;
  user-select: none;
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-lg {
  padding: 0.95rem 1.45rem;
  font-size: 1.05rem;
  min-height: 50px;
}

.btn-sm {
  padding: 0.52rem 0.95rem;
  font-size: 0.88rem;
  border-radius: 10px;
}

.btn-xs {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #f6ca5c 0%, #d99b26 100%);
  color: #1f1305;
  box-shadow: 0 6px 20px rgba(217, 155, 38, 0.35);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ivory);
  border-color: rgba(245, 196, 81, 0.45);
  backdrop-filter: blur(8px);
}

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

.btn-ghost {
  background: rgba(0, 0, 0, 0.28);
  color: var(--ivory);
  border-color: rgba(255, 255, 255, 0.14);
}

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

.btn-gold {
  background: linear-gradient(135deg, #ffe787 0%, #f0a818 100%);
  color: #211202;
  box-shadow: 0 0 24px rgba(255, 217, 120, 0.65);
  animation: pulseGold 1.4s infinite ease-in-out;
}

.btn-close {
  background: linear-gradient(135deg, #43d685 0%, #1d9b56 100%);
  color: #052012;
  box-shadow: 0 0 20px rgba(56, 201, 122, 0.45);
}

.btn-back {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-info {
  background: rgba(245, 196, 81, 0.18);
  color: var(--gold-strong);
  border: 1px solid rgba(245, 196, 81, 0.35);
}

/* ==================== MENÚ PRINCIPAL ==================== */
.screen-menu {
  position: relative;
  overflow: hidden;
}

.menu-felt-bg {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(1.5rem + env(safe-area-inset-top, 0px)) 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at 50% 42%, var(--felt-center) 0%, var(--felt-mid) 52%, var(--felt-edge) 100%);
  box-shadow: inset 0 0 0 10px var(--wood-rim), inset 0 0 0 13px rgba(245, 196, 81, 0.28);
}

.menu-cards-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.bg-card {
  position: absolute;
  width: clamp(92px, 16vw, 175px);
  height: auto;
  border-radius: 10px;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.58));
  opacity: 0.92;
  transition: transform 0.6s ease;
}

/* Abanico amplio detrás de las letras "Chinchón" */
.bg-card-1 { transform: translate(-245px, -115px) rotate(-28deg); }
.bg-card-2 { transform: translate(-150px, -148px) rotate(-16deg); }
.bg-card-3 { transform: translate(-52px, -162px) rotate(-5deg); }
.bg-card-4 { transform: translate(54px, -160px) rotate(6deg); z-index: 2; }
.bg-card-5 { transform: translate(156px, -144px) rotate(17deg); }
.bg-card-6 { transform: translate(248px, -110px) rotate(28deg); }
.bg-card-7 { transform: translate(-210px, 108px) rotate(-18deg); opacity: 0.78; }
.bg-card-8 { transform: translate(212px, 108px) rotate(18deg); opacity: 0.78; }

.menu-center-card {
  position: relative;
  z-index: 3;
  width: min(100%, 490px);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.2rem, 4vw, 2.2rem);
  border-radius: 28px;
  background: radial-gradient(circle at 50% 34%, rgba(7, 29, 19, 0.68) 0%, rgba(7, 29, 19, 0.44) 60%, rgba(7, 29, 19, 0.12) 100%);
  border: none;
  box-shadow: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.menu-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-strong);
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.menu-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 12vw, 6rem);
  line-height: 0.96;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff9e6 0%, #f5c451 54%, #c98412 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.92)) drop-shadow(0 0 26px rgba(0, 0, 0, 0.7));
}

.menu-subtitle {
  color: var(--ivory);
  font-size: 0.96rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
}

.menu-actions {
  width: min(100%, 360px);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 0.25rem;
}

.menu-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.install-preview-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(245, 196, 81, 0.28);
}

.install-app-icon {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.48);
  flex-shrink: 0;
}

.install-app-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.install-app-meta strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold-strong);
}

.install-app-meta span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==================== PANELES SECUNDARIOS (BOTS / AMIGOS / LOBBY) ==================== */
.screen-panel {
  align-items: center;
  justify-content: center;
  padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at 50% 35%, var(--felt-center) 0%, var(--felt-mid) 55%, var(--felt-edge) 100%);
}

.panel-card {
  width: min(100%, 480px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  padding: clamp(1.3rem, 3.5vw, 2rem);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.panel-card h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--gold-strong);
}

.panel-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ivory);
  font-size: 1rem;
  font-family: inherit;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 196, 81, 0.22);
}

.field-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.bots-selector {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.45rem;
}

.pill {
  padding: 0.65rem 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ivory);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.pill.active {
  background: var(--gold);
  color: #1f1305;
  border-color: var(--gold-strong);
}

.friends-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin-top: 0.4rem;
}

.choice-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  padding: 1.15rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(245, 196, 81, 0.3);
  color: var(--ivory);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.choice-tile:hover {
  background: rgba(245, 196, 81, 0.14);
  transform: translateY(-2px);
}

.choice-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  font-weight: 800;
}

.choice-tile strong {
  font-size: 1.1rem;
  color: var(--gold-strong);
}

.choice-tile span:last-child {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.form-error {
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  background: rgba(224, 90, 90, 0.2);
  border: 1px solid rgba(224, 90, 90, 0.55);
  color: #ffd5d5;
  font-size: 0.88rem;
}

/* ==================== LOBBY DE SALA ==================== */
.lobby-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.room-code-box {
  padding: 1rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(245, 196, 81, 0.45);
  text-align: center;
}

.room-code-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.room-code-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.3rem;
}

.room-code-value {
  font-family: monospace;
  font-size: clamp(1.9rem, 6vw, 2.4rem);
  letter-spacing: 0.16em;
  color: var(--gold-strong);
}

.room-lan-hint {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  word-break: break-all;
}

.lobby-players-wrap h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--gold);
}

.lobby-players-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 0.5rem;
}

.lobby-players-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  font-size: 0.9rem;
}

.lobby-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

/* ==================== MESA DE JUEGO ==================== */
.screen-game {
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(circle at 50% 42%, var(--felt-center) 0%, var(--felt-mid) 58%, var(--felt-edge) 100%);
}

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: calc(0.55rem + env(safe-area-inset-top, 0px)) 0.85rem 0.55rem;
  background: rgba(5, 20, 13, 0.88);
  border-bottom: 1px solid rgba(245, 196, 81, 0.24);
  flex-shrink: 0;
  flex-wrap: wrap;
}

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

.topbar-pill {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(245, 196, 81, 0.2);
  color: var(--gold-strong);
  font-size: 0.78rem;
  font-weight: 700;
}

.topbar-pill.subtle {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.topbar-center {
  flex: 1;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ivory);
  min-width: 180px;
}

/* Puntuación siempre visible */
.live-scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  padding: 0.38rem 0.75rem;
  background: rgba(4, 16, 10, 0.78);
  border-bottom: 1px solid rgba(245, 196, 81, 0.2);
  flex-shrink: 0;
}

.live-score-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.78rem;
  white-space: nowrap;
}

.live-score-chip.is-me {
  background: rgba(56, 201, 122, 0.14);
  border-color: rgba(56, 201, 122, 0.45);
}

.live-score-chip.is-turn {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(245, 196, 81, 0.45);
}

.live-score-chip.is-eliminated {
  opacity: 0.48;
  text-decoration: line-through;
}

.live-score-pts {
  color: var(--gold-strong);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.live-score-dealer {
  font-size: 0.68rem;
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
  background: rgba(245, 196, 81, 0.22);
  color: var(--gold-strong);
  font-weight: 800;
}

/* Capa de animación de reparto */
.deal-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 120;
}

.flying-deal-card {
  position: fixed;
  width: 56px;
  aspect-ratio: 160 / 246;
  border-radius: 7px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.65);
  transition: transform 0.21s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.14s ease;
  will-change: transform, opacity;
}

.table-felt {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  gap: 0.6rem;
  overflow-y: auto;
}

/* Rivales */
.opponents-area {
  width: 100%;
  max-width: 1120px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.opponent-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  padding: 0.5rem 0.7rem;
  border-radius: 14px;
  background: rgba(6, 24, 15, 0.72);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  min-width: 112px;
  max-width: 165px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.opponent-seat.active-turn {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(245, 196, 81, 0.45);
}

.opponent-seat.eliminated {
  opacity: 0.45;
  filter: grayscale(0.75);
}

.opponent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.35rem;
  font-size: 0.82rem;
}

.opponent-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opponent-score {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 700;
  flex-shrink: 0;
}

.opponent-backs {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 8px;
}

.mini-back {
  width: 22px;
  height: 34px;
  border-radius: 4px;
  margin-left: -10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

.opponent-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Centro: Montón y Descarte */
.center-piles-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.2rem, 5vw, 3.5rem);
  margin: auto 0;
  padding: 0.5rem 1.25rem;
}

.pile-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.2);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 0.6rem 0.8rem;
  color: var(--ivory);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pile-slot:disabled {
  cursor: default;
}

.pile-slot.can-interact {
  border-style: solid;
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(245, 196, 81, 0.45);
  animation: pulsePile 1.5s infinite ease-in-out;
}

.pile-slot.can-interact:hover {
  transform: translateY(-3px);
}

.pile-slot.drop-hover {
  border-style: solid;
  border-color: #6effb0;
  background: rgba(56, 201, 122, 0.24);
  transform: scale(1.05);
  box-shadow: 0 0 28px rgba(56, 201, 122, 0.72);
}

.pile-stack {
  position: relative;
  width: clamp(74px, 14vw, 108px);
  aspect-ratio: 160 / 246;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  user-select: none;
  -webkit-user-drag: none;
}

.pile-card {
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55));
}

.pile-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--gold-strong);
}

.pile-count {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ==================== PANTALLA COMPLETA DE COLOCACIÓN ==================== */
.screen-placement {
  flex-direction: column;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, var(--felt-center) 0%, var(--felt-mid) 58%, var(--felt-edge) 100%);
}

.placement-fullscreen-header {
  flex-shrink: 0;
  background: rgba(5, 20, 13, 0.92);
  border-bottom: 1.5px solid rgba(245, 196, 81, 0.3);
  padding: calc(0.65rem + env(safe-area-inset-top, 0px)) 0.9rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.placement-header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.placement-fullscreen-header h2 {
  font-family: var(--font-display);
  color: var(--gold-strong);
  font-size: clamp(1.15rem, 3.2vw, 1.5rem);
}

.placement-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.placement-scroll-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.placement-hand-dock {
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(6, 24, 15, 0.86) 0%, rgba(4, 15, 10, 0.98) 100%);
  border-top: 2px solid rgba(245, 196, 81, 0.38);
  padding: 0.55rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.placement-hand-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.placement-loose-hand {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 112px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.placement-loose-card {
  position: relative;
  width: clamp(72px, 19vw, 92px);
  aspect-ratio: 160 / 246;
  border: none;
  background: transparent;
  padding: 0;
  cursor: grab;
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}

.placement-loose-card .card-img {
  pointer-events: none;
}

.placement-loose-card.eligible-finish {
  transform: translateY(-4px);
}

.placement-loose-card.eligible-finish .card-visual-inner {
  box-shadow: 0 0 0 2.5px rgba(67, 214, 133, 0.92), 0 8px 18px rgba(0, 0, 0, 0.48), 0 0 14px rgba(67, 214, 133, 0.6);
}

.placement-loose-card.selected {
  transform: translateY(-10px) scale(1.06);
  z-index: 4;
}

.placement-loose-card.selected .card-visual-inner {
  box-shadow: 0 0 0 2.5px rgba(255, 224, 128, 0.96), 0 12px 22px rgba(0, 0, 0, 0.56), 0 0 18px rgba(245, 196, 81, 0.68);
}

.placement-loose-card.group-checked {
  transform: translateY(-10px) scale(1.06);
  z-index: 4;
}

.placement-loose-card.group-checked .card-visual-inner {
  box-shadow: 0 0 0 2.5px rgba(86, 180, 255, 0.95), 0 12px 22px rgba(0, 0, 0, 0.54), 0 0 16px rgba(86, 180, 255, 0.62);
}

.placement-loose-card.dragging-source {
  opacity: 0.22;
  transform: scale(0.94);
}

.placement-fit-tag {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: #0d3a23;
  border: 1px solid var(--success);
  color: #b7ffda;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
}

.placement-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.placement-timer-badge {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(245, 196, 81, 0.24);
  border: 1px solid var(--gold);
  color: var(--gold-strong);
  font-size: 0.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.placement-timer-badge.urgent {
  background: rgba(224, 90, 90, 0.3);
  border-color: var(--danger);
  color: #ffd9d9;
}

.placement-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.placement-timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, #38c97a 100%);
  transition: width 0.2s linear;
}

.placement-loose-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.loose-player-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
}

.loose-mini-cards {
  display: flex;
  gap: 0.2rem;
}

.table-meld-card.drop-hover {
  transform: scale(1.03);
  border-color: #6effb0;
  background: rgba(56, 201, 122, 0.24);
}

.placement-header p {
  font-size: 0.84rem;
  color: var(--text-muted);
  max-width: 620px;
}

.placement-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.own-arrangement-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  background: rgba(56, 201, 122, 0.1);
  border: 1px solid rgba(56, 201, 122, 0.35);
}

.own-arrangement-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #b7ffda;
  margin-right: 0.25rem;
}

.placement-players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: 0.7rem;
}

.placement-player-panel {
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.placement-player-panel.is-closer {
  border-color: rgba(224, 90, 90, 0.55);
  background: rgba(224, 90, 90, 0.08);
}

.placement-player-panel.is-me {
  border-color: rgba(56, 201, 122, 0.5);
  background: rgba(56, 201, 122, 0.08);
}

.placement-player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.placement-role-pill {
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.placement-role-pill.locked {
  background: rgba(224, 90, 90, 0.24);
  color: #ffd0d0;
}

.placement-role-pill.open {
  background: rgba(56, 201, 122, 0.2);
  color: #b7ffda;
}

.placement-player-melds {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.table-meld-card {
  padding: 0.52rem 0.62rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.26);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.table-meld-card.locked {
  border-color: rgba(224, 90, 90, 0.4);
  background: rgba(224, 90, 90, 0.08);
}

.table-meld-card.has-fit {
  border-color: rgba(245, 196, 81, 0.6);
}

.table-meld-card.targetable {
  border-color: var(--gold-strong);
  background: rgba(245, 196, 81, 0.2);
  cursor: pointer;
  box-shadow: 0 0 18px rgba(245, 196, 81, 0.48);
}

.table-meld-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.meld-status-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.meld-status-tag.target {
  background: var(--gold);
  color: #1f1305;
  font-weight: 800;
}

.meld-mini-cards {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.meld-mini-card {
  position: relative;
  width: clamp(66px, 16.5vw, 82px);
  aspect-ratio: 160 / 246;
}

.meld-mini-card.flipped-in {
  animation: cardFlipReveal 0.42s ease backwards;
}

.meld-drop-slot {
  width: clamp(62px, 15.5vw, 76px);
  aspect-ratio: 160 / 246;
  border-radius: 7px;
  border: 2px dashed var(--gold-strong);
  background: rgba(245, 196, 81, 0.16);
  color: var(--gold-strong);
  font-size: 0.64rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2px;
}

.player-loose-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.joker-badge {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1204;
  color: var(--gold-strong);
  border: 1px solid var(--gold);
  border-radius: 6px;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 1px 4px;
  white-space: nowrap;
}

.hand-card-btn .joker-badge {
  bottom: 5px;
  z-index: 4;
  font-size: 0.65rem;
  padding: 1px 5px;
  pointer-events: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.55);
}

.placement-log {
  max-height: 92px;
  overflow-y: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.45rem;
}

/* ==================== ZONA DEL JUGADOR LOCAL (MANO) ==================== */
.player-dock {
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(6, 24, 15, 0.78) 0%, rgba(4, 15, 10, 0.96) 100%);
  border-top: 1.5px solid rgba(245, 196, 81, 0.3);
  padding: 0.55rem 0.85rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dock-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.player-info-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.score-chip {
  background: rgba(245, 196, 81, 0.18);
  color: var(--gold-strong);
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.hand-status-chip {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.turn-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.turn-actions-bar:not(:has(> button:not([hidden]))) {
  display: none;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.hand-melds-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 22px;
}

.meld-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(56, 201, 122, 0.18);
  border: 1px solid rgba(56, 201, 122, 0.5);
  color: #b7ffda;
}

.meld-pill.chinchon {
  background: rgba(245, 196, 81, 0.25);
  border-color: var(--gold);
  color: var(--gold-strong);
}

.local-hand-cards {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 0.4rem 1.85rem;
  min-height: clamp(148px, 26vw, 200px);
  overflow: visible;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.hand-card-btn {
  --arc-rot: 0deg;
  --arc-y: 0px;
  --base-z: 1;
  position: relative;
  z-index: var(--base-z, 1);
  width: clamp(82px, 12vw, 106px);
  aspect-ratio: 160 / 246;
  border: none;
  background: transparent;
  padding: 0;
  cursor: grab;
  margin-left: -10px;
  transform: translateY(var(--arc-y)) rotate(var(--arc-rot));
  transform-origin: center bottom;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease, margin-left 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.hand-card-btn.no-fan-transition,
.hand-card-btn.no-fan-transition .card-visual-inner {
  transition: none !important;
}

.hand-card-btn .card-img {
  pointer-events: none;
}

.card-corner-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 4;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 24px;
  padding: 2px 3px 3px;
  border-radius: 6px;
  background: rgba(255, 253, 246, 0.96);
  border: 1.5px solid rgba(20, 20, 20, 0.38);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.28);
}

.card-corner-num {
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
  color: #141414;
  letter-spacing: -0.03em;
}

.card-corner-suit {
  width: 13px;
  height: 13px;
  display: block;
}

.hand-card-btn:active {
  cursor: grabbing;
}

.hand-card-btn.dragging-source {
  opacity: 0.22;
  transform: translateY(var(--arc-y)) rotate(var(--arc-rot)) scale(0.95);
}

.card-visual-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 9px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.38);
  transition: box-shadow 0.28s cubic-bezier(0.22, 1, 0.36, 1), filter 0.28s ease;
  pointer-events: none;
}

.card-visual-inner.card-flip-in {
  animation: cardFlipReveal 0.38s ease backwards;
}

.drag-ghost-card {
  position: fixed;
  z-index: 220;
  pointer-events: none;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.72));
  transform: scale(1.08) rotate(2deg);
}

.hand-card-btn:first-child {
  margin-left: 0;
}

.hand-card-btn.settling {
  z-index: 20;
}

.hand-card-btn.eligible-finish {
  transform: translateY(calc(var(--arc-y) - 10px)) rotate(var(--arc-rot));
}

.hand-card-btn.eligible-finish .card-visual-inner {
  box-shadow: 0 0 0 2.5px rgba(67, 214, 133, 0.94), 0 8px 18px rgba(0, 0, 0, 0.48), 0 0 14px rgba(67, 214, 133, 0.65);
}

@media (hover: hover) and (pointer: fine) {
  .hand-card-btn:hover:not(.selected):not(.group-checked):not(.dragging-source) {
    transform: translateY(calc(var(--arc-y) - 10px)) rotate(calc(var(--arc-rot) * 0.68)) scale(1.03);
    z-index: 18;
  }

  .hand-card-btn:hover:not(.selected):not(.group-checked):not(.dragging-source) .card-visual-inner {
    box-shadow: 0 0 0 1.5px rgba(255, 224, 128, 0.55), 0 10px 20px rgba(0, 0, 0, 0.48);
  }
}

.hand-card-btn.group-checked {
  transform: translateY(calc(var(--arc-y) - 18px)) rotate(calc(var(--arc-rot) * 0.25)) scale(1.05);
  z-index: 24;
}

.hand-card-btn.group-checked .card-visual-inner {
  box-shadow: 0 0 0 2.5px rgba(86, 180, 255, 0.95), 0 12px 22px rgba(0, 0, 0, 0.55), 0 0 16px rgba(86, 180, 255, 0.68);
}

.hand-card-btn.selected,
.hand-card-btn.selected.eligible-finish {
  transform: translateY(calc(var(--arc-y) - 20px)) rotate(calc(var(--arc-rot) * 0.25)) scale(1.06);
  z-index: 28;
}

.hand-card-btn.selected .card-visual-inner {
  box-shadow: 0 0 0 2.5px rgba(255, 224, 128, 0.96), 0 14px 26px rgba(0, 0, 0, 0.58), 0 0 20px rgba(245, 196, 81, 0.72);
}

.hand-card-btn.melded-group-0::after,
.hand-card-btn.melded-group-1::after,
.hand-card-btn.melded-group-2::after {
  content: '';
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: -5px;
  height: 4px;
  border-radius: 4px;
}

.hand-card-btn.melded-group-0::after { background: #38c97a; }
.hand-card-btn.melded-group-1::after { background: #56b4ff; }
.hand-card-btn.melded-group-2::after { background: #f5c451; }

/* ==================== MODALES ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 12, 8, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  width: min(100%, 480px);
  max-height: 90dvh;
  overflow-y: auto;
  background: #0a2417;
  border: 1.5px solid var(--panel-border);
  border-radius: 22px;
  padding: 1.35rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.modal-card.modal-wide {
  width: min(100%, 760px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.modal-header h2 {
  font-family: var(--font-display);
  color: var(--gold-strong);
  font-size: 1.45rem;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--ivory);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
}

.round-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.round-player-row {
  padding: 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.round-player-row.winner-row {
  border-color: var(--gold);
  background: rgba(245, 196, 81, 0.14);
}

.round-player-row.eliminated-row {
  opacity: 0.55;
  border-color: rgba(224, 90, 90, 0.45);
}

.round-player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 700;
}

.round-cards-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.round-meld-box {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem 0.35rem;
  border-radius: 8px;
  background: rgba(56, 201, 122, 0.12);
  border: 1px solid rgba(56, 201, 122, 0.35);
}

.round-deadwood-box {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem 0.35rem;
  border-radius: 8px;
  background: rgba(224, 90, 90, 0.12);
  border: 1px solid rgba(224, 90, 90, 0.35);
}

.mini-card-sm {
  width: clamp(50px, 13.5vw, 62px);
  aspect-ratio: 160 / 246;
}

.scores-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.scores-table th,
.scores-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.scores-table th {
  color: var(--gold);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.rules-content ul {
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.rules-content strong {
  color: var(--ivory);
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

/* ==================== TOAST ==================== */
.toast-container {
  position: fixed;
  top: 0.9rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: none;
  width: min(92vw, 420px);
}

.toast {
  background: rgba(15, 36, 24, 0.95);
  border: 1px solid var(--gold);
  color: var(--ivory);
  padding: 0.65rem 1rem;
  border-radius: 12px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}

.toast.error {
  border-color: var(--danger);
  background: rgba(65, 16, 16, 0.95);
}

/* ==================== ANIMACIONES ==================== */
.round-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(245, 196, 81, 0.25);
}

.round-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.round-summary-table th,
.round-summary-table td {
  padding: 0.58rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  text-align: left;
  white-space: nowrap;
}

.round-summary-table th {
  color: var(--gold-strong);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(245, 196, 81, 0.08);
}

.round-summary-table tr:last-child td {
  border-bottom: none;
}

.delta-neg {
  color: var(--success);
  font-weight: 800;
}

.delta-pos {
  color: #ffb8b8;
  font-weight: 700;
}

@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 16px rgba(255, 217, 120, 0.5); }
  50% { box-shadow: 0 0 30px rgba(255, 217, 120, 0.95); }
}

@keyframes pulsePile {
  0%, 100% { box-shadow: 0 0 12px rgba(245, 196, 81, 0.35); }
  50% { box-shadow: 0 0 26px rgba(245, 196, 81, 0.78); }
}

@keyframes cardFlipReveal {
  0% { transform: perspective(600px) rotateY(90deg) scale(0.95); opacity: 0.55; }
  100% { transform: perspective(600px) rotateY(0deg) scale(1); opacity: 1; }
}

/* ==================== RESPONSIVE: MÓVIL, TABLET Y ORDENADOR ==================== */
@media (max-width: 639px) {
  .menu-felt-bg {
    box-shadow: inset 0 0 0 6px var(--wood-rim);
    padding: 0.9rem;
  }

  .bg-card-1 { transform: translate(-122px, -135px) rotate(-25deg); }
  .bg-card-2 { transform: translate(-66px, -162px) rotate(-12deg); }
  .bg-card-3 { transform: translate(-5px, -172px) rotate(-2deg); }
  .bg-card-4 { transform: translate(55px, -168px) rotate(10deg); }
  .bg-card-5 { transform: translate(112px, -142px) rotate(22deg); }
  .bg-card-6 { transform: translate(128px, 148px) rotate(24deg); }
  .bg-card-7 { transform: translate(-124px, 152px) rotate(-18deg); }
  .bg-card-8 { display: none; }

  .screen-game {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .game-topbar {
    padding: calc(0.32rem + env(safe-area-inset-top, 0px)) 0.5rem 0.32rem;
    gap: 0.25rem;
  }

  .topbar-center {
    order: 3;
    flex-basis: 100%;
    font-size: 0.82rem;
    min-height: 2.35em;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .live-scoreboard {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.22rem 0.35rem;
    padding: 0.24rem 0.4rem;
  }

  .live-score-chip {
    padding: 0.14rem 0.45rem;
    font-size: 0.75rem;
  }

  .table-felt {
    padding: 0.32rem 0.45rem;
    gap: 0.3rem;
    overflow-y: auto;
  }

  .opponents-area {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    scrollbar-width: thin;
  }

  .opponent-seat {
    min-width: 104px;
    padding: 0.3rem 0.5rem;
  }

  .opponent-head {
    font-size: 0.84rem;
  }

  .opponent-score,
  .opponent-meta {
    font-size: 0.76rem;
  }

  .opponent-backs {
    display: none;
  }

  .center-piles-area {
    gap: 1.15rem;
    padding: 0.15rem 0.4rem;
  }

  .pile-stack {
    width: clamp(78px, 22vw, 96px);
  }

  .pile-slot {
    padding: 0.4rem 0.65rem;
  }

  .pile-title {
    font-size: 0.9rem;
  }

  .pile-count {
    font-size: 0.78rem;
  }

  .player-dock {
    padding: 0.38rem 0.45rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    gap: 0.25rem;
  }

  .player-info-chip {
    font-size: 0.92rem;
  }

  .local-hand-cards {
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding: 1.25rem 0.2rem 2.3rem;
    min-height: 158px;
  }

  .hand-card-btn {
    width: clamp(76px, 21.5vw, 90px);
    max-width: 90px;
  }

  .card-corner-badge {
    min-width: 24px;
    padding: 2px 3px 3px;
  }

  .card-corner-num {
    font-size: 13px;
  }

  .card-corner-suit {
    width: 13px;
    height: 13px;
  }

  .dock-toolbar {
    gap: 0.3rem;
  }

  .sort-controls {
    margin-left: auto;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .friends-choice-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hand-card-btn {
    width: clamp(82px, 11.4vw, 98px);
    margin-left: -3px;
  }
}

@media (min-width: 1024px) {
  .friends-choice-grid {
    grid-template-columns: 1fr 1fr;
  }

  .table-felt {
    padding: 1rem 2rem;
    border-radius: 140px;
    margin: 0.45rem 1rem;
    border: 8px solid var(--wood-rim);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(245, 196, 81, 0.25);
  }

  .hand-card-btn {
    width: 102px;
    margin-left: -4px;
  }
}
