/* ═══════════════════════════════════════════════════════════════════
   OKEY BROWSERGAME — PREMIUM CASINO / WOOD TABLE STYLING
   Modern Vector UI · High-Definition Visuals · Responsive Design
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* Felt & Table Colors */
  --felt-base: #0f3d20;
  --felt-radial-center: #1b5e32;
  --felt-radial-edge: #092312;
  --felt-shadow: rgba(0, 0, 0, 0.65);

  /* Luxury Wood Colors */
  --wood-walnut-light: #804a23;
  --wood-walnut-mid: #5c3417;
  --wood-walnut-dark: #3a1f0b;
  --wood-bevel-top: rgba(255, 255, 255, 0.15);
  --wood-bevel-bottom: rgba(0, 0, 0, 0.5);

  /* Gold & Metallic Accents */
  --gold-primary: #ffd700;
  --gold-secondary: #f5b041;
  --gold-dark: #b8860b;

  /* Authentic Okey Tile Colors */
  --tile-bg-top: #ffffff;
  --tile-bg-mid: #faf6eb;
  --tile-bg-bottom: #eee5d3;
  --tile-border: #d6ccb8;
  --tile-shadow: rgba(0, 0, 0, 0.45);

  /* Tile Digit Colors (Vibrant & High Contrast) */
  --tile-red: #d63031;
  --tile-blue: #0984e3;
  --tile-black: #212529;
  --tile-yellow: #d97706; /* Warm amber-orange: crystal clear on cream */

  /* Player Accent Rings */
  --ring-player: #2ecc71;
  --ring-can: #f39c12;
  --ring-deniz: #9b59b6;
  --ring-eren: #00cec9;

  /* UI Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* ══════════ Reset & Base ══════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at 50% 40%, var(--felt-radial-center) 0%, var(--felt-base) 60%, var(--felt-radial-edge) 100%);
  color: #f1f2f6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Felt Texture Vignette Overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 65%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
  z-index: 1;
}

/* ══════════ Icons ══════════ */
.ui-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon-trophy-gold {
  filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.4));
}

.icon-pulse {
  animation: icon-pulse-anim 1.5s infinite alternate ease-in-out;
}

@keyframes icon-pulse-anim {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.15); opacity: 1; }
}

/* ══════════ Top Header ══════════ */
.top-header {
  width: 100%;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  background: rgba(6, 20, 11, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 8px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 215, 0, 0.22);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ══════════ Elaborate Luxury Logo ══════════ */
.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  padding: 3px 0;
  transition: transform 0.25s ease;
}

.logo-area:hover {
  transform: translateY(-1px);
}

/* Emblem & Tile Cluster */
.logo-emblem {
  position: relative;
  width: 58px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-halo-ring {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 215, 0, 0.35);
  background: radial-gradient(circle, rgba(255, 215, 0, 0.14) 0%, rgba(255, 215, 0, 0.03) 60%, transparent 80%);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.18);
  pointer-events: none;
  animation: logo-halo-rotate 30s linear infinite;
}

@keyframes logo-halo-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.logo-tiles-cluster {
  position: relative;
  width: 50px;
  height: 42px;
}

/* Authentic Melamine Mini-Tiles */
.emblem-tile {
  position: absolute;
  width: 22px;
  height: 32px;
  background: linear-gradient(165deg, #ffffff 0%, #fbf9f4 45%, #ece2cd 100%);
  border-radius: 4.5px;
  border: 1px solid rgba(190, 160, 100, 0.6);
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.55), inset 0 1px 1px #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transform-origin: bottom center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease;
}

.emblem-tile-left {
  left: 2px;
  bottom: 2px;
  transform: rotate(-14deg);
  z-index: 1;
}

.emblem-tile-right {
  right: 2px;
  bottom: 2px;
  transform: rotate(14deg);
  z-index: 1;
}

.emblem-tile-center {
  left: 14px;
  bottom: 5px;
  transform: translateY(-2px);
  z-index: 2;
  border-color: rgba(255, 215, 0, 0.85);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7), inset 0 1px 1px #ffffff;
}

/* Interactive Tile Hover Reaction */
.logo-area:hover .emblem-tile-left {
  transform: rotate(-22deg) translate(-2px, -3px);
}

.logo-area:hover .emblem-tile-right {
  transform: rotate(22deg) translate(2px, -3px);
}

.logo-area:hover .emblem-tile-center {
  transform: translateY(-6px) scale(1.06);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.75), inset 0 1px 1.5px #ffffff;
}

/* Tile Corner Indices */
.et-corner {
  position: absolute;
  font-size: 5.5px;
  font-weight: 800;
  line-height: 1;
  color: rgba(0, 0, 0, 0.45);
}

.et-tl {
  top: 1.5px;
  left: 2px;
}

.et-br {
  bottom: 1.5px;
  right: 2px;
}

/* Main Tile Value */
.et-main {
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  margin-top: -1px;
}

.et-dot {
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  margin-top: 1.5px;
}

/* Okey Tile Color Inks */
.et-blue {
  color: #1e88e5;
  background-color: #1e88e5;
}

.et-yellow {
  color: #f59e0b;
  background-color: #f59e0b;
}

.et-red {
  color: #e53935;
  background-color: #e53935;
}

.et-star {
  font-size: 14px;
  color: #e53935;
  text-shadow: 0 0 4px rgba(229, 57, 53, 0.5);
  margin-top: 0;
}

/* Top Crown Accent */
.logo-crown-accent {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8));
  pointer-events: none;
  transition: transform 0.25s ease;
}

.logo-area:hover .logo-crown-accent {
  transform: translateX(-50%) translateY(-2px);
}

/* Typography Group */
.logo-text-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1;
}

.logo-title {
  font-family: 'Cinzel', 'Times New Roman', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 3.5px;
  background: linear-gradient(180deg, #ffffff 0%, #fff6c7 25%, #ffd700 55%, #caa035 85%, #926815 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
  line-height: 1;
}

.logo-tld {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.8em;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(180deg, #fff7c2 0%, #ffd700 50%, #d4af37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
  margin-left: 2px;
  text-transform: lowercase;
}

.logo-badge-edition {
  font-size: 0.56rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 215, 0, 0.14);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.45);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Ornamental Divider */
.logo-divider {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 3px 0 2px 0;
  width: 100%;
}

.div-line {
  flex: 1;
  height: 1px;
}

.div-line.left {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.6), transparent);
}

.div-line.right {
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.6));
}

.div-gem {
  font-size: 6px;
  color: #ffd700;
  line-height: 1;
  text-shadow: 0 0 3px rgba(255, 215, 0, 0.7);
}

.logo-subtitle {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: #d1b88e;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-header {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f1f2f6;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.btn-header:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(212, 175, 55, 0.4);
  color: #ffffff;
}

.btn-header:active {
  background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
  border-color: #f39c12;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(230, 126, 34, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
  box-shadow: 0 4px 14px rgba(243, 156, 18, 0.6);
  border-color: #ffd700;
}

/* ══════════ Score Strip ══════════ */
.score-strip-wrapper {
  width: 100%;
  flex-shrink: 0;
  position: relative;
  z-index: 15;
  display: flex;
  justify-content: center;
  padding: 6px 12px;
}

.score-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.match-round-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(243, 156, 18, 0.25));
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 18px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.15);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.match-round-pill.final-round {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.3), rgba(243, 156, 18, 0.4));
  border-color: #ff6b6b;
  color: #ff9f43;
  box-shadow: 0 0 14px rgba(255, 107, 107, 0.35);
  animation: pulseFinalRound 2s infinite ease-in-out;
}

@keyframes pulseFinalRound {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 107, 107, 0.2); }
  50% { box-shadow: 0 0 16px rgba(255, 107, 107, 0.6); }
}

.winner-round-badge {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.player-score-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
  transition: all var(--transition-normal);
  position: relative;
}

.player-score-card.active-turn {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}

.player-score-card.table-leader {
  border-color: rgba(255, 215, 0, 0.55);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.2);
}

.player-avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1e272e;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}

.player-rank-chip {
  position: absolute;
  top: -6px;
  left: -6px;
  font-size: 0.62rem;
  background: rgba(0, 0, 0, 0.85);
  color: var(--gold-primary);
  border-radius: 8px;
  padding: 1px 3px;
  line-height: 1;
  border: 1px solid rgba(255, 215, 0, 0.4);
  font-weight: 800;
}

.ring-emerald { border-color: var(--ring-player); }
.ring-orange  { border-color: var(--ring-can); }
.ring-purple  { border-color: var(--ring-deniz); }
.ring-teal    { border-color: var(--ring-eren); }

.player-info {
  display: flex;
  flex-direction: column;
}

.player-name-mini {
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 3px;
}

.crown-mini {
  font-size: 0.82rem;
  line-height: 1;
}

.player-score-detail {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.65);
}

.badge-points {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.74rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.badge-points.badge-leader {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #ffd700;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.45);
}

.badge-points .pts-label {
  font-size: 0.62rem;
  font-weight: 500;
  opacity: 0.88;
}

.badge-pts-earned {
  background: rgba(255, 255, 255, 0.25);
  padding: 1px 4px;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  color: #fff;
}

/* ══════════ Status Bar Ribbon ══════════ */
.status-bar-wrapper {
  width: 100%;
  flex-shrink: 0;
  position: relative;
  z-index: 15;
  display: flex;
  justify-content: center;
  padding: 2px 16px 8px 16px;
}

.status-bar {
  background: rgba(5, 18, 10, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 7px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  border: 1px solid rgba(255, 215, 0, 0.35);
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 92%;
  transition: all var(--transition-normal);
}

.status-bar .status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-bar .status-text {
  line-height: 1.3;
}

.status-bar span.highlight {
  color: var(--gold-primary);
  font-weight: 700;
}

.status-bar.status-success {
  background: rgba(14, 56, 24, 0.9);
  border-color: #2ecc71;
}

.status-bar.status-error {
  background: rgba(64, 18, 18, 0.9);
  border-color: #e74c3c;
}

/* ══════════ Main Game Table ══════════ */
.game-table {
  position: relative;
  z-index: 5;
  flex: 1;
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  padding: 4px 16px 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Center Field */
.center-field {
  position: relative;
  min-height: 420px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 12px 0;
  border-radius: 30px;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.03) 0%, transparent 75%);
}

/* ══════════ Bot Seats ══════════ */
.bot-seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 10;
  transition: transform var(--transition-normal);
}

.bot-top {
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
}

.bot-left {
  left: 24px;
  top: 40%;
  transform: translateY(-50%);
}

.bot-right {
  right: 24px;
  top: 40%;
  transform: translateY(-50%);
}

.bot-avatar-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  transition: all var(--transition-normal);
}

.bot-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(145deg, #2d3748, #1a202c);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.2), 0 3px 6px rgba(0,0,0,0.5);
}

.bot-seat.active-turn .bot-avatar-ring {
  border-color: var(--gold-primary);
}

.bot-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.bot-name {
  font-size: 0.86rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  letter-spacing: 0.5px;
}

.bot-tile-count {
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
}

.bot-seat.player-left {
  opacity: 0.55;
  filter: grayscale(0.7);
}

.seat-left-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(231, 76, 60, 0.25);
  color: #f1948a;
  border: 1px solid rgba(231, 76, 60, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 2px;
}

/* Bot Thinking Indicator */
.bot-thinking {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.7);
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid var(--gold-primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.bot-thinking .dot {
  width: 5px;
  height: 5px;
  background: var(--gold-primary);
  border-radius: 50%;
  animation: dot-bounce 1.2s infinite ease-in-out;
}

.bot-thinking .dot:nth-child(1) { animation-delay: 0s; }
.bot-thinking .dot:nth-child(2) { animation-delay: 0.2s; }
.bot-thinking .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* Bot Tile Fans */
.bot-hand-fan {
  position: relative;
  width: 70px;
  height: 24px;
  margin-bottom: -10px;
  z-index: 2;
  pointer-events: none;
}

.fan-tile {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 14px;
  height: 22px;
  background: linear-gradient(135deg, #c0392b, #8e1b10);
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 2px;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(var(--fan-angle)) translateY(-4px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ══════════ Discard Trays ══════════ */
.discard-tray {
  position: absolute;
  width: 54px;
  height: 74px;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.22);
  transition: all var(--transition-fast);
  z-index: 12;
}

/* Geometry aligned with authentic Turkish counter-clockwise play */
.discard-p0 { /* Player 0 discard tray (lower right) */
  bottom: 12px;
  right: calc(50% - 155px);
}

.discard-p1 { /* Bot 1 Can discard tray (upper right) */
  top: 24px;
  right: calc(50% - 145px);
}

.discard-p2 { /* Bot 2 Deniz discard tray (upper left) */
  top: 24px;
  left: calc(50% - 145px);
}

.discard-p3 { /* Bot 3 Eren discard tray (lower left - DRAW HERE!) */
  bottom: 12px;
  left: calc(50% - 155px);
}

.discard-label {
  position: absolute;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.discard-p0 .discard-label, .discard-p3 .discard-label {
  bottom: -20px;
}

.discard-p1 .discard-label, .discard-p2 .discard-label {
  top: -20px;
}

.discard-tray.can-draw {
  border: 2px solid #2ecc71;
  background: rgba(46, 204, 113, 0.12);
  cursor: pointer;
}
.discard-tray.can-draw * {
  cursor: pointer;
}

.discard-tray.drop-hover {
  background: rgba(46, 204, 113, 0.25);
  border: 2px solid #2ecc71;
}

/* ══════════ Center Board (Gösterge, Stapel, Bitir) ══════════ */
.center-board {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: linear-gradient(145deg, rgba(20, 10, 5, 0.82), rgba(35, 18, 8, 0.9));
  padding: 14px 22px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0,0,0,0.65), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  z-index: 10;
  margin-top: 24px;
}

.deck-container, .indicator-container, .discard-zone-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
}

/* Gösterge Info Badge */
.okey-info-badge {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.okey-badge-line {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.okey-badge-line .badge-label {
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.okey-badge-line.okey-highlight {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--gold-primary);
}

.okey-badge-line .badge-val {
  font-weight: 800;
}

.val-red    { color: #ff6b6b; }
.val-blue   { color: #54a0ff; }
.val-black  { color: #ced6e0; }
.val-yellow { color: #feca57; }

/* Deck Stack 3D Visual */
.deck-stack {
  position: relative;
  width: 50px;
  height: 72px;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.deck-back {
  position: absolute;
  width: 50px;
  height: 72px;
  background: linear-gradient(145deg, #c0392b 0%, #962d22 100%);
  border: 2px solid #e74c3c;
  border-radius: 6px;
  box-shadow: 1px 2px 5px rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
}

.deck-layer-3 { transform: translate(-3px, -3px); opacity: 0.7; }
.deck-layer-2 { transform: translate(-1.5px, -1.5px); opacity: 0.9; }
.deck-layer-1 { transform: translate(0, 0); opacity: 1; }

.deck-ornament {
  opacity: 0.75;
}

.deck-count-badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  background: #09090b;
  color: var(--gold-primary);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid var(--gold-primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  z-index: 5;
}

.deck-stack.can-draw .deck-top {
  border: 2px solid #2ecc71;
  cursor: pointer;
}

/* Finish Drop Zone */
.finish-drop-zone {
  width: 54px;
  height: 74px;
  border: 1.5px dashed #c5a059;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(197, 160, 89, 0.06);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.finish-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.finish-drop-zone:hover, .finish-drop-zone.drop-hover {
  background: rgba(197, 160, 89, 0.18);
  border-color: #ffd700;
}

/* ══════════ Okey Tile Graphic (Authentic Ivory Melamine) ══════════ */
.okey-tile {
  width: 50px;
  height: 72px;
  background: linear-gradient(165deg, var(--tile-bg-top) 0%, var(--tile-bg-mid) 40%, var(--tile-bg-bottom) 100%);
  border-radius: 7px;
  border: 1px solid var(--tile-border);
  box-shadow: 0 4px 7px var(--tile-shadow), inset 0 1px 1px #ffffff, inset 0 -2px 3px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  padding: 3px 5px;
  position: relative;
  cursor: grab;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.okey-tile:hover {
  border-color: #d1c4b2;
  box-shadow: 0 5px 12px rgba(0,0,0,0.5), inset 0 1px 1px #ffffff;
  z-index: 10;
}

.okey-tile.selected {
  outline: 2.5px solid #e67e22;
  outline-offset: 1px;
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
  z-index: 25;
}

.okey-tile.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.okey-tile.newly-drawn {
  border: 2px solid #2ecc71 !important;
  animation: newly-drawn-border 2s ease-out forwards;
  z-index: 15;
}

@keyframes newly-drawn-border {
  0% { border-color: #2ecc71; }
  75% { border-color: #2ecc71; }
  100% { border-color: var(--tile-border); }
}

.okey-tile.is-okey-real {
  border: 2px solid #c5a059;
}

.tile-badge-joker {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(135deg, #ffd700, #f39c12);
  color: #111;
  font-size: 0.58rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 6px;
  border: 1px solid #b8860b;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 6;
}

.tile-corner-top {
  display: flex;
  justify-content: flex-start;
  line-height: 1;
}

.tile-corner-bottom {
  display: flex;
  justify-content: flex-end;
  line-height: 1;
}

.tile-mini-number {
  font-size: 0.68rem;
  font-weight: 800;
  opacity: 0.85;
}

.tile-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: -2px;
}

.tile-number {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255,255,255,0.9), 0 -1px 0 rgba(0,0,0,0.15);
  letter-spacing: -0.5px;
}

.tile-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 3px;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.3);
}

/* Color definitions for tiles */
.tile-red .tile-number, .tile-red .tile-mini-number { color: var(--tile-red); }
.tile-red .tile-dot { background-color: var(--tile-red); }

.tile-blue .tile-number, .tile-blue .tile-mini-number { color: var(--tile-blue); }
.tile-blue .tile-dot { background-color: var(--tile-blue); }

.tile-black .tile-number, .tile-black .tile-mini-number { color: var(--tile-black); }
.tile-black .tile-dot { background-color: var(--tile-black); }

.tile-yellow .tile-number, .tile-yellow .tile-mini-number { color: var(--tile-yellow); }
.tile-yellow .tile-dot { background-color: var(--tile-yellow); }

/* Joker Tile with Star Symbol */
.tile-joker {
  background: linear-gradient(165deg, #ffffff 0%, #fffdf8 35%, #fef4df 100%) !important;
  border: 1.5px solid #c5a059 !important;
  box-shadow: 0 4px 7px var(--tile-shadow), inset 0 1px 1px #ffffff !important;
}

.tile-center-joker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: -2px;
}

.tile-star-symbol {
  font-size: 2.1rem;
  line-height: 1;
  color: #c5a059;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

.tile-mini-star {
  font-size: 0.82rem;
  color: #f39c12;
  font-weight: 900;
  line-height: 1;
}

.tile-joker-label {
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #b8860b;
  margin-top: 1px;
}

.val-star {
  color: #ffd700;
  font-weight: 800;
}

/* ══════════ Player Rack (Istaka) ══════════ */
.rack-container {
  background: linear-gradient(180deg, #603813 0%, #46250b 45%, #351a06 85%, #251003 100%);
  border: 4px solid #230f04;
  border-radius: 16px;
  padding: 10px 16px 12px 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), inset 0 2px 4px var(--wood-bevel-top), inset 0 -4px 6px var(--wood-bevel-bottom);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 auto;
  max-width: 980px;
  width: 100%;
}

.rack-label-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.15);
}

.rack-label-text {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--gold-primary);
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.rack-rows-wrapper {
  background: rgba(15, 7, 3, 0.7);
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.rack-row-divider {
  height: 4px;
  background: linear-gradient(180deg, #442008, #220e03);
  border-radius: 2px;
  box-shadow: 0 1px 1px rgba(255,255,255,0.1);
}

.rack-slot {
  aspect-ratio: 50 / 72;
  min-height: 68px;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(255, 215, 0, 0.12);
  position: relative;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.rack-slot.slot-hover {
  background: rgba(197, 160, 89, 0.15);
  border-color: #c5a059;
}

/* Rack Action Controls */
.rack-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

.action-group {
  display: flex;
  gap: 10px;
}

.btn-action {
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

.btn-sort {
  background: linear-gradient(135deg, #2b5876, #4e4376);
  border: 1px solid #637bfe;
}

.btn-sort:hover {
  background: linear-gradient(135deg, #3a6b8c, #5e528c);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-finish {
  background: linear-gradient(135deg, #c0392b, #962d22);
  border: 1px solid #e74c3c;
}

.btn-finish:hover {
  background: linear-gradient(135deg, #d63031, #b71540);
  border-color: #ff7675;
}

.btn-action:active {
  opacity: 0.9;
}

/* ══════════ Modal Dialogs ══════════ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: #0d1e15;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 24px;
  max-width: 580px;
  width: 92%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  max-height: 86vh;
  overflow-y: auto;
  color: #f3f4f6;
  transform: scale(0.96) translateY(6px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.modal-overlay.open .modal-card {
  transform: scale(1) translateY(0);
}

.modal-card-dialog {
  max-width: 440px;
  background: #0d1e15;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.dialog-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dialog-message {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #cbd5e1;
  margin: 4px 0 8px 0;
}

.dialog-message b {
  color: #ffffff;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 12px;
}

.modal-title {
  font-size: 1.25rem;
  color: #ffd700;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: rotate(90deg);
}

.modal-body {
  font-size: 0.92rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rule-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 16px;
}

.rule-card h4 {
  color: #f39c12;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rule-card ul, .rule-card ol {
  padding-left: 20px;
  margin-bottom: 4px;
}

.rule-card li {
  margin-bottom: 4px;
}

.modal-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Winner Banner in Modal */
.winner-banner {
  text-align: center;
  padding: 20px 16px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(243, 156, 18, 0.1));
  border-radius: 14px;
  border: 1px solid var(--gold-primary);
  margin-bottom: 18px;
}

.winner-banner.winner-you {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.18), rgba(197, 160, 89, 0.15));
  border-color: #2ecc71;
}

.winner-trophy {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.winner-text {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--gold-primary);
  letter-spacing: 1px;
}

.winner-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f39c12;
  margin-top: 4px;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  overflow: hidden;
}

.score-table th, .score-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.score-table th {
  background: rgba(0, 0, 0, 0.4);
  color: var(--gold-primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.winner-row {
  background: rgba(255, 215, 0, 0.14);
  font-weight: 700;
}

.winner-row-trophy {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 6px;
}

/* Score Breakdown Card */
.score-breakdown-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 12px 0 16px 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

.score-breakdown-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.score-breakdown-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-breakdown-total {
  font-size: 1.15rem;
  font-weight: 900;
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid rgba(46, 204, 113, 0.35);
  padding: 2px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.score-breakdown-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.9);
}

.score-breakdown-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-breakdown-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.score-breakdown-label {
  font-weight: 500;
}

.score-breakdown-val {
  font-weight: 800;
  color: var(--gold-secondary);
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Match Champion Banner */
.match-champion-banner {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(243, 156, 18, 0.2));
  border: 2px solid var(--gold-primary);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  margin-bottom: 14px;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.match-champion-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--gold-primary);
  letter-spacing: 1px;
}

.match-champion-desc {
  font-size: 0.88rem;
  color: #fff;
  margin-top: 4px;
  font-weight: 500;
}

/* Leaderboard Section & Table */
.leaderboard-section {
  margin-top: 14px;
}

.leaderboard-section h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rank-cell {
  font-size: 1.1rem;
  text-align: center;
  font-weight: 700;
}

.round-pts-cell {
  text-align: center;
  font-size: 0.85rem;
}

.pts-plus {
  color: #2ecc71;
  font-weight: 800;
}

.pts-neutral {
  color: rgba(255, 255, 255, 0.4);
}

.total-pts-cell {
  text-align: right;
  font-size: 0.95rem;
}

.leader-row {
  background: rgba(255, 215, 0, 0.1);
}

.winner-trophy-inline {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  font-size: 0.95rem;
}

/* ══════════ Responsive Breakpoints ══════════ */
@media (max-width: 900px) {
  .okey-tile {
    width: 44px;
    height: 64px;
  }
  .tile-number {
    font-size: 1.55rem;
  }
  .rack-row {
    gap: 3px;
  }
  .rack-slot {
    min-height: 60px;
  }
  .center-board {
    padding: 10px 16px;
    gap: 14px;
  }
}

/* ══════════ Touch Drag Ghost & Mobile Rotation Banner ══════════ */
.touch-drag-ghost {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  z-index: 99999 !important;
  pointer-events: none !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75), 0 0 18px rgba(255, 215, 0, 0.45) !important;
  will-change: transform;
  opacity: 0.96;
  margin: 0 !important;
  border-color: #ffd700 !important;
}

.mobile-orientation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(90deg, rgba(20, 45, 30, 0.95), rgba(10, 26, 18, 0.95));
  border-bottom: 1.5px solid rgba(255, 215, 0, 0.35);
  padding: 6px 14px;
  color: #ffd700;
  font-size: 0.76rem;
  font-weight: 600;
  z-index: 30;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  animation: slideDownBanner 0.3s ease-out;
}

@keyframes slideDownBanner {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.mob-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.mob-text {
  flex: 1;
  line-height: 1.25;
}

.mob-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.25rem;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.mob-close:hover {
  color: #ffffff;
}

/* ══════════ Mobile More Menu (Dropdown) ══════════ */
.mobile-more-menu-wrap {
  display: none;
  position: relative;
}

.mobile-more-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: rgba(10, 24, 16, 0.98);
  border: 1.5px solid rgba(255, 215, 0, 0.45);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 9999;
  min-width: 145px;
  animation: menuFadeIn 0.15s ease-out;
}

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

.mobile-more-dropdown.open {
  display: flex;
}

.mm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  color: #f1f2f6;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.mm-item:hover, .mm-item:active {
  background: rgba(255, 215, 0, 0.18);
  border-color: #ffd700;
  color: #ffd700;
}

.mm-icon {
  font-size: 1rem;
}

/* ══════════ Mobile Landscape Mode (Phone turned sideways) ══════════ */
@media (orientation: landscape) and (max-height: 540px) {
  body:has(#gameScreen:not([style*="display: none"])) {
    overflow: hidden !important;
  }
  #gameScreen {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }
  .top-header {
    padding: 2px 10px !important;
    min-height: 34px !important;
    height: 34px !important;
  }
  .logo-emblem {
    transform: scale(0.62) !important;
    margin-right: -10px !important;
  }
  .logo-title {
    font-size: 0.95rem !important;
  }
  .logo-subtitle,
  .logo-divider {
    display: none !important;
  }
  .btn-header {
    padding: 3px 6px !important;
    font-size: 0.68rem !important;
    height: 28px !important;
  }
  .score-strip-wrapper {
    display: none !important; /* Scores are already visible at seats */
  }
  .status-bar-wrapper {
    padding: 0 8px !important;
    margin: 1px 0 !important;
  }
  .status-bar {
    padding: 1px 8px !important;
    font-size: 0.68rem !important;
    min-height: 20px !important;
  }
  .game-table {
    flex: 1 !important;
    min-height: 0 !important;
    padding: 1px 8px 3px 8px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }
  .center-field {
    flex: 1 !important;
    min-height: 0 !important;
    margin: 1px 0 !important;
    position: relative !important;
    border-radius: 12px !important;
  }
  .bot-top {
    top: 2px !important;
  }
  .bot-top .bot-avatar-ring { width: 28px !important; height: 28px !important; padding: 2px !important; }
  .bot-top .bot-avatar { font-size: 0.8rem !important; }
  .bot-top .bot-name { font-size: 0.62rem !important; }
  .bot-top .bot-tile-count { font-size: 0.55rem !important; padding: 1px 4px !important; }
  .bot-top .bot-hand-fan { display: none !important; }

  .discard-p2 {
    top: 2px !important;
    left: calc(50% - 85px) !important;
    width: 30px !important;
    height: 42px !important;
  }
  .discard-p1 {
    top: 2px !important;
    right: calc(50% - 85px) !important;
    width: 30px !important;
    height: 42px !important;
  }
  .discard-p1 .discard-label, .discard-p2 .discard-label {
    display: none !important;
  }

  .bot-left {
    left: 8px !important;
    top: 45% !important;
    transform: translateY(-50%) !important;
  }
  .bot-left .bot-avatar-ring { width: 28px !important; height: 28px !important; }
  .bot-left .bot-name { font-size: 0.62rem !important; }
  .bot-left .bot-tile-count { font-size: 0.55rem !important; }
  .bot-left .bot-hand-fan { display: none !important; }

  .discard-p3 {
    left: 8px !important;
    bottom: 2px !important;
    width: 32px !important;
    height: 44px !important;
  }
  .discard-p3 .discard-label {
    bottom: -14px !important;
    font-size: 0.55rem !important;
  }

  .bot-right {
    right: 8px !important;
    top: 45% !important;
    transform: translateY(-50%) !important;
  }
  .bot-right .bot-avatar-ring { width: 28px !important; height: 28px !important; }
  .bot-right .bot-name { font-size: 0.62rem !important; }
  .bot-right .bot-tile-count { font-size: 0.55rem !important; }
  .bot-right .bot-hand-fan { display: none !important; }

  .discard-p0 {
    right: 8px !important;
    bottom: 2px !important;
    width: 32px !important;
    height: 44px !important;
  }
  .discard-p0 .discard-label {
    bottom: -14px !important;
    font-size: 0.55rem !important;
  }

  .center-board {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -46%) !important;
    padding: 2px 6px !important;
    gap: 6px !important;
    border-radius: 10px !important;
  }
  .deck-stack, .deck-back {
    width: 30px !important;
    height: 42px !important;
  }
  .finish-drop-zone {
    width: 30px !important;
    height: 42px !important;
  }
  .section-label {
    font-size: 0.52rem !important;
    margin-bottom: 1px !important;
  }

  .rack-container {
    padding: 3px 6px 4px 6px !important;
    border-radius: 8px !important;
    border-width: 2px !important;
    gap: 2px !important;
    max-width: 98% !important;
  }
  .rack-label-bar {
    display: none !important;
  }
  .rack-rows-wrapper {
    padding: 2px !important;
    gap: 2px !important;
  }
  .rack-row {
    display: grid !important;
    grid-template-columns: repeat(14, 1fr) !important;
    gap: 2px !important;
    min-width: 0 !important;
  }
  .rack-slot {
    min-height: unset !important;
    aspect-ratio: 28 / 40 !important;
    border-radius: 3px !important;
  }
  .okey-tile {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    border-radius: 3px !important;
  }
  .tile-number {
    font-size: 1.15rem !important;
    font-weight: 900 !important;
  }
  .tile-star-symbol {
    font-size: 1.25rem !important;
  }
  .tile-dot {
    width: 3.5px !important;
    height: 3.5px !important;
  }
  .tile-corner-top,
  .tile-corner-bottom {
    display: none !important;
  }
  .rack-actions {
    gap: 4px !important;
    padding-top: 1px !important;
  }
  .btn-action {
    padding: 0 6px !important;
    height: 26px !important;
    font-size: 0.68rem !important;
  }
}

/* ══════════ Comprehensive Mobile Screen Overhaul (max 768px) ══════════ */
@media (max-width: 768px) {
  /* Prevent full-page vertical scrolling in game */
  body:has(#gameScreen:not([style*="display: none"])) {
    overflow: hidden !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
  }

  #gameScreen {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* ── Header: Ultra-Compact Single Row ── */
  .top-header {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 0 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
  }
  .top-header .logo-area {
    gap: 4px !important;
  }
  .top-header .logo-emblem {
    transform: scale(0.68) !important;
    margin-right: -8px !important;
  }
  .top-header .logo-title {
    font-size: 1.05rem !important;
    letter-spacing: 1px !important;
  }
  .top-header .logo-subtitle,
  .top-header .logo-divider {
    display: none !important;
  }

  /* Header controls: only keep Language, Lobby, New Game, and More Menu */
  .header-controls {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
  }
  .btn-lang-toggle {
    padding: 3px 6px !important;
    font-size: 0.72rem !important;
    height: 30px !important;
  }
  #btnBackToLobby {
    padding: 3px 8px !important;
    font-size: 0.72rem !important;
    height: 30px !important;
  }
  #btnNewGame {
    padding: 3px 10px !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    height: 30px !important;
  }
  #btnSound,
  #btnRules,
  #btnLegal,
  #btnMultiplayer {
    display: none !important; /* Moved to mobile more dropdown */
  }
  .mobile-more-menu-wrap {
    display: block !important;
  }
  #btnMobileMore {
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
  }

  /* ── Status Bar & Score Strip ── */
  .score-strip-wrapper {
    display: none !important; /* Save 32px of space; seat avatars show scores */
  }
  .status-bar-wrapper {
    padding: 0 6px !important;
    margin: 1px 0 2px 0 !important;
  }
  .status-bar {
    padding: 2px 8px !important;
    font-size: 0.7rem !important;
    min-height: 22px !important;
    border-radius: 6px !important;
  }
  .status-icon {
    display: none !important;
  }

  /* ── Game Table & Center Field ── */
  .game-table {
    flex: 1 !important;
    min-height: 0 !important;
    padding: 0 4px 3px 4px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    position: relative !important;
  }

  .center-field {
    flex: 1 !important;
    min-height: 0 !important;
    position: relative !important;
    margin: 1px 0 !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.03) 0%, transparent 70%) !important;
  }

  /* ── Zero-Overlap Table Geometry ── */
  /* Top Player */
  .bot-top {
    top: 2px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
  .bot-top .bot-avatar-ring { width: 32px !important; height: 32px !important; padding: 2px !important; }
  .bot-top .bot-avatar { font-size: 0.85rem !important; }
  .bot-top .bot-name { font-size: 0.65rem !important; }
  .bot-top .bot-tile-count { font-size: 0.58rem !important; padding: 1px 4px !important; }
  .bot-top .bot-hand-fan { display: none !important; }

  /* Top Discard Trays Flanking Top Player */
  .discard-p2 {
    top: 2px !important;
    left: calc(50% - 76px) !important;
    width: 32px !important;
    height: 46px !important;
  }
  .discard-p1 {
    top: 2px !important;
    right: calc(50% - 76px) !important;
    width: 32px !important;
    height: 46px !important;
  }
  .discard-p1 .discard-label, .discard-p2 .discard-label {
    display: none !important;
  }

  /* Left Player */
  .bot-left {
    left: 2px !important;
    top: 42% !important;
    transform: translateY(-50%) !important;
  }
  .bot-left .bot-avatar-ring { width: 32px !important; height: 32px !important; padding: 2px !important; }
  .bot-left .bot-avatar { font-size: 0.85rem !important; }
  .bot-left .bot-name { font-size: 0.65rem !important; }
  .bot-left .bot-tile-count { font-size: 0.58rem !important; padding: 1px 4px !important; }
  .bot-left .bot-hand-fan { display: none !important; }

  /* Discard P3 (Left discard - Player DRAWS here) */
  .discard-p3 {
    left: 4px !important;
    bottom: 4px !important;
    width: 36px !important;
    height: 50px !important;
  }
  .discard-p3 .discard-label {
    bottom: -16px !important;
    font-size: 0.58rem !important;
    white-space: nowrap !important;
  }

  /* Right Player */
  .bot-right {
    right: 2px !important;
    top: 42% !important;
    transform: translateY(-50%) !important;
  }
  .bot-right .bot-avatar-ring { width: 32px !important; height: 32px !important; padding: 2px !important; }
  .bot-right .bot-avatar { font-size: 0.85rem !important; }
  .bot-right .bot-name { font-size: 0.65rem !important; }
  .bot-right .bot-tile-count { font-size: 0.58rem !important; padding: 1px 4px !important; }
  .bot-right .bot-hand-fan { display: none !important; }

  /* Discard P0 (Right discard - Player DISCARDS here) */
  .discard-p0 {
    right: 4px !important;
    bottom: 4px !important;
    width: 36px !important;
    height: 50px !important;
  }
  .discard-p0 .discard-label {
    bottom: -16px !important;
    font-size: 0.58rem !important;
  }

  /* Center Board: Deck, Indicator, Finish */
  .center-board {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -46%) !important;
    padding: 3px 6px !important;
    gap: 6px !important;
    border-radius: 12px !important;
  }
  .deck-stack, .deck-back {
    width: 34px !important;
    height: 48px !important;
  }
  .finish-drop-zone {
    width: 34px !important;
    height: 48px !important;
  }
  .indicator-container #indicatorSlot {
    width: 34px !important;
    height: 48px !important;
  }
  .section-label {
    font-size: 0.54rem !important;
    margin-bottom: 1px !important;
  }

  /* ── Player Rack (Istaka) — 100% Fit & No Overflow ── */
  .rack-container {
    padding: 4px 4px 6px 4px !important;
    border-width: 2px !important;
    border-radius: 10px !important;
    gap: 3px !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }
  .rack-label-bar {
    display: none !important;
  }
  .rack-rows-wrapper {
    padding: 3px 2px !important;
    gap: 3px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    width: 100% !important;
  }
  .rack-row {
    display: grid !important;
    grid-template-columns: repeat(14, 1fr) !important;
    gap: 2px !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .rack-slot {
    min-height: unset !important;
    aspect-ratio: 24 / 35 !important;
    border-radius: 4px !important;
    border-width: 1px !important;
  }
  .okey-tile {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    border-radius: 4px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5) !important;
  }
  .tile-number {
    font-size: clamp(0.92rem, 3.7vw, 1.25rem) !important;
    font-weight: 900 !important;
    line-height: 1 !important;
  }
  .tile-dot {
    width: 3.5px !important;
    height: 3.5px !important;
    margin-top: 1px !important;
  }
  .tile-star-symbol {
    font-size: clamp(1rem, 4vw, 1.35rem) !important;
    line-height: 1 !important;
  }
  .tile-corner-top,
  .tile-corner-bottom {
    display: none !important;
  }

  /* Rack Action Controls */
  .rack-actions {
    display: flex !important;
    gap: 4px !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-top: 2px !important;
  }
  .action-group {
    display: flex !important;
    gap: 4px !important;
    flex: 2 !important;
  }
  .action-group .btn-action {
    flex: 1 !important;
    height: 32px !important;
    padding: 0 4px !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
  }
  #btnCheckHand {
    flex: 1.2 !important;
    height: 32px !important;
    padding: 0 6px !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
  }
  .btn-emote {
    height: 32px !important;
    width: 34px !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    justify-content: center !important;
    border-radius: 6px !important;
  }

  /* ══════════ Landing Screen / Lobby Mobile Redesign ══════════ */
  .landing-header {
    padding: 8px 12px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .landing-header .logo-area {
    gap: 6px !important;
  }
  .landing-header .logo-title {
    font-size: 1.1rem !important;
  }
  .landing-header .logo-subtitle,
  .landing-header .logo-divider {
    display: none !important;
  }
  .landing-user-profile {
    padding: 4px 10px !important;
    flex: 1 !important;
    min-width: 140px !important;
  }
  .landing-user-profile input {
    width: 100% !important;
    font-size: 0.84rem !important;
  }
  .landing-main {
    padding: 12px 10px 32px 10px !important;
    gap: 12px !important;
  }
  .lobby-action-bar {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .action-bar-left {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .action-bar-left .btn-action-primary,
  .action-bar-left .btn-action-secondary {
    width: 100% !important;
    height: 42px !important;
    font-size: 0.78rem !important;
    padding: 0 8px !important;
    justify-content: center !important;
  }
  .quick-mode-selector {
    grid-column: span 2 !important;
    width: 100% !important;
    justify-content: center !important;
    padding: 4px 8px !important;
  }
  .action-bar-right {
    width: 100% !important;
  }
  .join-code-group {
    width: 100% !important;
  }
  .input-code-compact {
    flex: 1 !important;
    height: 40px !important;
    font-size: 0.84rem !important;
  }
  .btn-code-join {
    height: 40px !important;
    padding: 0 16px !important;
  }

  /* Transform table into mobile cards */
  .browser-table {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  .browser-table-head {
    display: none !important;
  }
  .browser-table-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  .browser-table-row {
    display: flex !important;
    flex-direction: column !important;
    background: rgba(16, 36, 24, 0.94) !important;
    border: 1px solid rgba(255, 215, 0, 0.25) !important;
    border-radius: 12px !important;
    padding: 10px 12px !important;
    gap: 6px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
  }
  .browser-table-row .td-cell {
    padding: 0 !important;
  }
  .browser-table-row .td-name {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    padding-bottom: 6px !important;
  }
  .browser-table-row .table-room-title {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: #ffd700 !important;
  }
  .browser-table-row .table-room-code {
    background: rgba(255, 215, 0, 0.15) !important;
    color: #ffd700 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 0.72rem !important;
  }
  .browser-table-row .btn-table-join {
    width: 100% !important;
    height: 38px !important;
    margin-top: 4px !important;
    border-radius: 8px !important;
    justify-content: center !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
  }
  .modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    padding: 12px !important;
  }
}

/* ══════════ Extra Narrow Phones (max 380px) ══════════ */
@media (max-width: 380px) {
  .top-header .logo-title {
    font-size: 0.95rem !important;
  }
  .btn-lang-toggle span:not(.lang-flag) {
    display: none !important;
  }
  .rack-row {
    gap: 1.5px !important;
  }
  .tile-number {
    font-size: clamp(0.85rem, 3.5vw, 1.15rem) !important;
  }
}

/* ══════════ Multiplayer UI Styles ══════════ */
.btn-accent {
  background: linear-gradient(135deg, #0984e3, #1e3799);
  border-color: #74b9ff;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(9, 132, 227, 0.35);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #74b9ff, #0984e3);
  border-color: #ffffff;
  box-shadow: 0 4px 14px rgba(9, 132, 227, 0.55);
}

.btn-subtle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border: 1px solid #f1948a;
  color: #ffffff;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f1948a, #e74c3c);
  box-shadow: 0 3px 8px rgba(231, 76, 60, 0.4);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.76rem;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* Active Multiplayer Banner */
.mp-active-banner {
  background: rgba(8, 28, 48, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(116, 185, 255, 0.35);
  padding: 6px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  z-index: 18;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.mp-banner-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #74b9ff;
  font-weight: 600;
}

.mp-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ecc71;
}

.mp-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Multiplayer Modal Layout */
.modal-card-mp {
  max-width: 620px;
}

.mp-name-field {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mp-name-field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-primary);
}

.mp-input {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 9px 14px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  transition: border-color var(--transition-fast);
}

.mp-input:focus {
  border-color: #c5a059;
}

.mp-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.mp-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.mp-card h4 {
  color: var(--gold-primary);
  font-size: 1.05rem;
  font-weight: 700;
}

.mp-card p {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.4;
  flex: 1;
}

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

.mp-code-input {
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  font-size: 1.1rem;
}

/* Multiplayer Lobby View */
.mp-lobby-header {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 215, 0, 0.25);
}

.mp-code-banner {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mp-code-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
  letter-spacing: 0.8px;
}

.mp-code-val {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--gold-primary);
  letter-spacing: 2px;
}

.mp-code-actions {
  display: flex;
  gap: 8px;
}

.mp-slots-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
}

.mp-slots-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.lobby-slot-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  transition: all var(--transition-fast);
}

.lobby-slot-card.occupied {
  background: rgba(255, 215, 0, 0.08);
  border-color: rgba(255, 215, 0, 0.35);
}

.lobby-slot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.lobby-slot-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.lobby-slot-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
}

.lobby-slot-desc {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
}

.slot-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
}

.slot-badge.ready {
  background: rgba(46, 204, 113, 0.25);
  color: #2ecc71;
  border: 1px solid #2ecc71;
}

.slot-badge.waiting {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.mp-bot-option {
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mp-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.mp-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold-primary);
  cursor: pointer;
}

.mp-lobby-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 600px) {
  .mp-options-grid, .mp-slots-container {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════
   CLEAN & PROFESSIONAL LOBBY & SERVER BROWSER
   ═══════════════════════════════════════════════════════════ */
.screen-view {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#landingScreen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #0b1e13;
  background-image: radial-gradient(circle at 50% 15%, #133321 0%, #0b1e13 70%);
}

#gameScreen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 28px;
  background: #08160e;
  border-bottom: 1px solid #1c3b28;
  z-index: 20;
}

.landing-user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #102418;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid #1f422d;
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #c5a059;
  color: #08160e;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name-input-wrap {
  display: flex;
  flex-direction: column;
}

.user-name-input-wrap label {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #799784;
  font-weight: 600;
}

.user-name-input-wrap input {
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  outline: none;
  width: 140px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.user-name-input-wrap input:focus {
  border-bottom: 1px solid #c5a059;
}

.user-name-input-wrap input.input-invalid,
.mp-input.input-invalid {
  border-bottom: 1.5px solid #ff4d4f !important;
  color: #ff8585 !important;
}

.name-filter-hint {
  font-size: 0.72rem;
  color: #ff6b6b;
  margin-top: 3px;
  font-weight: 500;
  line-height: 1.25;
  max-width: 220px;
  animation: fadeIn 0.2s ease-in;
}

.landing-main {
  flex: 1;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 48px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Compact Lobby Action Bar */
.lobby-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: #0e2417;
  border: 1px solid #1b3d27;
  border-radius: 8px;
  padding: 12px 16px;
}

.action-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.action-bar-right {
  display: flex;
  align-items: center;
}

.btn-action-primary {
  background: #c5a059;
  color: #08160e;
  border: none;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s;
}

.btn-action-primary:hover {
  background: #d4b16c;
}

.btn-action-secondary {
  background: #142a1d;
  color: #e2e8f0;
  border: 1px solid #224730;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s, border-color 0.15s;
}

.btn-action-secondary:hover {
  background: #1b3827;
  border-color: #2d5e40;
}

/* Quick Mode Selector Pill */
.quick-mode-selector {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 3px 5px;
}

.qms-label {
  font-size: 0.72rem;
  color: #9ca3af;
  font-weight: 700;
  padding: 0 4px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qms-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qms-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.qms-btn.active {
  background: linear-gradient(135deg, #ffd700, #caa035);
  color: #0b1810;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Classic Mode True Okey & Fake Joker visual cues */
.okey-tile.is-true-okey {
  border: 2px solid #ffd700 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6), 0 4px 8px rgba(0, 0, 0, 0.5) !important;
}

.okey-tile.is-true-okey::after {
  content: "OKEY";
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 6.5px;
  font-weight: 900;
  color: #b8860b;
  letter-spacing: 0.4px;
}

.okey-tile.is-fake-joker {
  position: relative;
}

.fake-joker-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 6.5px;
  font-weight: 800;
  padding: 0 2px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffd700;
}

/* Disconnected player seat visual */
.bot-seat.player-disconnected {
  opacity: 0.65;
  filter: grayscale(0.5);
  animation: pulse-disconnect 2s infinite ease-in-out;
}

@keyframes pulse-disconnect {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 0.35; }
}

.seat-disconnect-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(243, 156, 18, 0.25);
  color: #f39c12;
  border: 1px solid rgba(243, 156, 18, 0.5);
  text-transform: uppercase;
  margin-top: 2px;
}

.join-code-group {
  display: flex;
}

.input-code-compact {
  background: #08160e;
  border: 1px solid #1c3d28;
  border-right: none;
  color: #ffffff;
  padding: 7px 12px;
  border-radius: 6px 0 0 6px;
  font-size: 0.85rem;
  width: 175px;
  outline: none;
  text-transform: uppercase;
}

.input-code-compact:focus {
  border-color: #2e5d3f;
}

.btn-code-join {
  background: #1b3d27;
  border: 1px solid #285839;
  color: #f1f5f9;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 7px 14px;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-code-join:hover {
  background: #244f33;
}

/* Server Browser Section */
.server-browser-section {
  background: #0d2216;
  border: 1px solid #1c3b28;
  border-radius: 8px;
  overflow: hidden;
}

.browser-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: #08160f;
  border-bottom: 1px solid #1a3825;
}

.browser-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.browser-heading h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
}

.browser-count-pill {
  background: #142a1d;
  color: #8fa394;
  border: 1px solid #20412d;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
}

.browser-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.browser-search-input {
  background: #0e2216;
  border: 1px solid #1c3b28;
  color: #ffffff;
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 5px;
  width: 170px;
  outline: none;
}

.browser-search-input:focus {
  border-color: #2d5e40;
}

.btn-icon-refresh {
  background: #142a1d;
  border: 1px solid #20412d;
  color: #8fa394;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-icon-refresh:hover {
  background: #1c3927;
  color: #f1f5f9;
}

/* Browser Table */
.browser-table {
  width: 100%;
}

.browser-table-head {
  display: grid;
  grid-template-columns: 2.2fr 1.1fr 1.3fr 0.9fr 0.8fr 1fr;
  padding: 10px 18px;
  background: #091710;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #6b8675;
  border-bottom: 1px solid #163121;
}

.browser-table-body {
  display: flex;
  flex-direction: column;
}

.browser-table-row {
  display: grid;
  grid-template-columns: 2.2fr 1.1fr 1.3fr 0.9fr 0.8fr 1fr;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid #142b1d;
  font-size: 0.86rem;
  color: #e2e8f0;
  transition: background 0.12s;
}

.browser-table-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.badge-mode {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-mode-modern {
  background: rgba(255, 215, 0, 0.12);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.35);
}

.badge-mode-classic {
  background: rgba(230, 126, 34, 0.15);
  color: #e67e22;
  border: 1px solid rgba(230, 126, 34, 0.35);
}

.td-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-room-title {
  font-weight: 600;
  color: #f8fafc;
}

.table-room-code {
  font-family: monospace;
  font-size: 0.72rem;
  background: #091710;
  border: 1px solid #1b3a27;
  color: #c5a059;
  padding: 1px 6px;
  border-radius: 4px;
}

.td-host {
  color: #8fa394;
  font-size: 0.84rem;
}

.td-players {
  font-weight: 600;
}

.badge-players {
  font-size: 0.82rem;
  color: #4ade80;
}

.badge-players.full {
  color: #f87171;
}

.td-bots {
  color: #8fa394;
  font-size: 0.82rem;
}

.btn-table-join {
  background: #173423;
  border: 1px solid #234d34;
  color: #f1f5f9;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  justify-self: end;
}

.btn-table-join:hover {
  background: #204730;
  border-color: #316c49;
}

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

.browser-empty-state {
  padding: 40px 20px;
  text-align: center;
  color: #799784;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn-compact {
  padding: 7px 16px;
  font-size: 0.85rem;
}

/* Modals */
.modal-card-create, .modal-card-mp {
  background: #0e2317;
  border: 1px solid #1f422d;
  border-radius: 10px;
  max-width: 480px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
}

.visibility-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.vis-option-card {
  background: #091710;
  border: 1px solid #1a3926;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  transition: border-color 0.15s, background 0.15s;
}

.vis-option-card:hover {
  border-color: #2c593d;
}

.vis-option-card.selected {
  border-color: #c5a059;
  background: #14281c;
}

.vis-option-card input[type="radio"] {
  display: none;
}

.vis-option-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vis-option-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.86rem;
  color: #f8fafc;
}

.vis-option-desc {
  font-size: 0.72rem;
  color: #799784;
  line-height: 1.3;
}

.modal-footer-spaced {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.btn-sm {
  font-size: 0.82rem;
  padding: 6px 12px;
}

/* Warteraum / Lobby Modal */
.mp-lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #08160e;
  border: 1px solid #1a3a27;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.mp-code-banner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mp-code-label {
  font-size: 0.76rem;
  color: #799784;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mp-code-val {
  font-family: monospace;
  font-size: 1.15rem;
  font-weight: 800;
  color: #c5a059;
  letter-spacing: 1px;
}

.mp-code-actions {
  display: flex;
  gap: 6px;
}

.mp-slots-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #799784;
  margin-bottom: 8px;
}

.mp-slots-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.lobby-seat-item {
  display: flex;
  align-items: center;
  background: #091710;
  border: 1px solid #183523;
  border-radius: 6px;
  padding: 8px 12px;
}

.seat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #142a1d;
  color: #c5a059;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.seat-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-left: 10px;
}

.seat-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: #f8fafc;
}

.seat-pos {
  font-size: 0.7rem;
  color: #64748b;
}

.seat-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.seat-badge.ready {
  background: #12301e;
  color: #4ade80;
  border: 1px solid #1c4d30;
}

.seat-badge.host {
  background: #292414;
  color: #fbbf24;
  border: 1px solid #4a3e1e;
}

.seat-badge.bot {
  background: #0f1c14;
  color: #64748b;
  border: 1px solid #16281d;
}

@media (max-width: 720px) {
  .browser-table-head {
    display: none;
  }
  .browser-table-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .lobby-action-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .action-bar-left {
    justify-content: space-between;
  }
  .input-code-compact {
    width: 100%;
  }
}

/* ══════════ Language Switcher ══════════ */
.lang-selector-wrap {
  position: relative;
  display: inline-block;
  user-select: none;
}

.btn-lang-toggle {
  background: rgba(18, 45, 29, 0.7);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: #f1f5f9;
  padding: 6px 11px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.btn-lang-toggle:hover {
  background: rgba(26, 64, 41, 0.9);
  border-color: rgba(255, 215, 0, 0.6);
  color: #ffffff;
}

.btn-lang-toggle .lang-flag {
  font-size: 1rem;
  line-height: 1;
}

.btn-lang-toggle .lang-code {
  font-family: inherit;
  letter-spacing: 0.5px;
}

.btn-lang-toggle .lang-arrow {
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease;
}

.lang-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: #0b1d12;
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  flex-direction: column;
  padding: 5px;
  z-index: 1050;
  backdrop-filter: blur(12px);
  animation: fadeInDown 0.15s ease;
}

.lang-dropdown-menu.open {
  display: flex;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
  width: 100%;
}

.lang-option:hover {
  background: rgba(255, 215, 0, 0.12);
  color: #ffffff;
}

.lang-option.active {
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
  font-weight: 700;
}

.lang-option .lang-flag {
  font-size: 1.05rem;
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════
   LANDING PAGE FOOTER & LEGAL STYLING
   ═══════════════════════════════════════════════════════ */
.landing-footer {
  width: 100%;
  background: #08160e;
  border-top: 1px solid #1c3b28;
  padding: 24px 20px 28px 20px;
  margin-top: auto;
  z-index: 10;
}

.footer-container {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.footer-disclaimer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 6px 14px;
  border-radius: 20px;
  line-height: 1.4;
}

.footer-disclaimer svg {
  flex-shrink: 0;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-link-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.footer-link-btn:hover {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.08);
}

.footer-dot {
  color: #475569;
  font-size: 0.75rem;
  user-select: none;
}

.footer-copy {
  font-size: 0.76rem;
  color: #64748b;
}

/* ═══════════════════════════════════════════════════════
   LEGAL MODAL & TABS
   ═══════════════════════════════════════════════════════ */
.modal-card-legal {
  max-width: 860px;
  width: 94%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: #0c1c13;
  border: 1px solid rgba(255, 215, 0, 0.25);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.9);
}

.modal-header-legal {
  padding: 20px 24px 14px 24px;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  background: #09170f;
}

.modal-legal-heading-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.legal-nav-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.legal-tab-btn {
  padding: 7px 15px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.legal-tab-btn:hover {
  background: rgba(255, 215, 0, 0.12);
  color: #ffffff;
  border-color: rgba(255, 215, 0, 0.35);
}

.legal-tab-btn.active {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.22), rgba(197, 160, 89, 0.12));
  color: #ffd700;
  border-color: #ffd700;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.legal-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px;
  font-size: 0.88rem;
  line-height: 1.68;
  color: #d1d5db;
}

.legal-doc-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.legal-operator-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(212, 175, 55, 0.09);
  border: 1px dashed rgba(212, 175, 55, 0.45);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #fef08a;
  line-height: 1.45;
}

.legal-operator-notice svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.legal-banner-highlight {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 8px;
  padding: 12px 16px;
  color: #f1f5f9;
  font-size: 0.86rem;
  line-height: 1.45;
}

.legal-banner-highlight.gold {
  background: rgba(255, 215, 0, 0.08);
  border-color: rgba(255, 215, 0, 0.3);
}

.legal-banner-highlight svg {
  flex-shrink: 0;
}

.legal-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px 18px;
}

.legal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
  flex-wrap: wrap;
}

.legal-card-header h4 {
  font-size: 0.98rem;
  color: #ffd700;
  margin: 0;
  font-weight: 700;
}

.legal-card-body h5 {
  font-size: 0.88rem;
  color: #ffffff;
  margin: 14px 0 6px 0;
  font-weight: 600;
}

.legal-card-body p {
  margin: 0 0 10px 0;
}

.legal-card-body p:last-child {
  margin-bottom: 0;
}

.legal-badge-pill {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #9ca3af;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.legal-badge-pill.green {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.35);
}

.legal-badge-pill.gold {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.35);
}

.legal-placeholder {
  background: rgba(212, 175, 55, 0.18);
  border-bottom: 1px dashed #ffd700;
  color: #fef08a;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
}

.legal-address-box {
  background: rgba(0, 0, 0, 0.28);
  border-left: 3px solid #ffd700;
  padding: 10px 14px;
  margin: 8px 0 12px 0;
  border-radius: 0 6px 6px 0;
  line-height: 1.65;
}

.legal-list {
  margin: 6px 0 12px 0;
  padding-left: 20px;
  line-height: 1.65;
}

.legal-list li {
  margin-bottom: 6px;
}

.legal-list code {
  background: rgba(0, 0, 0, 0.35);
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.legal-link {
  color: #38bdf8;
  text-decoration: underline;
  transition: color 0.12s;
}

.legal-link:hover {
  color: #7dd3fc;
}

.legal-footer-disclaimer-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #9ca3af;
  line-height: 1.35;
}

@media (max-width: 768px) {
  .landing-footer {
    padding: 20px 14px 24px 14px;
  }
  .modal-card-legal {
    width: 98%;
    max-height: 92vh;
    border-radius: 10px;
  }
  .modal-header-legal {
    padding: 16px 16px 12px 16px;
  }
  .legal-modal-body {
    padding: 16px;
  }
  .legal-nav-tabs {
    gap: 6px;
  }
  .legal-tab-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  .footer-links {
    gap: 6px;
  }
  .footer-link-btn {
    font-size: 0.8rem;
    padding: 3px 6px;
  }
}

/* ============================================================
   EMOTE SYSTEM & FLOATING BUBBLES
   ============================================================ */
.emote-picker-wrapper {
  position: relative;
  display: inline-block;
}

.btn-emote {
  background: linear-gradient(135deg, #1e3a2b, #15291e);
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: #ffd700;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.btn-emote:hover:not(:disabled) {
  background: linear-gradient(135deg, #2a503c, #1e3a2b);
  border-color: #ffd700;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.btn-emote.cooldown {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.emote-cooldown-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  background: #e63946;
  color: #ffffff;
  padding: 1px 4px;
  border-radius: 6px;
  line-height: 1;
}

.emote-picker-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 25, 20, 0.95);
  border: 1.5px solid rgba(255, 215, 0, 0.5);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65), 0 0 16px rgba(255, 215, 0, 0.2);
  backdrop-filter: blur(12px);
  z-index: 1000;
  animation: emotePopupIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  width: 250px;
}

@keyframes emotePopupIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.emote-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.emote-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 8px;
  padding: 6px 2px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.emote-pick-btn:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: #ffd700;
  transform: scale(1.15);
  z-index: 2;
}

.emote-pick-btn .ep-emoji {
  font-size: 1.4rem;
  line-height: 1;
}

.emote-pick-btn .ep-label {
  font-size: 0.58rem;
  color: #c5a059;
  font-weight: 600;
  margin-top: 2px;
  text-align: center;
}

/* Floating In-Game Emote Bubble on Players */
.seat-emote-bubble {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(14, 24, 18, 0.94);
  border: 1.5px solid rgba(255, 215, 0, 0.7);
  border-radius: 16px;
  padding: 6px 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7), 0 0 14px rgba(255, 215, 0, 0.3);
  pointer-events: none;
  z-index: 250;
  backdrop-filter: blur(8px);
  animation: emoteFloatPop 3.2s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.seat-emote-bubble.emote-seat-0 {
  bottom: 54px;
  left: 50%;
  transform: translateX(-50%);
}

.seat-emote-bubble.emote-seat-1 {
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
}

.seat-emote-bubble.emote-seat-2 {
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
}

.seat-emote-bubble.emote-seat-3 {
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
}

.seat-emote-bubble .emote-emoji {
  font-size: 2.1rem;
  line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
  animation: emoteWiggle 0.6s ease-in-out;
}

.seat-emote-bubble .emote-name {
  font-size: 0.7rem;
  font-weight: 800;
  color: #ffd700;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

@keyframes emoteFloatPop {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.6);
  }
  12% {
    opacity: 1;
    transform: translateY(0) scale(1.15);
  }
  20% {
    transform: translateY(0) scale(1);
  }
  75% {
    opacity: 1;
    transform: translateY(-6px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-28px) scale(0.85);
  }
}

@keyframes emoteWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg) scale(1.1); }
  75% { transform: rotate(10deg) scale(1.1); }
}

/* --- System Announcement Banner (Admin Broadcast) --- */
.system-announcement-container {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 90%;
  max-width: 520px;
  pointer-events: none;
}

.system-announcement-banner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(20, 24, 38, 0.96) 0%, rgba(30, 36, 56, 0.98) 100%);
  border: 1px solid rgba(245, 158, 11, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  color: #fff;
  animation: announcementSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.system-announcement-banner.announcement-leaving {
  opacity: 0;
  transform: translateY(-20px) scale(0.95);
}

.system-announcement-banner .announcement-icon {
  font-size: 26px;
  flex-shrink: 0;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.5));
}

.system-announcement-banner .announcement-content {
  flex: 1;
  min-width: 0;
}

.system-announcement-banner .announcement-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fbbf24;
  margin-bottom: 2px;
}

.system-announcement-banner .announcement-text {
  font-size: 14px;
  line-height: 1.4;
  color: #f3f4f6;
  word-break: break-word;
}

.system-announcement-banner .announcement-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
  align-self: flex-start;
}

.system-announcement-banner .announcement-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

@keyframes announcementSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ══════════ Dealing Animation Overlay & Flying Tiles ══════════ */
.dealing-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 150;
}

.dealing-flying-tile {
  position: absolute;
  width: 36px;
  height: 52px;
  border-radius: 6px;
  background: linear-gradient(145deg, #c0392b 0%, #8e1b10 100%);
  border: 1.8px solid #ffd700;
  box-shadow:
    2px 2px 0 #962d22,
    3px 3px 0 #7b1d12,
    4px 4px 0 #5c120a,
    0 14px 28px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 215, 0, 0.95);
  pointer-events: none;
  z-index: 151;
  will-change: transform, opacity;
  transform-origin: center center;
}

.dealing-star {
  font-size: 13px;
  color: #ffd700;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.dealing-count-badge {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  padding: 1px 5px;
  border-radius: 5px;
  margin-top: 3px;
  border: 1px solid rgba(255, 215, 0, 0.75);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  line-height: 1.1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.deck-stack.deck-pulse {
  animation: deckDealPulse 0.22s ease-out;
}

@keyframes deckDealPulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.92); filter: brightness(1.2); }
  100% { transform: scale(1); filter: brightness(1); }
}

.rack-rows-wrapper.rack-bounce {
  animation: rackDealThud 0.22s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes rackDealThud {
  0% { transform: translateY(0); }
  50% { transform: translateY(4px) scale(0.99); }
  100% { transform: translateY(0) scale(1); }
}

.bot-seat.seat-bounce .bot-avatar-ring {
  animation: avatarDealPulse 0.24s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes avatarDealPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.22); filter: brightness(1.4); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* Staggered rack tile pop-in after deal completes */
.okey-tile.deal-reveal {
  animation: dealTileSnap 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.25) backwards;
}

@keyframes dealTileSnap {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.68);
  }
  70% {
    opacity: 1;
    transform: translateY(-4px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ═══════════════════════════════════════════════════════
   MOBILE DEVICE NOTICE OVERLAY (DESKTOP ONLY / APP COMING SOON)
   ═══════════════════════════════════════════════════════ */
body.mobile-notice-active {
  overflow: hidden !important;
}

.mobile-device-notice {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 5000;
  background: radial-gradient(circle at 50% 30%, #154526 0%, #0d2917 55%, #05130b 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mdn-topbar {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
}

.mdn-card {
  position: relative;
  max-width: 440px;
  width: 100%;
  margin: auto;
  background: rgba(12, 28, 19, 0.88);
  border: 1px solid rgba(255, 215, 0, 0.32);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(255, 215, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  padding: 32px 24px 22px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: mdnCardPop 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes mdnCardPop {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(16px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.mdn-logo-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

.mdn-logo-group .logo-emblem {
  transform: scale(0.85);
  margin-bottom: -4px;
}

.mdn-brand {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffd700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  gap: 2px;
}

.mdn-brand .logo-tld {
  color: rgba(255, 255, 255, 0.85);
  font-size: 20px;
  font-weight: 600;
}

.mdn-hero-icon {
  margin: 10px 0 14px 0;
}

.mdn-device-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 215, 0, 0.22), rgba(255, 215, 0, 0.04));
  border: 1.5px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 0 16px rgba(255, 215, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mdnFloat 3.2s ease-in-out infinite;
}

.mdn-icon-desktop {
  font-size: 38px;
  line-height: 1;
}

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

.mdn-title {
  font-size: 21px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
  line-height: 1.35;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.mdn-text {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
  margin-bottom: 20px;
}

.mdn-text b {
  color: #ffd700;
  font-weight: 700;
}

.mdn-coming-soon-card {
  background: rgba(0, 0, 0, 0.42);
  border: 1px dashed rgba(255, 215, 0, 0.4);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 22px;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.mdn-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.45);
}

.mdn-cs-heading {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 6px;
  line-height: 1.3;
}

.mdn-cs-body {
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.76);
  margin: 0;
}

.mdn-button-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.mdn-btn-main {
  width: 100%;
  padding: 14px 18px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: linear-gradient(135deg, #ffd700 0%, #f5b041 100%);
  color: #1a1003;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.35);
  transition: all 0.2s ease;
}

.mdn-btn-main:active {
  transform: scale(0.98);
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.mdn-btn-main.btn-copied-success {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.45);
}

.mdn-btn-bypass {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.mdn-btn-bypass:hover,
.mdn-btn-bypass:active {
  color: rgba(255, 255, 255, 0.95);
}

.mdn-footer-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
}

.mdn-footer-legal .footer-link-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.15s ease;
}

.mdn-footer-legal .footer-link-btn:hover,
.mdn-footer-legal .footer-link-btn:active {
  color: #ffd700;
}

.mdn-footer-legal .footer-dot {
  color: rgba(255, 255, 255, 0.25);
  font-size: 11px;
}

/* Ensure legal modal overlays above mobile notice */
#legalModal {
  z-index: 6000 !important;
}
