/* ==========================================================================
   DOMINO GAPLE - MODERN LUXURY FELT DESIGN SYSTEM
   ========================================================================== */

:root {
  --felt-dark: #082113;
  --felt-mid: #0e3b22;
  --felt-light: #155231;
  --felt-border: #2b1d0c;
  --gold-primary: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.45);
  --gold-light: #fbeea4;
  --mahogany: #3e1c14;
  --mahogany-dark: #230d08;
  --surface-glass: rgba(12, 34, 20, 0.75);
  --surface-border: rgba(212, 175, 55, 0.25);
  --text-primary: #f5f9f6;
  --text-muted: #9db2a4;
  --danger: #e63946;
  --success: #2a9d8f;
  --tile-bg: #fcfaf3;
  --tile-edge: #d8ceb8;
  --pip-black: #1a1a1a;
  --pip-red: #c9182b;
  --shadow-tile: 0 4px 10px rgba(0, 0, 0, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.8);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background: radial-gradient(circle at center, #132a1b 0%, #08140c 100%);
  color: var(--text-primary);
  user-select: none;
}

/* Background Atmosphere */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* Header Bar */
.game-header {
  height: 52px;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  background: rgba(8, 20, 12, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-border);
  z-index: 100;
}

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

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
  color: var(--mahogany-dark);
  box-shadow: 0 4px 12px var(--gold-glow);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, #fff, var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.room-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--surface-border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-light);
  cursor: pointer;
  transition: all 0.2s;
}

.room-badge:hover {
  background: rgba(212, 175, 55, 0.25);
  transform: scale(1.03);
}

.btn-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* ==========================================================================
   LOBBY / WELCOME MODAL
   ========================================================================== */
.view-panel {
  display: none;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 52px);
  height: calc(100dvh - 52px);
  overflow: hidden;
  position: relative;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
}

#view-lobby, #view-waiting {
  overflow-y: auto;
}

.lobby-container {
  max-width: 540px;
  margin: auto;
  padding: 24px;
  width: 100%;
}

.card-glass {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(212, 175, 55, 0.08);
}

.lobby-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  color: var(--mahogany-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f7d070, #cf9d26);
  color: #261304;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.35);
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.5);
}

.btn-secondary {
  padding: 10px 18px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-stop-game {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(230, 57, 70, 0.2);
  border: 1px solid var(--danger);
  color: #ff9f9f;
  padding: 5px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-stop-game:hover {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 0 14px rgba(230, 57, 70, 0.6);
  transform: scale(1.03);
}

.btn-danger {
  background: linear-gradient(135deg, #e63946, #c9182b);
  border: none;
  color: #fff;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(230, 57, 70, 0.4);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(230, 57, 70, 0.6);
}

.btn-danger-subtle {
  border-color: rgba(230, 57, 70, 0.4) !important;
  color: #ffb3ba !important;
}

.btn-danger-subtle:hover {
  background: rgba(230, 57, 70, 0.25) !important;
  color: #fff !important;
}

/* ==========================================================================
   WAITING ROOM LOBBY
   ========================================================================== */
.waiting-container {
  max-width: 680px;
  margin: auto;
  padding: 24px;
  width: 100%;
}

.player-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.slot-card {
  background: rgba(0, 0, 0, 0.3);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 20px 12px;
  text-align: center;
  position: relative;
  transition: all 0.3s;
}

.slot-card.filled {
  border-style: solid;
  border-color: var(--surface-border);
  background: rgba(18, 48, 30, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.slot-avatar {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a5d3f, #153924);
  border: 2px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.slot-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.slot-role {
  font-size: 0.75rem;
  color: var(--gold-light);
  font-weight: 600;
}

.slot-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(230, 57, 70, 0.25);
  border: 1px solid var(--danger);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   GAME TABLE ARENA (THE MAIN GAME STAGE)
   ========================================================================== */
.table-arena {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 12px;
}

/* Casino Felt Surface with 3D Wood Trim */
.felt-table {
  position: absolute;
  inset: 6px;
  background: radial-gradient(ellipse at center, var(--felt-light) 0%, var(--felt-mid) 50%, var(--felt-dark) 95%);
  border-radius: 24px;
  border: 10px solid var(--mahogany);
  box-shadow: 
    inset 0 0 80px rgba(0, 0, 0, 0.8),
    0 10px 25px rgba(0, 0, 0, 0.7),
    inset 0 0 0 2px var(--gold-primary);
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

/* Table Felt Watermark Logo */
.felt-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 5rem;
  font-weight: 900;
  letter-spacing: 8px;
  color: rgba(255, 255, 255, 0.03);
  pointer-events: none;
  white-space: nowrap;
  text-transform: uppercase;
}

/* Table Center: Domino Chain Board (Flex child between opponents and hand) */
.board-container {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  z-index: 5;
  padding: 6px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-primary) rgba(0, 0, 0, 0.3);
}

/* Custom horizontal scrollbar on board table */
.board-container::-webkit-scrollbar {
  height: 6px;
}
.board-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  margin: 0 40px;
}
.board-container::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #cfaf5c, var(--gold-primary));
  border-radius: 999px;
  box-shadow: 0 0 6px var(--gold-glow);
}

.board-chain {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 32px;
  min-width: max-content;
  margin: auto;
  position: relative;
}

/* Drop Target Indicators on ends */
.end-drop-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 80px;
  border: 2px dashed var(--gold-primary);
  background: rgba(212, 175, 55, 0.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  animation: pulseGold 1.5s infinite;
  transition: all 0.2s;
  z-index: 10;
}

.end-drop-indicator:hover {
  background: rgba(212, 175, 55, 0.35);
  transform: scale(1.08);
}

.end-drop-indicator span {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gold-light);
  text-transform: uppercase;
}

@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 10px var(--gold-glow); }
  50% { box-shadow: 0 0 24px rgba(212, 175, 55, 0.8); }
}

/* ==========================================================================
   OPPONENTS (TOP, LEFT, RIGHT SEATS)
   ========================================================================== */
.opponents-wrapper {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  flex-wrap: wrap;
  max-width: 100%;
  pointer-events: none;
}

.opponent-badge {
  background: rgba(6, 20, 12, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 5px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  transition: all 0.25s ease;
  max-width: 100%;
}

.opponent-badge.active-turn {
  border-color: #2ecc71;
  box-shadow: 0 0 16px rgba(46, 204, 113, 0.6), 0 0 4px var(--gold-primary);
  transform: scale(1.03);
  animation: pulseActiveTurn 2s infinite ease-in-out;
}

@keyframes pulseActiveTurn {
  0%, 100% {
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.4), 0 0 4px var(--gold-primary);
    border-color: rgba(46, 204, 113, 0.8);
  }
  50% {
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.8), 0 0 8px var(--gold-glow);
    border-color: #2ecc71;
  }
}

.opp-avatar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.opp-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.opp-check-dot {
  position: absolute;
  bottom: -2px;
  right: -3px;
  width: 15px;
  height: 15px;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  border: 1.5px solid #08180f;
  box-shadow: 0 0 6px rgba(46, 204, 113, 0.9);
  animation: bounceCheck 1.6s infinite ease-in-out;
}

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

.opp-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  line-height: 1.2;
}

.opp-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.opp-name {
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text-main, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.opp-turn-pill {
  background: rgba(46, 204, 113, 0.22);
  border: 1px solid rgba(46, 204, 113, 0.7);
  color: #2ecc71;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  animation: glowPill 1.5s infinite alternate;
}

@keyframes glowPill {
  from { box-shadow: 0 0 3px rgba(46, 204, 113, 0.4); }
  to { box-shadow: 0 0 10px rgba(46, 204, 113, 0.85); }
}

.opp-score-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.opp-score-text {
  font-size: 0.72rem;
  color: var(--gold-light, #ffd166);
  font-weight: 600;
  white-space: nowrap;
}

.opp-cards-badge {
  background: linear-gradient(135deg, rgba(22, 66, 40, 0.95), rgba(10, 32, 18, 0.98));
  border: 1px solid rgba(212, 175, 55, 0.55);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.12), 0 2px 6px rgba(0, 0, 0, 0.4);
  padding: 3px 9px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  cursor: default;
}

.opp-cards-icon {
  font-size: 14px;
  line-height: 1;
}

.opp-cards-num {
  color: var(--gold-primary, #ffd166);
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1;
}

.turn-check-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  background: #211105;
  color: #f7d070;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  margin-right: 4px;
  vertical-align: middle;
}

.lb-turn-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: #2ecc71;
  color: #08180f;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
  margin-right: 3px;
}

/* ==========================================================================
   PLAYER DECK (BOTTOM CONTROLS & HAND)
   ========================================================================== */
/* ==========================================================================
   PLAYER DECK (BOTTOM CONTROLS & HAND)
   ========================================================================== */
.player-dock {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  margin-top: auto;
  padding: 4px 12px 10px;
}

.turn-notification-bar {
  margin-bottom: 4px;
  padding: 3px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: all 0.3s;
}

.turn-notification-bar.my-turn {
  background: linear-gradient(135deg, #f7d070, #c89524);
  color: #211105;
  animation: glowTurn 1.5s infinite alternate;
}

.turn-notification-bar.other-turn {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
}

@keyframes glowTurn {
  from { box-shadow: 0 0 10px var(--gold-glow); }
  to { box-shadow: 0 0 22px rgba(247, 208, 112, 0.8); }
}

.turn-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.player-hand-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(4, 14, 8, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  max-width: 95vw;
  overflow-x: auto;
}

.hand-actions-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* Dynamic End Choice for Dual-Match Moves */
.card-choice-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 38, 24, 0.95);
  border: 1px solid var(--gold-primary);
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 12px var(--gold-glow);
  animation: pulseGold 2s infinite;
}

.btn-choice-end {
  background: linear-gradient(135deg, #f7d070, #c89524);
  border: 1px solid #ffe8a3;
  color: #1a0e05;
  padding: 5px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.btn-choice-end strong {
  color: #5c3a00;
  margin-left: 2px;
}

.btn-choice-end:active {
  transform: scale(0.95);
}

.btn-choice-cancel {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-choice-cancel:hover {
  background: rgba(230, 57, 70, 0.6);
  border-color: var(--danger);
}

.btn-pass {
  background: linear-gradient(135deg, #c9182b, #8a0e1c);
  border: none;
  color: #fff;
  padding: 5px 20px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(201, 24, 43, 0.3);
  transition: all 0.2s;
}

.btn-pass:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(201, 24, 43, 0.5);
}

.btn-pass:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

/* ==========================================================================
   AUTHENTIC DOMINO TILE COMPONENT (3D STONE LOOK)
   ========================================================================== */
.domino-tile {
  background: linear-gradient(145deg, #ffffff 0%, #f6f3ea 40%, #e6ddce 100%);
  border: 1px solid var(--tile-edge);
  border-radius: 7px;
  box-shadow: var(--shadow-tile);
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  user-select: none;
}

/* Vertical Tile in Hand - Proportional 44px x 84px to prevent overlapping */
.domino-tile.in-hand {
  width: 44px;
  height: 84px;
  flex-direction: column;
}

.domino-tile.in-hand:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.6), 0 0 14px var(--gold-glow);
  z-index: 10;
}

.domino-tile.playable {
  border-color: var(--gold-primary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 14px var(--gold-glow);
  animation: tileBounce 2s infinite ease-in-out;
}

@keyframes tileBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.domino-tile.selected {
  transform: translateY(-12px) scale(1.05) !important;
  border-color: #fff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.7), 0 0 18px rgba(255, 255, 255, 0.8) !important;
  z-index: 20;
}

/* On-Board Tiles */
.domino-tile.on-board {
  cursor: default;
}

.domino-tile.on-board.horizontal {
  width: 76px;
  height: 40px;
  flex-direction: row;
}

/* Balak oriented crosswise (melintang) */
.domino-tile.on-board.balak-vertical {
  width: 40px;
  height: 76px;
  flex-direction: column;
}

/* Half Sections of Tile */
.tile-half {
  flex: 1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 4px;
}

/* Brass Divider Line */
.tile-divider-h {
  height: 2px;
  background: linear-gradient(to right, #cfaf5c, #8e7330);
  margin: 0 4px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
}

.tile-divider-v {
  width: 2px;
  background: linear-gradient(to bottom, #cfaf5c, #8e7330);
  margin: 4px 0;
  box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.5);
}

/* Pip (Dot) Styling with 3D Emboss */
.pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: auto;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.4);
}

.pip.black {
  background: radial-gradient(circle at 35% 35%, #444, #111);
}

.pip.red {
  background: radial-gradient(circle at 35% 35%, #ff4b5c, #9d0818);
}

/* Standard Domino Pip Placements in 3x3 Grid */
.p-tl { grid-area: 1 / 1; }
.p-tc { grid-area: 1 / 2; }
.p-tr { grid-area: 1 / 3; }
.p-ml { grid-area: 2 / 1; }
.p-mc { grid-area: 2 / 2; }
.p-mr { grid-area: 2 / 3; }
.p-bl { grid-area: 3 / 1; }
.p-bc { grid-area: 3 / 2; }
.p-br { grid-area: 3 / 3; }

/* Small pip adjustments for board tiles */
.domino-tile.on-board .pip {
  width: 6px;
  height: 6px;
}

/* ==========================================================================
   ROUND OVER & GAPLE MODAL
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--surface-glass);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px var(--gold-glow);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(to right, #fff, var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.score-table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
}

.score-table th, .score-table td {
  padding: 10px 14px;
  text-align: left;
}

.score-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

/* Quick Emotes Floating Bar */
.chat-dock {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}

.emotes-popup {
  position: absolute;
  bottom: 50px;
  right: 0;
  background: rgba(10, 26, 16, 0.95);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  display: none;
}

.emotes-popup.open {
  display: grid;
}

.emote-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  font-size: 24px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

.emote-btn:hover {
  transform: scale(1.3);
}

/* Floating animated reaction */
.floating-reaction {
  position: fixed;
  font-size: 48px;
  pointer-events: none;
  z-index: 1000;
  animation: floatUpFade 2.5s forwards ease-out;
}

@keyframes floatUpFade {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  20% { transform: translateY(-30px) scale(1.2); opacity: 1; }
  80% { transform: translateY(-100px) scale(1); opacity: 1; }
  100% { transform: translateY(-150px) scale(0.8); opacity: 0; }
}

/* Toast alert notification */
.toast-notice {
  position: fixed;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 38, 24, 0.95);
  border: 1px solid var(--gold-primary);
  color: #fff;
  padding: 10px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 999;
  animation: dropIn 0.3s forwards;
}

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

/* ==========================================================================
   GAME LAYOUT & RESPONSIVE LEADERBOARD
   ========================================================================== */
.game-layout-container {
  display: flex;
  flex: 1;
  min-height: 0;
  height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Endless Mode Info Pill in Lobby */
.endless-mode-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--surface-border);
  padding: 12px 16px;
  border-radius: var(--radius-md);
}

/* LAPTOP / DESKTOP MODE (>= 992px): Leaderboard on the Side */
@media (min-width: 992px) {
  .game-layout-container {
    flex-direction: row;
    height: 100%;
    min-height: 0;
  }

  .table-arena {
    flex: 1;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 8px 12px;
  }

  .felt-table {
    inset: 6px;
    border-radius: 24px;
    border: 10px solid var(--mahogany);
  }

  .leaderboard-panel {
    width: 290px;
    min-width: 270px;
    max-width: 310px;
    height: 100%;
    border-left: 1px solid var(--surface-border);
    background: rgba(8, 22, 14, 0.92);
    backdrop-filter: blur(18px);
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 40;
    flex-shrink: 0;
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.6);
  }
}

/* HP / TABLET MODE (< 992px): Leaderboard at the Bottom */
@media (max-width: 991px) {
  .game-layout-container {
    flex-direction: column;
    min-height: calc(100vh - 63px);
    overflow-y: auto;
  }

  .table-arena {
    min-height: 540px;
    height: 72vh;
    flex: none;
    position: relative;
  }

  /* Responsive On-Board Tiles on Tablet (< 992px) */
  .domino-tile.on-board.horizontal {
    width: 62px;
    height: 32px;
  }

  .domino-tile.on-board.balak-vertical {
    width: 32px;
    height: 62px;
  }

  .domino-tile.on-board .pip {
    width: 5px;
    height: 5px;
  }

  .end-drop-indicator {
    width: 36px;
    height: 64px;
  }

  .end-drop-indicator span {
    font-size: 0.68rem;
  }

  .board-chain {
    padding: 10px 20px;
    gap: 3px;
  }

  .leaderboard-panel {
    width: 100%;
    border-top: 2px solid var(--surface-border);
    border-left: none;
    background: rgba(8, 22, 14, 0.96);
    backdrop-filter: blur(16px);
    padding: 14px 16px 24px;
    z-index: 40;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6);
    margin-top: auto;
  }

  /* Horizontal swipeable cards on mobile/tablet */
  .leaderboard-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
    gap: 10px !important;
  }

  .leaderboard-item {
    flex-direction: column !important;
    text-align: center !important;
    padding: 10px 8px !important;
    gap: 6px !important;
  }

  .leaderboard-item .player-details {
    text-align: center !important;
  }

  .leaderboard-item .score-box {
    text-align: center !important;
  }
}

/* Leaderboard Header Elements */
.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

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

.leaderboard-trophy {
  font-size: 22px;
  filter: drop-shadow(0 2px 6px var(--gold-glow));
}

.leaderboard-heading {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #fff, var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.leaderboard-round-badge {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--surface-border);
  color: var(--gold-light);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

/* Scoring Rule Pill (+5 Win / +0 Lose) */
.leaderboard-rule-pill {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.badge-win {
  flex: 1;
  background: rgba(42, 157, 143, 0.2);
  border: 1px solid var(--success);
  color: #64dfdf;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  text-align: center;
  font-weight: 600;
}

.badge-lose {
  flex: 1;
  background: rgba(230, 57, 70, 0.15);
  border: 1px solid rgba(230, 57, 70, 0.35);
  color: #ff9f9f;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  text-align: center;
  font-weight: 600;
}

/* Leaderboard Cards List */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leaderboard-item {
  background: rgba(14, 38, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  transition: all 0.25s;
}

.leaderboard-item:hover {
  transform: translateY(-2px);
  background: rgba(18, 48, 30, 0.85);
}

/* Rank 1 Highlight */
.leaderboard-item.rank-1 {
  background: linear-gradient(135deg, rgba(42, 70, 48, 0.85), rgba(18, 40, 26, 0.9));
  border-color: var(--gold-primary);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.2);
}

/* Active Turn Highlight */
.leaderboard-item.active-turn {
  border-color: #ffd166;
  box-shadow: 0 0 16px var(--gold-glow);
  animation: pulseGoldBorder 1.5s infinite alternate;
}

@keyframes pulseGoldBorder {
  from { box-shadow: 0 0 8px var(--gold-glow); }
  to { box-shadow: 0 0 20px rgba(255, 209, 102, 0.8); }
}

.rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.rank-badge.gold {
  background: linear-gradient(135deg, #ffe066, #d4af37);
  color: #1a1002;
  box-shadow: 0 2px 8px var(--gold-glow);
}

.rank-badge.silver {
  background: linear-gradient(135deg, #ffffff, #a4b0be);
  color: #1e272e;
}

.rank-badge.bronze {
  background: linear-gradient(135deg, #e58e26, #b71540);
  color: #fff;
}

.rank-badge.regular {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.player-avatar {
  font-size: 24px;
  flex-shrink: 0;
}

.player-details {
  flex: 1;
  min-width: 0;
}

.player-details-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-details-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.score-box {
  text-align: right;
  flex-shrink: 0;
}

.score-box-pts {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--gold-light);
  line-height: 1;
}

.score-box-sub {
  font-size: 0.7rem;
  color: var(--gold-primary);
  font-weight: 600;
  margin-top: 2px;
}

/* ==========================================================================
   ROUND OVER & SHUFFLE MODAL ENHANCEMENTS
   ========================================================================== */
.shuffle-modal-card {
  max-width: 620px !important;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 26px !important;
  border-radius: var(--radius-lg);
  border: 2px solid var(--gold-primary) !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 40px var(--gold-glow) !important;
}

/* Shuffler Announcement Box */
.shuffler-announcement-card {
  background: linear-gradient(135deg, rgba(82, 18, 25, 0.85), rgba(35, 12, 16, 0.9));
  border: 1px solid rgba(230, 57, 70, 0.5);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.shuffler-badge {
  position: absolute;
  top: 8px;
  right: 12px;
  background: rgba(230, 57, 70, 0.25);
  border: 1px solid var(--danger);
  color: #ffb3ba;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.shuffler-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9182b, #780e1c);
  border: 2px solid #ff6b81;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(230, 57, 70, 0.5);
}

.shuffler-info {
  flex: 1;
}

.shuffler-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}

.shuffler-reason {
  font-size: 0.85rem;
  color: #ffccd0;
}

/* Shuffle Count Input Section */
.shuffle-config-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 14px;
  text-align: center;
}

.shuffle-counter-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 10px 0;
}

.btn-stepper {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold-primary);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-stepper:hover {
  background: var(--gold-primary);
  color: #1a1002;
  transform: scale(1.1);
}

.shuffle-number-input {
  width: 74px;
  height: 44px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 900;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid var(--gold-primary);
  border-radius: 10px;
  color: var(--gold-light);
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
}

.shuffle-number-input:focus {
  box-shadow: 0 0 16px var(--gold-glow);
  border-color: #fff;
}

.shuffle-unit {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--gold-light);
}

.shuffle-preset-pills {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.preset-pill {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.preset-pill:hover {
  background: rgba(212, 175, 55, 0.2);
  color: #fff;
}

.preset-pill.active {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  color: #1a1002;
  border-color: var(--gold-light);
  box-shadow: 0 2px 8px var(--gold-glow);
}

.shuffle-algo-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Interactive Shuffling Animation Stage */
.shuffle-animation-stage {
  background: radial-gradient(ellipse at center, #1b4d2e 0%, #0d2b19 70%, #06150c 100%);
  border: 3px solid #3e1c14;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.2);
  border-radius: 18px;
  padding: 16px;
  margin: 16px 0;
  position: relative;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.shuffle-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.shuffle-pass-counter {
  background: rgba(0, 0, 0, 0.5);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
}

.shuffle-tiles-arena {
  position: relative;
  height: 120px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 3D Mini Domino Tile for Animation */
.mini-shuffle-tile {
  width: 22px;
  height: 42px;
  background: linear-gradient(145deg, #ffffff 0%, #ede8de 100%);
  border: 1px solid #c8bead;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  position: absolute;
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mini-shuffle-tile::after {
  content: '';
  width: 14px;
  height: 1px;
  background: #cfaf5c;
  margin: 2px 0;
}

/* Swirl Animation Class */
.mini-shuffle-tile.swirl {
  animation: tileSwirl 1.2s infinite ease-in-out;
}

@keyframes tileSwirl {
  0% { transform: translate(var(--x0), var(--y0)) rotate(var(--r0)); }
  50% { transform: translate(var(--x1), var(--y1)) rotate(calc(var(--r0) + 180deg)) scale(1.1); }
  100% { transform: translate(var(--x0), var(--y0)) rotate(calc(var(--r0) + 360deg)); }
}

/* Riffle Animation Class */
.mini-shuffle-tile.riffle {
  animation: tileRiffle 0.8s infinite ease-in-out;
}

@keyframes tileRiffle {
  0% { transform: translate(var(--rx0), var(--ry0)) rotate(var(--rr0)); }
  50% { transform: translate(0px, 0px) rotate(0deg) scale(1.05); }
  100% { transform: translate(var(--rx0), var(--ry0)) rotate(var(--rr0)); }
}

.shuffle-progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.shuffle-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-primary), #64dfdf);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Glowing Button for "Bagi Kartu" */
.btn-glow {
  background: linear-gradient(135deg, #ffe066, #d4af37) !important;
  color: #1a1002 !important;
  font-size: 1.1rem !important;
  font-weight: 800 !important;
  animation: pulseGlowBtn 1.2s infinite alternate !important;
}

@keyframes pulseGlowBtn {
  0% { box-shadow: 0 0 12px var(--gold-glow); transform: scale(1); }
  100% { box-shadow: 0 0 30px rgba(255, 224, 102, 0.9), 0 0 10px #fff; transform: scale(1.02); }
}

/* Responsive adjust for mobile */
@media (max-width: 600px) {
  .game-header { padding: 8px 12px; height: 46px; }
  .brand-title { font-size: 1rem; }
  .felt-table { border-width: 7px; inset: 4px; border-radius: 16px; }
  .domino-tile.in-hand { width: 38px; height: 72px; }
  .board-container { padding: 2px 4px; }
  .player-hand-container { padding: 5px 8px; gap: 4px; }
  .player-dock { padding: 2px 6px 6px; }
  .shuffle-modal-card { padding: 18px 14px !important; }

  /* Responsive Opponents on Mobile / HP */
  .opponents-wrapper {
    padding: 4px 6px;
    gap: 6px;
  }
  .opponent-badge {
    padding: 3px 8px;
    gap: 6px;
  }
  .opp-avatar {
    width: 26px;
    height: 26px;
    font-size: 15px;
  }
  .opp-check-dot {
    width: 13px;
    height: 13px;
    font-size: 8px;
    bottom: -2px;
    right: -2px;
  }
  .opp-name {
    font-size: 0.76rem;
    max-width: 68px;
  }
  .opp-score-text {
    font-size: 0.68rem;
  }
  .opp-turn-pill {
    font-size: 0.6rem;
    padding: 1px 4px;
  }
  .opp-cards-badge {
    padding: 2px 6px;
    font-size: 0.78rem;
    gap: 3px;
    border-radius: 6px;
  }
  .opp-cards-icon {
    font-size: 12px;
  }
  .opp-cards-num {
    font-size: 0.82rem;
  }

  /* Responsive On-Board Tiles on Mobile / HP */
  .domino-tile.on-board.horizontal {
    width: 48px;
    height: 25px;
  }
  .domino-tile.on-board.balak-vertical {
    width: 25px;
    height: 48px;
  }
  .domino-tile.on-board .pip {
    width: 4px;
    height: 4px;
  }
  .domino-tile.on-board .tile-half {
    padding: 2px;
  }
  .end-drop-indicator {
    width: 28px;
    height: 48px;
    border-width: 1.5px;
  }
  .end-drop-indicator span {
    font-size: 0.58rem;
  }
  .end-drop-indicator small {
    font-size: 0.58rem;
  }
  .board-chain {
    padding: 6px 14px;
    gap: 3px;
  }
}

/* Height-adaptive rules for Laptops and Netbooks (height <= 760px) */
@media (max-height: 760px) {
  .game-header {
    height: 46px;
    padding: 4px 16px;
  }
  .view-panel {
    height: calc(100vh - 46px);
    height: calc(100dvh - 46px);
  }
  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  .brand-title {
    font-size: 1.1rem;
  }
  .opponents-wrapper {
    padding: 4px 10px;
    gap: 8px;
  }
  .opponent-badge {
    padding: 3px 8px;
    gap: 6px;
  }
  .opp-avatar {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }
  .opp-cards-badge {
    padding: 2px 7px;
    font-size: 0.8rem;
  }
  .table-arena {
    padding: 6px 10px;
  }
  .felt-table {
    border-width: 8px;
    inset: 5px;
    border-radius: 20px;
  }
  .board-container {
    padding: 2px 12px;
  }
  .domino-tile.in-hand {
    width: 40px;
    height: 76px;
  }
  .domino-tile.in-hand:hover {
    transform: translateY(-6px) scale(1.02);
  }
  .player-dock {
    padding: 2px 8px 6px;
  }
  .turn-notification-bar {
    padding: 2px 14px;
    font-size: 0.78rem;
    margin-bottom: 3px;
  }
  .player-hand-container {
    padding: 4px 12px;
    gap: 5px;
    border-radius: 14px;
  }
  .btn-pass {
    padding: 3px 16px;
    font-size: 0.78rem;
    margin-top: 3px;
  }
  .leaderboard-panel {
    padding: 12px 10px;
  }
  .leaderboard-item {
    padding: 7px 10px;
    gap: 8px;
  }
  .score-box-pts {
    font-size: 1.05rem;
  }
}

/* Extra Compact Laptops (height <= 640px, e.g. 1366x768 with multiple toolbars) */
@media (max-height: 640px) {
  .game-header {
    height: 40px;
    padding: 2px 12px;
  }
  .view-panel {
    height: calc(100vh - 40px);
    height: calc(100dvh - 40px);
  }
  .brand-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  .brand-title {
    font-size: 0.98rem;
  }
  .opponents-wrapper {
    padding: 2px 8px;
    gap: 6px;
  }
  .opponent-badge {
    padding: 2px 6px;
    font-size: 0.72rem;
    gap: 5px;
  }
  .opp-avatar {
    width: 24px;
    height: 24px;
    font-size: 13px;
  }
  .opp-name {
    font-size: 0.72rem;
    max-width: 60px;
  }
  .opp-score-text {
    font-size: 0.65rem;
  }
  .opp-cards-badge {
    padding: 2px 5px;
    font-size: 0.72rem;
  }
  .table-arena {
    padding: 4px 6px;
  }
  .felt-table {
    border-width: 6px;
    inset: 4px;
    border-radius: 16px;
  }
  .domino-tile.in-hand {
    width: 36px;
    height: 68px;
  }
  .domino-tile.in-hand .pip {
    width: 6px;
    height: 6px;
  }
  .domino-tile.in-hand:hover {
    transform: translateY(-4px) scale(1.02);
  }
  .player-dock {
    padding: 1px 6px 4px;
  }
  .turn-notification-bar {
    padding: 2px 10px;
    font-size: 0.72rem;
    margin-bottom: 2px;
  }
  .player-hand-container {
    padding: 3px 8px;
    gap: 4px;
    border-radius: 10px;
  }
  .btn-pass {
    padding: 2px 12px;
    font-size: 0.72rem;
    margin-top: 2px;
  }
}
