/* ===================================================================
   CHINASO — Premium Private Card Room
   Scene-based design: warm parlor, dark wood, leather, brass, felt
   Seated-player perspective with purposeful gameplay zones
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Room */
  --room-dark: #080604;
  --room-mid: #12100c;
  --room-warm: #1a1510;
  --room-panel: #1e1814;

  /* Wood */
  --wood-deep: #231b14;
  --wood-mid: #2f2318;
  --wood-light: #3d2e22;
  --wood-highlight: #5d4a38;
  --wood-edge: #4a3828;

  /* Felt */
  --felt-dark: #14482a;
  --felt-mid: #1a5c35;
  --felt-bright: #237a45;
  --felt-highlight: #2d9452;

  /* Brass/Gold */
  --brass: #8b7355;
  --brass-light: #a08a6c;
  --gold: #d4a537;
  --gold-light: #e8c36a;
  --gold-dim: rgba(212,165,55,0.12);

  /* Leather */
  --leather: #2a2018;
  --leather-light: #3a2e24;

  /* Text */
  --text-cream: #f5f0e8;
  --text-warm: #c4b49a;
  --text-muted: #8a7b6b;
  --text-dim: #5a4e42;

  /* Accent */
  --accent-green: #4caf50;
  --accent-purple: #9c7cc5;
  --accent-red: #c0392b;
  --accent-blue: #5c9ece;

  /* Cards */
  --card-red: #c0392b;
  --card-black: #1a1a1a;

  /* System */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.6);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--room-dark);
  color: var(--text-cream);
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.app { flex-direction: column; min-height: 100vh; display: flex; }


/* ==========================================================================
   MENU SCREEN — Private club entrance
   ========================================================================== */
.menu-screen {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(212,165,55,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(30,24,20,0.8) 0%, transparent 50%),
    linear-gradient(180deg, #12100c 0%, #080604 100%);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  display: flex;
}

.menu-logo {
  background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold));
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-family: 'Playfair Display', serif;
  font-size: 3.5rem;
  font-weight: 800;
  filter: drop-shadow(0 2px 8px rgba(212,165,55,0.3));
}

.menu-subtitle {
  color: var(--text-warm);
  margin-bottom: 40px;
  font-size: 1.05rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
}

.menu-card {
  background: linear-gradient(160deg, rgba(61,46,34,0.85), rgba(35,27,20,0.92));
  border: 1px solid rgba(93,74,56,0.4);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255,255,255,0.03);
  padding: 32px;
  color: var(--text-cream);
  backdrop-filter: blur(20px);
}

.menu-buttons { flex-direction: column; gap: 10px; display: flex; }


/* ==========================================================================
   BUTTONS — Tactile, dimensioned, warm materials
   ========================================================================== */
.btn {
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all .15s ease;
  display: inline-flex;
  letter-spacing: 0.02em;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, #2d7a4a 0%, #1f5633 100%);
  color: var(--text-cream);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 2px 0 #163f25, 0 4px 12px rgba(0,0,0,0.3);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 3px 0 #163f25, 0 6px 16px rgba(0,0,0,0.4); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 #163f25; }

.btn-secondary {
  background: linear-gradient(180deg, var(--wood-light), var(--wood-mid));
  color: var(--text-cream);
  border: 1px solid var(--wood-edge);
  box-shadow: 0 2px 0 #1c1510, 0 3px 8px rgba(0,0,0,0.3);
}
.btn-secondary:hover:not(:disabled) { background: linear-gradient(180deg, #4a3828, var(--wood-light)); }

.btn-danger {
  background: linear-gradient(180deg, var(--accent-red), #a02d23);
  color: var(--text-cream);
  box-shadow: 0 2px 0 #7a1f18, 0 3px 8px rgba(0,0,0,0.3);
}

.btn-accent {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: #1a1410;
  font-weight: 700;
  box-shadow: 0 2px 0 #a07d28, 0 4px 12px rgba(212,165,55,0.2);
}
.btn-accent:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 3px 0 #a07d28, 0 6px 16px rgba(212,165,55,0.3); }

.btn-warning { background: var(--gold); color: #1a1410; }
.btn-small { padding: 6px 14px; font-size: .82rem; }
.btn-large { padding: 16px 32px; font-size: 1.15rem; }


/* ==========================================================================
   SETUP SCREEN — Private room lobby
   ========================================================================== */
.setup-screen {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(212,165,55,0.03) 0%, transparent 50%),
    linear-gradient(180deg, #12100c 0%, #080604 100%);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  display: flex;
}

.setup-card {
  background: linear-gradient(160deg, rgba(61,46,34,0.85), rgba(35,27,20,0.92));
  border: 1px solid rgba(93,74,56,0.3);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255,255,255,0.03);
  padding: 28px 32px;
  color: var(--text-cream);
  max-height: 90vh;
  overflow-y: auto;
  backdrop-filter: blur(20px);
}

.setup-title {
  text-align: center;
  margin-bottom: 20px;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-light);
}

.form-group { margin-bottom: 14px; }
.form-group label {
  color: var(--text-warm);
  margin-bottom: 6px;
  font-size: .82rem;
  font-weight: 600;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.form-group input, .form-group select {
  background: rgba(8,6,4,0.7);
  border: 1px solid rgba(74,56,40,0.4);
  border-radius: var(--radius-sm);
  width: 100%;
  color: var(--text-cream);
  padding: 10px 14px;
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(212,165,55,0.1);
}

.player-setup {
  background: rgba(8,6,4,0.5);
  border: 1px solid rgba(74,56,40,0.3);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  padding: 10px 14px;
  transition: border-color .2s;
}
.player-setup:hover { border-color: rgba(93,74,56,0.5); }

.player-setup-header {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  display: flex;
}
.player-setup-header span { font-size: .85rem; font-weight: 600; color: var(--text-cream); }

.ai-toggle { color: var(--text-warm); align-items: center; gap: 6px; font-size: .8rem; display: flex; }
.ai-toggle input { width: auto; }
.difficulty-select { margin-top: 4px; }


/* ==========================================================================
   GAME BOARD — The private card room scene
   ========================================================================== */
.game-board {
  /* Rich room atmosphere built with layered gradients */
  background:
    /* Warm overhead chandelier light pool */
    radial-gradient(ellipse at 55% 35%, rgba(212,165,55,0.06) 0%, transparent 45%),
    /* Wood paneling warmth on sides */
    radial-gradient(ellipse at 0% 50%, rgba(42,32,24,0.8) 0%, transparent 40%),
    radial-gradient(ellipse at 100% 50%, rgba(42,32,24,0.6) 0%, transparent 40%),
    /* Upper wall / ceiling darkness */
    radial-gradient(ellipse at 50% 0%, rgba(18,16,12,0.9) 0%, transparent 50%),
    /* Base room color */
    linear-gradient(180deg, #0e0c08 0%, #12100c 30%, #1a1510 60%, #12100c 100%);
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  display: flex;
  position: relative;
}

/* Dark vignette framing */
.game-board::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 55% 45%, transparent 25%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
  z-index: 0;
}


/* ==========================================================================
   GAME HEADER — Brass-trimmed wood molding
   ========================================================================== */
.game-header {
  background: linear-gradient(180deg, #2f2318 0%, #231b14 100%);
  border-bottom: 1px solid var(--brass);
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  padding: 6px 20px;
  display: flex;
  box-shadow:
    0 1px 0 rgba(139,115,85,0.2),
    0 3px 12px rgba(0,0,0,0.6);
  max-height: 38px;
  height: 38px;
  position: relative;
  z-index: 30;
}

.game-header-left { align-items: center; gap: 16px; display: flex; }

.round-badge {
  background: rgba(26,92,53,0.4);
  border: 1px solid rgba(45,107,63,0.4);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-cream);
  letter-spacing: 0.03em;
}

.objective-badge { color: var(--text-warm); font-size: .78rem; white-space: nowrap; }
.game-header-right { align-items: center; gap: 10px; display: flex; }


/* ==========================================================================
   PLAYING CARDS — Premium ivory with parchment warmth
   ========================================================================== */
.playing-card {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  background: linear-gradient(170deg, #fefcf6 0%, #f5f0e4 50%, #ece6d4 100%);
  border: 1.5px solid #c4b48e;
  border-radius: 6px;
  flex-direction: column;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 64px;
  height: 90px;
  font-weight: 700;
  transition: all .15s ease;
  display: flex;
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    0 1px 2px rgba(0,0,0,0.12),
    0 3px 6px rgba(0,0,0,0.08);
}
.playing-card.red { color: var(--card-red); }
.playing-card.black { color: var(--card-black); }
.playing-card.joker { color: #1a1410; background: linear-gradient(135deg, #f4c430, #daa520); border-color: #d4a537; }
.playing-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(212,165,55,0.35);
  transform: translateY(-10px);
}
.playing-card.pending { opacity: .5; border-color: var(--accent-purple); }
.playing-card .card-rank { font-size: 1rem; line-height: 1; }
.playing-card .card-suit { font-size: 1.1rem; line-height: 1; }
.playing-card.large { width: 80px; height: 112px; }
.playing-card.large .card-rank { font-size: 1.3rem; }
.playing-card.large .card-suit { font-size: 1.4rem; }


/* ==========================================================================
   GAME BODY — Room layout: log rail + table area
   ========================================================================== */
.game-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}


/* ==========================================================================
   LEFT GAMEPLAY LOG — Integrated wood-panel rail
   ========================================================================== */
.game-log-panel {
  width: 210px;
  min-width: 210px;
  background:
    linear-gradient(180deg,
      rgba(18,16,12,0.92) 0%,
      rgba(12,10,8,0.95) 100%
    );
  border-right: 1px solid rgba(139,115,85,0.15);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 2px 0 20px rgba(0,0,0,0.5);
  position: relative;
  z-index: 5;
  backdrop-filter: blur(12px);
}

/* Brass accent strip on left edge */
.game-log-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg,
    rgba(139,115,85,0.3) 0%,
    rgba(139,115,85,0.08) 30%,
    rgba(139,115,85,0.08) 70%,
    rgba(139,115,85,0.3) 100%
  );
}

.game-log-panel .game-log {
  flex: 1;
  max-height: none;
  border-radius: 0;
  background: transparent;
  padding: 8px 14px;
}
.game-log-panel .game-log p {
  font-size: .78rem;
  padding: 6px 0;
  line-height: 1.5;
  border-bottom: 1px solid rgba(74,56,40,0.15);
  color: var(--text-warm);
}

.log-panel-header {
  color: var(--brass-light);
  font-size: .7rem;
  font-weight: 700;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(139,115,85,0.12);
  text-transform: uppercase;
  letter-spacing: 2px;
  flex-shrink: 0;
  background: rgba(8,6,4,0.4);
}

.log-set-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-bottom: 1px solid rgba(74,56,40,0.12);
}
.log-set-item:last-child { border-bottom: none; }
.log-sets-summary { padding-bottom: 8px; }

.game-log {
  background: transparent;
  border-radius: 0;
  color: var(--text-warm);
  padding: 0;
  font-size: .85rem;
  overflow-y: auto;
  flex: 1;
}
.game-log p {
  border-bottom: 1px solid rgba(212,165,55,0.04);
  padding: 4px 0;
  color: var(--text-warm);
}
.game-log p:last-child { border-bottom: none; }


/* ==========================================================================
   TABLE WRAPPER — The scene viewport
   ========================================================================== */
.table-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  padding: 6px 8px;
  /* Warm overhead light on the table area */
  background:
    radial-gradient(ellipse at 52% 40%, rgba(212,165,55,0.03) 0%, transparent 50%);
}


/* ==========================================================================
   THE POKER TABLE — Premium felt with rich wood rail
   ========================================================================== */
.poker-table {
  flex: 1;
  position: relative;
  /* Rich green felt with light pooling in center */
  background:
    radial-gradient(ellipse at 52% 40%,
      #2fa85e 0%,
      #28964f 20%,
      #218440 40%,
      #1d7238 60%,
      #186430 80%,
      #145828 100%
    );
  border-radius: 50% / 42%;
  /* Thick wood rail */
  border: 14px solid var(--wood-mid);
  /* Multi-layer depth */
  box-shadow:
    /* Inner felt shadow (bowl effect) */
    inset 0 0 50px rgba(0,0,0,0.2),
    inset 0 0 100px rgba(0,0,0,0.1),
    /* Top highlight from overhead light */
    inset 0 6px 12px rgba(255,255,255,0.04),
    /* Bottom shadow under rail */
    inset 0 -4px 8px rgba(0,0,0,0.15),
    /* Table drop shadow onto room */
    0 12px 40px rgba(0,0,0,0.7),
    0 4px 12px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  transform: none;
  transform-origin: center 55%;
  overflow: visible;
  padding: 20px;
}

/* Outer wood rail with 3D carved profile & brass inlay */
.poker-table::before {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 50% / 42%;
  background:
    linear-gradient(180deg,
      #6b5848 0%,
      #5d4a38 8%,
      #4a3828 20%,
      #3d2e22 35%,
      #352820 50%,
      #3d2e22 65%,
      #4a3828 80%,
      #5d4a38 92%,
      #4a3828 100%
    );
  z-index: -1;
  box-shadow:
    /* Brass-like inner highlight */
    inset 0 2px 0 rgba(160,138,108,0.2),
    inset 0 -1px 0 rgba(160,138,108,0.1),
    /* Deep shadow under table */
    0 20px 60px rgba(0,0,0,0.8),
    0 8px 20px rgba(0,0,0,0.5);
}

/* Felt texture + overhead light spot */
.poker-table::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50% / 42%;
  background:
    /* Subtle felt grain texture */
    repeating-linear-gradient(90deg,
      transparent, transparent 2px,
      rgba(0,0,0,0.01) 2px, rgba(0,0,0,0.01) 4px
    ),
    /* Chandelier light pool */
    radial-gradient(ellipse at 52% 35%,
      rgba(255,255,255,0.10) 0%,
      rgba(255,255,255,0.04) 25%,
      transparent 55%
    );
  pointer-events: none;
}


/* ==========================================================================
   PLAYER ZONES — Seat-based positioning
   ========================================================================== */
.player-zone {
  position: absolute;
  z-index: 15;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 160px;
}

/* Seat-back suggestion: dark rounded shape behind badge */
.player-badge {
  background:
    linear-gradient(180deg,
      rgba(42,32,24,0.95) 0%,
      rgba(26,21,16,0.97) 100%
    );
  border: 1px solid rgba(93,74,56,0.4);
  border-radius: 10px;
  padding: 7px 14px;
  text-align: center;
  white-space: nowrap;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.6),
    0 1px 0 rgba(139,115,85,0.08) inset;
  min-width: 85px;
  backdrop-filter: blur(8px);
  position: relative;
}

.player-badge.active {
  border-color: var(--gold);
  box-shadow:
    0 0 18px rgba(212,165,55,0.3),
    0 4px 16px rgba(0,0,0,0.5),
    0 1px 0 rgba(212,165,55,0.15) inset;
}
.player-badge.has-thrown { border-color: var(--accent-green); }

.player-badge .name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  letter-spacing: 0.02em;
}
.player-badge .info {
  font-size: 0.7rem;
  color: var(--text-warm);
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.player-badge .score {
  background: rgba(20,72,42,0.5);
  border: 1px solid rgba(45,107,63,0.25);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 2px;
  display: inline-block;
}


/* ==========================================================================
   TABLE CENTER — Draw/Discard + Active Play Zone
   ========================================================================== */
.table-center {
  position: absolute;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.table-center > * { pointer-events: auto; }

.piles-row {
  justify-content: center;
  align-items: flex-start;
  gap: 28px;
  display: flex;
  flex-shrink: 0;
}

.pile {
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: transform .2s ease;
  display: flex;
}
.pile:hover:not(.disabled) { transform: translateY(-3px); }
.pile.disabled { opacity: .5; cursor: not-allowed; }

.pile-card {
  border-radius: 7px;
  width: 68px;
  height: 95px;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.2),
    0 6px 16px rgba(0,0,0,0.15);
  justify-content: center;
  align-items: center;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  position: relative;
  border: 2px solid;
  overflow: hidden;
  flex-shrink: 0;
}
/* Force the card inside discard pile to fill the container exactly */
.pile-card.discard-pile .playing-card {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  position: absolute;
  top: 0; left: 0;
}

.pile-card.draw-pile {
  color: var(--text-cream);
  background:
    linear-gradient(135deg, #2a7548 0%, #1d5c36 100%);
  border-color: rgba(139,115,85,0.35);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.2),
    0 6px 16px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.08);
}
.pile-card.draw-pile .card-count {
  font-size: 1.3rem;
  font-family: 'Playfair Display', serif;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.pile-card.discard-pile {
  background: linear-gradient(170deg, #fefcf6, #f0ebd8);
  color: #1a1410;
  border: 2px solid #c4b48e;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.6);
}
.pile-card.discard-pile.empty {
  background: rgba(35,27,20,0.35);
  border: 2px dashed rgba(139,115,85,0.25);
  color: var(--text-muted);
}

.pile-label {
  color: rgba(255,255,255,0.6);
  font-size: .68rem;
  font-weight: 600;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* ==========================================================================
   STATUS PILL — Turn/action indicator
   ========================================================================== */
.status-pill {
  background: rgba(18,16,12,0.92);
  border: 1px solid rgba(212,165,55,0.3);
  border-radius: 20px;
  padding: 7px 18px;
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 700;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 8px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  box-shadow:
    0 4px 12px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(212,165,55,0.05);
  letter-spacing: 0.03em;
}


/* ==========================================================================
   SETS ON TABLE — Melds, sets, straights (visible & interactive)
   ========================================================================== */
.table-sets-display { display: none; }

.table-set-group {
  background: rgba(26,21,16,0.88);
  border: 1.5px solid rgba(93,74,56,0.4);
  border-radius: 6px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}
.table-set-group:hover { border-color: var(--gold); }
.table-set-group.selected-set { border-color: var(--gold); box-shadow: 0 0 8px rgba(212,165,55,0.2); }
.table-set-group.drag-over { border-color: var(--gold); background: rgba(212,165,55,0.12); box-shadow: 0 0 12px rgba(212,165,55,0.25); }

.player-sets {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  margin-top: 4px;
  max-width: 150px;
}

.set-chip {
  background: rgba(18,16,12,0.92);
  border: 1px solid rgba(93,74,56,0.35);
  border-radius: 8px;
  padding: 2px 7px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-warm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-block;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.set-chip:hover { border-color: var(--gold); color: var(--gold); }
.set-chip.drag-over { border-color: var(--gold); background: rgba(212,165,55,0.15); box-shadow: 0 0 10px rgba(212,165,55,0.25); color: var(--gold); }

.set-type-badge { border-radius: 4px; padding: 2px 6px; font-size: .62rem; font-weight: 600; flex-shrink: 0; }
.set-type-badge.tok { background: var(--accent-purple); color: #fff; }
.set-type-badge.str { background: var(--accent-green); color: #fff; }
.set-owner { color: var(--text-muted); margin-left: 4px; font-size: .68rem; white-space: nowrap; }


/* ==========================================================================
   PENDING SETS
   ========================================================================== */
.pending-sets {
  background: rgba(18,16,12,0.92);
  border: 2px solid var(--accent-purple);
  border-radius: var(--radius-sm);
  padding: 12px;
  max-width: 90%;
  position: relative;
  z-index: 9;
  margin-top: 8px;
  backdrop-filter: blur(8px);
}
.pending-set-row {
  background: rgba(42,32,24,0.6);
  border-radius: 4px;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 6px;
  display: flex;
  font-size: 0.8rem;
}
.pending-set-row:last-child { margin-bottom: 0; }
.pending-set-remove { color: var(--accent-red); cursor: pointer; background: 0 0; border: none; padding: 2px 6px; font-size: 0.9rem; }


/* ==========================================================================
   MY ZONE — Seated foreground, anchored at table edge
   ========================================================================== */
.my-zone {
  position: absolute;
  bottom: 1%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding-bottom: 6px;
  width: 92%;
  max-width: 700px;
  max-height: 34vh;
}

.my-badge {
  background: linear-gradient(180deg, var(--wood-light), var(--wood-mid));
  border: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 4px 16px;
  text-align: center;
  white-space: nowrap;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.5),
    0 0 10px rgba(212,165,55,0.08),
    inset 0 1px 0 rgba(255,255,255,0.04);
  min-width: 90px;
}
.my-badge .name { font-size: 0.82rem; font-weight: 700; color: #fff; letter-spacing: 0.02em; }
.my-badge .info { font-size: 0.72rem; color: var(--text-warm); }
.my-badge .score {
  background: rgba(20,72,42,0.5);
  border: 1px solid rgba(45,107,63,0.25);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 2px;
  display: inline-block;
}

/* Hand tray — recessed leather/felt channel */
.my-hand-wrapper {
  max-width: 100%;
  overflow-x: auto;
  padding: 2px;
}

.my-hand {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  /* Recessed felt tray */
  background:
    linear-gradient(180deg,
      rgba(8,6,4,0.7) 0%,
      rgba(12,10,8,0.5) 100%
    );
  border-radius: 10px;
  border: 1px solid rgba(93,74,56,0.25);
  box-shadow:
    inset 0 3px 10px rgba(0,0,0,0.4),
    inset 0 -1px 0 rgba(139,115,85,0.08),
    0 2px 8px rgba(0,0,0,0.3);
}

.my-hand .card-drag-wrapper { cursor: grab; }
.my-hand .card-drag-wrapper:active { cursor: grabbing; }
.my-hand .card-drag-wrapper.dragging { opacity: .4; transform: scale(.95); }
.my-hand .card-drag-wrapper.drag-over { transform: translate(0, -8px); }

/* Slightly larger hand cards for readability */
.my-hand .playing-card { width: 54px; height: 75px; }
.my-hand .playing-card .card-rank { font-size: 1rem; }
.my-hand .playing-card .card-suit { font-size: 1.1rem; }

.my-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding-top: 3px;
  max-width: 100%;
}


/* ==========================================================================
   CLAIM / REPLENISH BANNERS
   ========================================================================== */
.claim-banner {
  color: #1a1410;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  display: flex;
  box-shadow:
    0 4px 16px rgba(212,165,55,0.25),
    inset 0 1px 0 rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  z-index: 50;
  position: relative;
  margin: 0 8px;
}
.claim-timer {
  text-align: center;
  min-width: 48px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #1a1410;
  font-family: 'Playfair Display', serif;
}
.claim-info { flex: 1; }
.claim-info .claim-title { font-size: 0.92rem; font-weight: 700; color: #1a1410; }
.claim-info .claim-sub { opacity: .85; font-size: .78rem; color: #1a1410; }

.replenish-banner {
  color: var(--text-cream);
  background: linear-gradient(135deg, var(--accent-red), #a02d23);
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  display: flex;
  box-shadow: 0 4px 12px rgba(192,57,43,0.3);
  border-radius: var(--radius-sm);
  z-index: 50;
  position: relative;
  margin: 0 8px;
}

.error-toast {
  background: var(--accent-red);
  color: var(--text-cream);
  text-align: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 10px 20px;
  font-size: .82rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  position: relative;
  margin: 0 8px;
}


/* ==========================================================================
   MODALS — Warm wood panels
   ========================================================================== */
.modal-overlay {
  z-index: 1000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
  padding: 20px;
  display: flex;
  position: fixed;
  inset: 0;
}

.modal {
  background: linear-gradient(155deg, var(--wood-light), var(--wood-deep));
  border: 1px solid rgba(93,74,56,0.4);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 450px;
  box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255,255,255,0.03);
  text-align: center;
  padding: 36px;
  color: var(--text-cream);
}
.modal-title {
  margin-bottom: 8px;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold-light);
}
.modal-subtitle { color: var(--text-warm); margin-bottom: 24px; }

.score-table { border-collapse: collapse; width: 100%; margin-bottom: 24px; }
.score-table th, .score-table td { text-align: left; border-bottom: 1px solid rgba(74,56,40,0.3); padding: 10px 12px; }
.score-table th { color: var(--text-muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.score-table td { color: var(--text-cream); }
.score-table .winner-row { color: var(--gold); font-weight: 700; }
.score-table .round-score { color: var(--gold); }


/* ==========================================================================
   TUTORIAL
   ========================================================================== */
.tutorial-overlay {
  z-index: 2000;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
  padding: 20px;
  display: flex;
  position: fixed;
  inset: 0;
}
.tutorial-card {
  background: linear-gradient(155deg, var(--wood-light), var(--wood-deep));
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  padding: 32px;
  overflow-y: auto;
  color: var(--text-cream);
  box-shadow: var(--shadow-xl), 0 0 20px rgba(212,165,55,0.08);
}
.tutorial-step { margin-bottom: 16px; }
.tutorial-step h3 { color: var(--gold); margin-bottom: 8px; font-family: 'Playfair Display', serif; }
.tutorial-step p { color: var(--text-warm); line-height: 1.6; }
.tutorial-nav { justify-content: space-between; margin-top: 20px; display: flex; }


/* ==========================================================================
   SETTINGS
   ========================================================================== */
.settings-panel {
  background: rgba(8,6,4,0.6);
  border: 1px solid rgba(74,56,40,0.3);
  border-radius: var(--radius-sm);
  margin-top: 16px;
  padding: 16px;
}
.setting-row {
  border-bottom: 1px solid rgba(74,56,40,0.2);
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  display: flex;
  color: var(--text-cream);
}
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: .9rem; }


/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes pulse { 0%, to { opacity: 1; } 50% { opacity: .6; } }
.pulse { animation: 1.5s infinite pulse; }

@keyframes slideUp { 0% { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.slide-up { animation: .3s ease-out slideUp; }

@keyframes claimPulse {
  0%, to { box-shadow: 0 0 12px 4px rgba(212,165,55,0.4), var(--shadow); }
  50% { box-shadow: 0 0 22px 8px rgba(212,165,55,0.5), var(--shadow); }
}

.card-drag-wrapper { cursor: grab; transition: transform .15s ease, opacity .15s ease; }
.card-drag-wrapper:active { cursor: grabbing; }
.card-drag-wrapper.dragging { opacity: .4; transform: scale(.95); }
.card-drag-wrapper.drag-over { transform: translate(8px); }

.pile-card.claim-glow {
  box-shadow: 0 0 12px 4px rgba(212,165,55,0.4), var(--shadow);
  animation: 1s infinite claimPulse;
  border-color: var(--gold) !important;
}
.pile.claimable { opacity: 1 !important; cursor: pointer !important; }
.pile.claimable .pile-label { color: var(--gold); font-weight: 700; }


/* ==========================================================================
   RESPONSIVE — TABLET (≤768px)
   ========================================================================== */
@media (width <= 768px) {
  .game-log-panel { display: none; }
  .poker-table { padding: 12px; border-width: 10px; min-height: 280px; overflow: visible; }
  .player-badge { padding: 4px 8px; min-width: 70px; }
  .player-badge .name { font-size: 0.73rem; }
  .player-badge .info { font-size: 0.63rem; }
  .player-badge .score { font-size: 0.6rem; }
  .my-hand .playing-card { width: 46px; height: 64px; }
  .my-hand .playing-card .card-rank { font-size: 0.9rem; }
  .my-hand .playing-card .card-suit { font-size: 1rem; }
  .pile-card { width: 58px; height: 82px; }
  .pile-card.draw-pile .card-count { font-size: 1.1rem; }
  .my-badge { padding: 3px 8px; min-width: 70px; }
  .my-badge .name { font-size: 0.73rem; }
  .my-badge .info { font-size: 0.63rem; }
  .game-header { padding: 6px 16px; }
  .btn-small { padding: 5px 10px; font-size: .73rem; }
  .my-hand { padding: 5px 8px; }
  /* Mini cards in sets */
  .mini-card { width: 16px; height: 22px; }
  .mini-card .mc-rank { font-size: 0.42rem; }
  .mini-card .mc-suit { font-size: 0.38rem; }
  /* Two-row hand */
  .my-hand-two-rows { gap: 3px; padding: 4px 6px; }
  .hand-row .playing-card { width: 46px; height: 64px; }
  .hand-row .playing-card .card-rank { font-size: 0.9rem; }
  .hand-row .playing-card .card-suit { font-size: 1rem; }
}


/* ==========================================================================
   RESPONSIVE — MOBILE (≤640px)
   ========================================================================== */
@media (width <= 640px) {
  .poker-table { border-radius: var(--radius-lg); border-width: 6px; padding: 8px; min-height: 220px; overflow: visible; }
  .player-badge { padding: 3px 6px; min-width: 55px; }
  .player-badge .name { font-size: 0.68rem; }
  .player-badge .info { font-size: 0.58rem; }
  .player-badge .score { font-size: 0.55rem; }
  /* Issue 3: give set chips more room & keep visible */
  .player-sets { max-width: 120px; gap: 2px; }
  .set-chip { font-size: 0.6rem; padding: 2px 5px; }
  .my-hand .playing-card { width: 44px; height: 62px; }
  .my-hand .playing-card .card-rank { font-size: 0.84rem; }
  .my-hand .playing-card .card-suit { font-size: 0.92rem; }
  .my-badge { padding: 2px 6px; min-width: 50px; }
  .my-badge .name { font-size: 0.68rem; }
  .my-badge .info { font-size: 0.58rem; }
  .my-zone { width: 96%; max-height: 36vh; }
  .my-actions { gap: 4px; }
  .btn-small { padding: 4px 8px; font-size: .68rem; }
  .pile-card { width: 48px; height: 68px; }
  .pile-card.draw-pile .card-count { font-size: 0.95rem; }
  .piles-row { gap: 14px; }
  /* Issue 1: labels above pile cards so they don't overlap status pill */
  .pile { flex-direction: column-reverse; }
  .pile-label { color: rgba(255,255,255,0.75); }
  .table-sets-display { gap: 3px; padding: 3px; }
  .status-pill { font-size: 0.72rem; padding: 5px 12px; }
  .game-header { padding: 5px 12px; height: 34px; max-height: 34px; }
  .round-badge { padding: 3px 8px; font-size: .72rem; }
  .objective-badge { font-size: .68rem; }
  .modal { padding: 20px; }
  .modal-title { font-size: 1.2rem; }
  .modal-subtitle { font-size: 0.9rem; }
  .score-table th, .score-table td { padding: 8px; }
  .claim-banner, .replenish-banner { padding: 8px 12px; gap: 8px; font-size: .78rem; }
  .claim-timer { font-size: 1.1rem; min-width: 40px; }
  /* Issue 2: hand scrolls from left so all cards are reachable */
  .my-hand { padding: 4px 6px; justify-content: flex-start; }
  .my-hand-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pinch-zoom; }
  /* Pending sets compact */
  .pending-sets { padding: 6px 8px; margin-top: 4px; }
  .pending-set-row { padding: 4px; gap: 4px; margin-bottom: 4px; font-size: 0.72rem; }
  /* Mini cards */
  .mini-card { width: 15px; height: 21px; }
  .mini-card .mc-rank { font-size: 0.4rem; }
  .mini-card .mc-suit { font-size: 0.36rem; }
  .mini-cards-group { gap: 1px; padding: 1px 2px; }
  /* Two-row hand on mobile */
  .my-hand-two-rows { gap: 3px; padding: 3px 6px; }
  .hand-row { gap: 2px; }
  .hand-row .playing-card { width: 44px; height: 62px; }
  .hand-row .playing-card .card-rank { font-size: 0.84rem; }
  .hand-row .playing-card .card-suit { font-size: 0.92rem; }
}


/* ==========================================================================
   RESPONSIVE — SMALL MOBILE (≤430px, iPhone SE / 14 / 15 size)
   ========================================================================== */
@media (width <= 430px) {
  /* Issue 1 reinforcement: labels clearly sit above pile cards */
  .pile { flex-direction: column-reverse; gap: 4px; }
  .pile-label { font-size: 0.6rem; letter-spacing: 0.06em; color: rgba(255,255,255,0.8); }
  /* Give table-center a bit more gap so label + pill don't crowd */
  .table-center { gap: 6px; }

  /* Issue 2: hand tray — fixed height, left-aligned scroll */
  .my-zone { max-height: 38vh; gap: 4px; }
  .my-hand-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pinch-zoom;
    width: 100%;
    /* Subtle scroll-hint gradient on right edge */
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
  }
  .my-hand {
    justify-content: flex-start;
    padding: 5px 8px;
    gap: 5px;
    /* Don't wrap — explicit horizontal scroll */
    flex-wrap: nowrap;
  }
  .my-hand .playing-card { width: 44px; height: 62px; flex-shrink: 0; }
  .my-hand .playing-card .card-rank { font-size: 0.82rem; }
  .my-hand .playing-card .card-suit { font-size: 0.9rem; }

  /* Pending sets — compact on small screens */
  .pending-sets { padding: 5px 6px; margin-top: 3px; max-width: 95%; }
  .pending-set-row { padding: 3px; gap: 3px; margin-bottom: 3px; font-size: 0.65rem; }
  .pending-set-remove { font-size: 0.75rem; padding: 1px 4px; }

  /* Issue 3: player set chips — visible on tiny screens */
  .player-zone { max-width: 125px; }
  .player-badge { min-width: 60px; }
  .player-sets { max-width: 120px; gap: 2px; margin-top: 3px; }
  .set-chip {
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 56px;
  }
  /* Mini cards — small mobile */
  .mini-card { width: 14px; height: 20px; }
  .mini-card .mc-rank { font-size: 0.38rem; }
  .mini-card .mc-suit { font-size: 0.34rem; }
  .mini-cards-group { gap: 0px; padding: 1px 2px; border-radius: 3px; }
  /* Two-row hand — small mobile */
  .my-hand-two-rows { gap: 2px; padding: 2px 4px; }
  .hand-row { gap: 2px; min-height: 38px; }
  .hand-row .playing-card { width: 40px; height: 56px; flex-shrink: 0; }
  .hand-row .playing-card .card-rank { font-size: 0.78rem; }
  .hand-row .playing-card .card-suit { font-size: 0.85rem; }
}


/* ==========================================================================
   RESPONSIVE — LANDSCAPE PHONE (short viewport, ≤440px height)
   Phones in landscape have wide width but very short height, so the
   width-based breakpoints above don't fire. Target by max-height instead.
   Strategy: keep everything in normal flow (no position:fixed — breaks on
   iOS Safari). Narrow the game-log, push table-center upward, and give
   the hand tray a generous 54% allocation with bottom:0.
   ========================================================================== */
@media (max-height: 440px) and (orientation: landscape) {

  /* ---- HEADER: ultra-compact ---- */
  .game-header { padding: 2px 8px; height: 24px; max-height: 24px; }
  .round-badge { padding: 1px 6px; font-size: .62rem; }
  .objective-badge { font-size: .58rem; }
  .btn-small { padding: 2px 6px; font-size: .6rem; }

  /* ---- CLAIM / REPLENISH BANNERS: compact, stays in flow ---- */
  .claim-banner, .replenish-banner {
    padding: 3px 8px;
    gap: 4px;
    font-size: .62rem;
    margin: 0 4px;
  }
  .claim-timer { font-size: 0.85rem; min-width: 28px; }
  .claim-info .claim-title { font-size: .68rem; }
  .claim-info .claim-sub { font-size: .55rem; }

  /* ---- GAME LOG: narrow but still visible ---- */
  .game-log-panel {
    width: 110px;
    min-width: 110px;
  }
  .log-panel-header {
    padding: 3px 6px;
    font-size: .5rem;
    letter-spacing: 1px;
  }
  .game-log-panel .game-log {
    padding: 3px 5px;
  }
  .game-log-panel .game-log p {
    font-size: .58rem;
    padding: 2px 0;
    line-height: 1.3;
  }
  /* Log set items compact */
  .log-set-item {
    padding: 2px 5px;
    gap: 3px;
  }
  .log-sets-summary {
    max-height: 45%;
    overflow-y: auto;
  }

  /* ---- TABLE WRAPPER: less padding ---- */
  .table-wrapper { padding: 2px 4px; }

  /* ---- POKER TABLE: flex fills available height ---- */
  .poker-table {
    border-width: 5px;
    padding: 4px;
    min-height: 130px;
    overflow: visible;
  }
  /* Thinner outer rail */
  .poker-table::before { inset: -8px; }

  /* ---- PLAYER BADGES: tiny ---- */
  .player-badge { padding: 2px 4px; min-width: 44px; }
  .player-badge .name { font-size: 0.58rem; }
  .player-badge .info { font-size: 0.48rem; }
  .player-badge .score { font-size: 0.46rem; padding: 0px 3px; }
  .player-zone { max-width: 95px; }

  /* ---- SET CHIPS: compact ---- */
  .player-sets { max-width: 85px; gap: 1px; }
  .set-chip { font-size: 0.5rem; padding: 1px 3px; }

  /* ---- PILE CARDS: much smaller in landscape ---- */
  .pile-card { width: 28px; height: 40px; }
  .pile-card.draw-pile .card-count { font-size: 0.65rem; }
  .piles-row { gap: 6px; }
  .pile { flex-direction: column-reverse; gap: 1px; }
  .pile-label { font-size: 0.42rem; color: rgba(255,255,255,0.75); }

  /* ---- TABLE CENTER: pushed UP to 35% so piles clear the hand area ---- */
  .status-pill { font-size: 0.52rem; padding: 1px 5px; }
  .table-center { gap: 2px; top: 35%; }
  .table-sets-display { gap: 2px; padding: 2px; }
  .pending-sets { padding: 4px 6px; font-size: 0.6rem; }

  /* ---- MY ZONE: generous 54%, flush at bottom ----
     Stays position:absolute inside the poker-table (no iOS fixed bugs).
     bottom:0 + 54% max-height gives the hand nearly half the table.   */
  .my-zone {
    max-height: 54%;
    gap: 1px;
    padding-bottom: 2px;
    width: 100%;
    bottom: 0;
  }
  .my-badge { padding: 1px 4px; min-width: 40px; }
  .my-badge .name { font-size: 0.52rem; }
  .my-badge .info { font-size: 0.44rem; }
  .my-badge .score { font-size: 0.42rem; }

  /* ---- HAND: scrollable row with readable cards (36×52) ---- */
  .my-hand-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pinch-zoom;
    width: 100%;
    mask-image: linear-gradient(to right, black 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 88%, transparent 100%);
  }
  .my-hand {
    justify-content: flex-start;
    padding: 3px 6px;
    gap: 3px;
    flex-wrap: nowrap;
  }
  .hand-row .playing-card,
  .my-hand .playing-card { width: 36px; height: 52px; flex-shrink: 0; }
  .hand-row .playing-card .card-rank,
  .my-hand .playing-card .card-rank { font-size: 0.72rem; }
  .hand-row .playing-card .card-suit,
  .my-hand .playing-card .card-suit { font-size: 0.78rem; }

  .my-hand-two-rows { gap: 1px; padding: 1px 3px; }
  .hand-row { gap: 2px; min-height: 30px; justify-content: flex-start; }

  /* Mini cards — landscape */
  .mini-card { width: 12px; height: 17px; }
  .mini-card .mc-rank { font-size: 0.32rem; }
  .mini-card .mc-suit { font-size: 0.3rem; }
  .mini-cards-group { gap: 0px; padding: 1px 1px; }

  /* ---- ACTIONS: ultra-compact ---- */
  .my-actions { gap: 2px; padding-top: 0; }
  .my-actions .btn-small { padding: 2px 5px; font-size: 0.52rem; }

  /* ---- MODAL: compact ---- */
  .modal { padding: 12px; }
  .modal-title { font-size: 1rem; }
  .modal-subtitle { font-size: .75rem; margin-bottom: 12px; }
  .score-table th, .score-table td { padding: 4px 6px; font-size: .68rem; }
}


/* ==========================================================================
   SCROLLBAR — Refined, minimal
   ========================================================================== */
/* ==========================================================================
   MINI CARDS — Visual set/straight chips replacing text
   ========================================================================== */
.mini-cards-group {
  display: flex;
  gap: 1px;
  padding: 2px 3px;
  background: rgba(0,0,0,0.25);
  border-radius: 4px;
  border: 1px solid rgba(139,115,85,0.2);
  align-items: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  min-width: 0;
  overflow: hidden;
  flex-wrap: wrap;
}
.mini-cards-group:hover { background: rgba(0,0,0,0.4); border-color: rgba(139,115,85,0.4); }
.mini-cards-group.drag-over {
  background: rgba(212,165,55,0.25);
  border-color: var(--gold);
  box-shadow: 0 0 6px rgba(212,165,55,0.3);
}
.mini-card {
  width: 18px;
  height: 25px;
  border-radius: 2px;
  background: linear-gradient(170deg, #fefcf6, #f0ebd8);
  border: 1px solid #c4b48e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  overflow: hidden;
}
.mini-card .mc-rank {
  font-size: 0.45rem;
  font-weight: 700;
  line-height: 1;
}
.mini-card .mc-suit {
  font-size: 0.42rem;
  line-height: 1;
}
.mini-card.mc-red { color: var(--card-red); }
.mini-card.mc-black { color: #1a1a1a; }
.mini-card.mc-joker {
  background: linear-gradient(135deg, #2a7548, #1d5c36);
  color: var(--text-cream);
  font-size: 0.35rem;
  font-weight: 700;
}

/* ==========================================================================
   TWO-ROW HAND — Fan cards across two rows
   ========================================================================== */
.my-hand-two-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 8px;
  width: 100%;
}
.hand-row {
  display: flex;
  gap: 3px;
  justify-content: center;
  flex-wrap: nowrap;
  min-height: 44px;
}
.hand-row .card-drag-wrapper {
  transition: transform .15s ease, opacity .15s;
}

/* Touch drag ghost card */
.touch-drag-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.85;
  transform: scale(1.1) rotate(-3deg);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}
.card-drag-wrapper.touch-dragging {
  opacity: 0.3;
  transform: scale(0.9);
}
.card-drag-wrapper.touch-drag-over {
  transform: translateX(8px);
  transition: transform .15s ease;
}

/* ==========================================================================
   SCROLLBAR — Refined, minimal
   ========================================================================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(93,74,56,0.35); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(93,74,56,0.55); }
