/* Loading screen shown while a page gets ready (table, lobby, hand history). The markup sits at the
   top of each page's <body> so it covers the very first paint; the page hides it once it has what
   it needs (window.wpLoader.hide()), and it steps aside by itself after 12 seconds regardless. */
#wp-loader {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: radial-gradient(ellipse 80% 55% at 50% 40%, #15291c 0%, #0a140d 72%) #0a140d;
  transition: opacity .3s ease;
}
#wp-loader.wpl-hide { opacity: 0; pointer-events: none; }
#wp-loader[hidden] { display: none; }
#wp-loader .wpl-row { display: flex; gap: 5px; }
#wp-loader .wpl-row span {
  width: 30px; height: 36px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(#f6eed8, #e6d7ae); color: #1d1a12;
  font: 700 1.2rem 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .45), inset 0 -2px 0 rgba(0, 0, 0, .13);
  animation: wplFlip 1.8s ease-in-out infinite;
}
#wp-loader .wpl-row.gold span { background: linear-gradient(#f3d978, #d2bf55); }
/* each tile flips in turn, top row then bottom row */
#wp-loader .wpl-row span:nth-child(1) { animation-delay: 0s; }
#wp-loader .wpl-row span:nth-child(2) { animation-delay: .08s; }
#wp-loader .wpl-row span:nth-child(3) { animation-delay: .16s; }
#wp-loader .wpl-row span:nth-child(4) { animation-delay: .24s; }
#wp-loader .wpl-row span:nth-child(5) { animation-delay: .32s; }
#wp-loader .wpl-row.gold span:nth-child(1) { animation-delay: .4s; }
#wp-loader .wpl-row.gold span:nth-child(2) { animation-delay: .48s; }
#wp-loader .wpl-row.gold span:nth-child(3) { animation-delay: .56s; }
#wp-loader .wpl-row.gold span:nth-child(4) { animation-delay: .64s; }
#wp-loader .wpl-row.gold span:nth-child(5) { animation-delay: .72s; }
@keyframes wplFlip {
  0%, 55%, 100% { transform: translateY(0) rotateY(0); }
  20% { transform: translateY(-7px) rotateY(180deg); }
  35% { transform: translateY(0) rotateY(360deg); }
}
#wp-loader .wpl-text {
  margin: 18px 0 0; font: 600 .82rem 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  letter-spacing: .16em; text-transform: uppercase; color: rgba(232, 224, 200, .6);
}
#wp-loader .wpl-text::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: wplDots 1.4s steps(4) infinite; }
@keyframes wplDots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
@media (prefers-reduced-motion: reduce) { #wp-loader .wpl-row span { animation: none; } }
@media (max-width: 480px) { #wp-loader .wpl-row span { width: 26px; height: 31px; font-size: 1.05rem; } }
