/* ═══════════════════════════════════════════════════════════
   PuzzlePickers — shared site styles
   Reset, base body, and the site-wide navigation bar.
   Page-specific styles live in each page's inline <style>.
   ═══════════════════════════════════════════════════════════ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg, #eef6fd);
  color: var(--text, #0e2233);
  min-height: 100vh;
}

/* ── Navigation bar ── */
#nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #0C447C, #062F56);
  box-shadow: 0 2px 14px rgba(4, 44, 83, 0.35);
}

#nav-brand {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

#nav-brand span { color: #85B7EB; }

#nav-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}

.nav-link {
  padding: 6px 13px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 999px;
  color: #C5DEF7;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}

.nav-link:hover  { background: rgba(255, 255, 255, 0.14); color: #fff; }
.nav-link.active { background: #fff; color: #0C447C; pointer-events: none; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }

/* ── Playing cards (Poker & Blackjack) ──
   Defaults match Blackjack (78×122); Poker overrides height,
   radius, padding, and rank size in its own <style>. */
.card-outer { container-type: inline-size; }

.card {
  height: 122px;
  border-radius: 9px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  background: linear-gradient(180deg, #ffffff, #eef4fb);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 5px 5px;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  font-family: Georgia, 'Times New Roman', serif;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: default;
}

.card.back {
  background: url('../facecard-sm.png') center / cover no-repeat, #0C447C;
  border-color: rgba(55, 138, 221, 0.35);
}

/* Rank/suit size in cqw so it scales with card width — one size for
   every rank, including the two-digit 10 */
.card .rank-top {
  font-size: 60cqw;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  letter-spacing: -0.04em;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
}

.card .suit-mid {
  font-size: 60cqw;
  text-align: center;
  line-height: 1;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
}

.card.red   .rank-top, .card.red   .suit-mid { color: #d0263e; }
.card.black .rank-top, .card.black .suit-mid { color: #1a1a1a; }

@keyframes cardSnap {
  0%   { transform: translateY(-14px) scale(0.85) rotate(-4deg); opacity: 0.4; }
  65%  { transform: translateY(4px) scale(1.06) rotate(1deg); }
  100% { transform: translateY(0) scale(1) rotate(0); opacity: 1; }
}
.card.snapping { animation: cardSnap 0.36s cubic-bezier(0.34, 1.56, 0.64, 1); }

@keyframes cardWinGlow {
  from { box-shadow: 0 0 8px rgba(255, 184, 77, 0.3), 0 4px 10px rgba(0, 0, 0, 0.4); }
  to   { box-shadow: 0 0 22px rgba(255, 184, 77, 0.85), 0 4px 10px rgba(0, 0, 0, 0.4); }
}
.card.win-glow { border-color: #ffb84d; animation: cardWinGlow 0.6s ease-in-out infinite alternate; }

/* Small screens: brand on top, links in one swipeable row, not sticky */
@media (max-width: 640px) {
  #nav {
    position: static;
    flex-direction: column;
    gap: 8px;
    padding: 10px 8px 8px;
  }

  #nav-links {
    flex-wrap: nowrap;
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  #nav-links::-webkit-scrollbar { display: none; }
}
