/* Accessibility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── Game page theme variables ── */
:root {
  --panel: #0f172a;
  --brand: #10b981;
  --muted: #cbd5e1;
  --line:  #1f2937;
}

/* ── Semantic color tokens ── */
:root {
  --color-success: #4ade80;
  --color-warn:    #fbbf24;
  --color-danger:  #ef4444;
  --color-info:    #60a5fa;
}

/* ── Site-wide fixed header ── */
.site-header{position:fixed;top:0;left:0;width:100%;background:rgba(17,24,39,.85);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1px solid rgba(255,255,255,.06);z-index:1001;display:flex;align-items:center;padding:12px 20px;gap:14px}
.site-brand{font-size:1.25rem;font-weight:900;font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;color:#2ecc71;text-decoration:none;letter-spacing:-.02em;white-space:nowrap;flex-shrink:0}
.site-brand:hover{color:#45b7d1}

/* ── Hamburger nav ── */
.hamburger{cursor:pointer;background:transparent;border:none;padding:0;appearance:none;-webkit-appearance:none;flex-shrink:0}
.hamburger:focus{outline:2px solid rgba(255,255,255,.25);outline-offset:4px;border-radius:10px}
.hamburger-box{width:30px;height:30px;display:flex;flex-direction:column;justify-content:space-around;background:transparent;border-radius:8px;padding:6px;transition:.3s}
.hamburger-box:hover{background:rgba(0,0,0,.3)}
.hamburger-line{width:100%;height:3px;background:#fff;border-radius:2px}
.backdrop{position:fixed;inset:0;background:rgba(0,0,0,.5);opacity:0;visibility:hidden;transition:.3s;z-index:998}
.backdrop.open{opacity:1;visibility:visible}
.drawer{position:fixed;top:0;left:-300px;width:300px;height:100vh;background:var(--panel);border-right:2px solid var(--brand);transition:left .3s ease;z-index:999;padding:80px 20px 20px;overflow-y:auto;-webkit-overflow-scrolling:touch}
.drawer.open{left:0}
.menu-sec{margin-bottom:1.5rem}
.menu-title{font-size:1rem;font-weight:700;color:var(--brand);margin-bottom:.75rem;padding-bottom:.5rem;border-bottom:1px solid var(--line)}
.menu-link{display:block;color:var(--muted);text-decoration:none;padding:.6rem 0;border-radius:5px;transition:.2s}
.menu-link:hover{color:#fff;background:rgba(16,185,129,.1);padding-left:.5rem}

/* ── Cookie consent bar ── */
#dj-cookie-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.97);
  border-top: 1px solid #1e293b;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.75rem;
  color: #94a3b8;
  z-index: 9000;
  flex-wrap: wrap;
  text-align: center;
}
#dj-cookie-bar a { color: #2ecc71; text-decoration: underline; }
#dj-cookie-bar button {
  background: #2ecc71;
  color: #111;
  border: none;
  padding: 4px 14px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

/* Pulse animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.pulse-animation {
  animation: pulse 2s infinite;
}

/* Volume slider thumb styling */
.slider::-webkit-slider-thumb,
.slider::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #fff;
  cursor: pointer;
  transition: background 0.3s;
}

/* Guess slot styling */
.guess-box {
  background-color: rgba(55, 65, 81, 0.5);
  border: 2px solid #4B5563;
  border-radius: 0.5rem;
  padding: 0.5rem;
  opacity: 0.5;
  display: flex;
  align-items: center;
  min-height: 40px;
}

/* Left-aligned */
.guess-left {
  justify-content: flex-start;
  text-align: left;
}

/* Right-aligned */
.guess-right {
  justify-content: flex-end;
  text-align: right;
}
.guess-box.correct {
  border-color: #22c55e;
  background-color: rgba(22, 163, 74, 0.3);
  opacity: 1;
}
.guess-box.wrong {
  border-color: #ef4444;
  background-color: rgba(239, 68, 68, 0.3);
  opacity: 1;
}
.guess-box.skipped {
  border-color: #eab308;
  background-color: rgba(234, 179, 8, 0.3);
  opacity: 1;
}

/* Suggestion hover */
.suggestions div:hover {
  background-color: #374151;
}

/* Smooth scroll */
body {
  scroll-behavior: smooth;
}

/* Custom green slider styles */
input[type=range].slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(to right, var(--brand) 50%, #4b5563 50%);
  outline: none;
}

input[type=range].slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand);
  cursor: pointer;
  border: none;
}

input[type=range].slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand);
  cursor: pointer;
  border: none;
}

/* ── Chain Link ─────────────────────────────────── */
@keyframes cl-shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-6px); }
  40%     { transform: translateX(6px); }
  60%     { transform: translateX(-4px); }
  80%     { transform: translateX(4px); }
}
@keyframes cl-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cl-pulse-glow {
  0%,100% { box-shadow: 0 0 0 0 rgba(251,191,36,0); }
  50%     { box-shadow: 0 0 0 6px rgba(251,191,36,0.1); }
}
@keyframes cl-pop-in {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* Game layout - fills viewport below fixed header */
.cl-game-wrap {
  margin-top: 56px;
  min-height: calc(100vh - 56px);
  min-height: calc(100dvh - 56px);
  display: flex;
  justify-content: center;
  padding: 8px 16px 12px;
  overflow-x: hidden;
  overflow-y: auto;
}
.cl-container {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 72px);
  min-height: calc(100dvh - 72px);
  gap: 6px;
}

/* Chain tiles */
.cl-tile {
  width: 100%;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1.5px solid #2d3748;
  background: #1a202c;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
}
.cl-tile-given  { background: rgba(139,92,246,0.08); border-color: rgba(139,92,246,0.35); }
.cl-tile-solved { background: rgba(16,185,129,0.05);  border-color: rgba(16,185,129,0.25); }
.cl-tile-active {
  background: rgba(251,191,36,0.05);
  border-color: rgba(251,191,36,0.35);
  animation: cl-pulse-glow 2.5s ease-in-out infinite;
}
.cl-tile-locked { opacity: 0.22; }
.cl-tile-text {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 3.5px;
  flex: 1;
  text-align: center;
}
.cl-tile-pts {
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  position: absolute;
  right: 12px;
  opacity: 0.85;
}

/* Connectors between tiles */
.cl-connector {
  height: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}
.cl-conn-line {
  width: 2px;
  flex: 1;
  background: #2d3748;
  transition: background 0.3s;
}
.cl-conn-line.done { background: rgba(16,185,129,0.3); }
.cl-compound {
  position: absolute;
  font-size: 9px;
  font-weight: 700;
  color: rgba(16,185,129,0.5);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: #111827; /* matches body bg-gray-900 */
  padding: 0 8px;
  white-space: nowrap;
  animation: cl-fade-up 0.3s ease;
}

/* Clue box */
.cl-clue-box {
  background: #1a202c;
  border: 1.5px solid #2d3748;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Attempt dots */
.cl-try-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2d3748;
  transition: background 0.3s;
}
.cl-try-dot.used { background: #ef4444; }

/* Animations */
.cl-shake   { animation: cl-shake   0.4s ease; }
.cl-fade-in { animation: cl-fade-up 0.4s ease; }

/* How to Play modal - demo words */
.cl-demo-word {
  width: 100%;
  padding: 6px 10px;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 3px;
  border: 1.5px solid transparent;
  transition: all 0.4s ease;
}
.cl-demo-given  { color: #c4b5fd; background: rgba(139,92,246,0.08); border-color: rgba(139,92,246,0.25); }
.cl-demo-solved { color: #4ade80; background: rgba(34,197,94,0.06);  border-color: rgba(34,197,94,0.2); }
.cl-demo-new    { color: #4ade80; background: rgba(34,197,94,0.12);  border-color: rgba(34,197,94,0.4); animation: cl-pop-in 0.35s ease; }
.cl-demo-locked { color: #3f3f5e; border-color: #2d3748; opacity: 0.4; }
.cl-demo-conn   { height: 16px; display: flex; align-items: center; justify-content: center; }
.cl-demo-phrase { font-size: 8px; font-weight: 700; color: rgba(16,185,129,0.5); letter-spacing: 1.5px; text-transform: uppercase; animation: cl-fade-up 0.3s ease; }
.cl-demo-dot    { font-size: 8px; color: #2d3748; }

/* Chain Link modal — bottom-sheet on mobile, centered on taller screens */
#cl-modal { align-items: flex-end; padding: 0; }
#cl-modal > div {
  border-radius: 1.25rem 1.25rem 0 0;
  max-height: 92vh;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
}
@media (min-height: 600px) {
  #cl-modal { align-items: center; padding: 1rem; }
  #cl-modal > div { border-radius: 1rem; max-height: 85vh; padding-bottom: 1.25rem; }
}

/* ── Themedle How to Play demo ──────────────────── */
.td-bar {
  width: 4px;
  background: #10b981;
  border-radius: 2px 2px 0 0;
  transform-origin: bottom;
  animation: td-bounce 0.6s ease-in-out infinite alternate;
  animation-play-state: paused;
}
.td-bar.playing { animation-play-state: running; }
.td-bar:nth-child(1) { animation-delay: 0.00s; }
.td-bar:nth-child(2) { animation-delay: 0.10s; }
.td-bar:nth-child(3) { animation-delay: 0.20s; }
.td-bar:nth-child(4) { animation-delay: 0.05s; }
.td-bar:nth-child(5) { animation-delay: 0.15s; }
.td-bar:nth-child(6) { animation-delay: 0.25s; }
.td-bar:nth-child(7) { animation-delay: 0.08s; }
.td-bar:nth-child(8) { animation-delay: 0.18s; }
@keyframes td-bounce {
  0%   { transform: scaleY(0.15); }
  100% { transform: scaleY(1); }
}

/* Themedle modal — bottom-sheet on mobile, centered on taller screens */
#td-modal { align-items: flex-end; }
#td-modal > div { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
@media (min-height: 600px) {
  #td-modal { align-items: center; }
}

/* ── BlackJackdle ──────────────────────────────────── */

/* Game layout - fills viewport below fixed header */
.bj-game-wrap {
  position: fixed;
  top: 56px;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
}
.bj-container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  position: relative;
}

/* Poker table felt */
.bj-table {
  flex: 0 0 auto;
  height: 55vh;
  background: radial-gradient(ellipse at 50% 80%, #1a5c2a 0%, #14472a 40%, #0d3320 70%, #0a2618 100%);
  border: 3px solid #2a1a0a;
  border-radius: 0 0 50% 50% / 0 0 18% 18%;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.4), 0 4px 20px rgba(0,0,0,0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  overflow: hidden;
}
/* Subtle felt texture */
.bj-table::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000' fill-opacity='0.06'%3E%3Ccircle cx='1' cy='1' r='0.5'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: inherit;
}
/* Gold trim on table edge */
.bj-table::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1.5px solid rgba(218,165,32,0.2);
  border-radius: 0 0 50% 50% / 0 0 18% 18%;
  pointer-events: none;
}

.bj-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  text-align: center;
}

/* Dealer & Player areas */
.bj-dealer-area, .bj-player-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 1;
}

/* Card containers */
.bj-cards {
  display: flex;
  justify-content: center;
  min-height: 90px;
  position: relative;
}
.bj-card-slot {
  margin-left: -20px;
}
.bj-card-slot:first-child { margin-left: 0; }

/* Individual card */
.bj-card {
  width: 62px;
  height: 90px;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  font-family: 'Georgia', serif;
}
.bj-card-front {
  background: linear-gradient(145deg, #fff 0%, #f0f0f0 100%);
  border: 1.5px solid rgba(0,0,0,0.15);
}
.bj-card-back {
  background: linear-gradient(145deg, #1e40af, #1e3a8a);
  border: 1.5px solid #3b82f6;
  overflow: hidden;
}
.bj-card-back-pattern {
  position: absolute;
  inset: 4px;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 3px,
    rgba(255,255,255,0.04) 3px,
    rgba(255,255,255,0.04) 6px
  );
}

/* Card corners */
.bj-card-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.bj-card-tl { top: 4px; left: 5px; }
.bj-card-br { bottom: 4px; right: 5px; transform: rotate(180deg); }
.bj-card-rank { font-size: 13px; font-weight: 800; }
.bj-card-suit { font-size: 10px; }
.bj-card-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 26px; }

/* Hand score badges */
.bj-hand-score {
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 12px;
  min-width: 32px;
  text-align: center;
}

/* Deck (card stack, top-right area) */
.bj-deck {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 2;
}
.bj-deck-card {
  width: 50px;
  height: 72px;
  background: linear-gradient(145deg, #1e40af, #1e3a8a);
  border: 1.5px solid #3b82f6;
  border-radius: 6px;
  position: absolute;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.bj-deck-card:nth-child(1) { top: 0; left: 0; }
.bj-deck-card:nth-child(2) { top: -2px; left: 2px; }
.bj-deck-card:nth-child(3) { top: -4px; left: 4px; }

/* Hand indicator */
.bj-hand-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.25);
  letter-spacing: 1px;
  z-index: 1;
}

/* Player row: contains main hand + optional split hand */
.bj-player-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
}

/* Split area */
.bj-split-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 1;
}

/* Side-by-side layout when split is active */
.bj-player-row.bj-split-active {
  gap: 10px;
}
.bj-player-row.bj-split-active .bj-player-area,
.bj-player-row.bj-split-active .bj-split-area {
  flex: 1;
  min-width: 0;
}
/* Smaller cards in split mode */
.bj-split-active .bj-card {
  width: 50px;
  height: 72px;
}
.bj-split-active .bj-cards {
  min-height: 72px;
}
.bj-split-active .bj-card-slot {
  margin-left: -15px;
}
.bj-split-active .bj-card-center { font-size: 20px; }
.bj-split-active .bj-card-rank { font-size: 11px; }

.bj-hand-active .bj-cards {
  filter: drop-shadow(0 0 10px rgba(251,191,36,0.9)) drop-shadow(0 0 20px rgba(251,191,36,0.5));
}

/* Chip bar (below table) */
.bj-chip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  flex-shrink: 0;
}
.bj-chip-stack {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bj-chip-icon { width: 24px; height: 24px; }
.bj-chip-icon-lg { width: 32px; height: 32px; }
.bj-chip-count {
  font-size: 20px;
  font-weight: 800;
  color: #10b981;
}
.bj-bet-display {
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
}

/* Betting area */
.bj-bet-area {
  padding: 10px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.bj-bet-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}
.bj-bet-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.bj-bet-chip {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid #10b981;
  background: radial-gradient(circle at 40% 35%, #1a3a2a, #0d2618);
  color: #10b981;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 0 0 2px rgba(16,185,129,0.15);
}
.bj-bet-chip:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #34d399;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}
.bj-bet-chip:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.bj-bet-allin {
  width: auto;
  border-radius: 26px;
  padding: 0 16px;
  font-size: 11px;
  letter-spacing: 1px;
  border-color: #ef4444;
  color: #ef4444;
  background: radial-gradient(circle at 40% 35%, #3a1a1a, #261010);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 0 0 2px rgba(239,68,68,0.15);
}
.bj-bet-allin:hover:not(:disabled) {
  border-color: #f87171;
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}
.bj-bet-selected {
  font-size: 16px;
  font-weight: 800;
  color: #fbbf24;
}
.bj-bet-actions {
  display: flex;
  gap: 10px;
}

/* Action buttons */
.bj-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px 16px;
  justify-content: center;
  flex-shrink: 0;
}
.bj-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 70px;
}
.bj-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bj-btn-primary { background: #10b981; color: #fff; }
.bj-btn-primary:hover:not(:disabled) { background: #34d399; }
.bj-btn-secondary { background: #374151; color: #fff; }
.bj-btn-secondary:hover:not(:disabled) { background: #4b5563; }
.bj-btn-accent { background: #7c3aed; color: #fff; }
.bj-btn-accent:hover:not(:disabled) { background: #8b5cf6; }
.bj-btn-muted { background: transparent; border: 1.5px solid #4b5563; color: #9ca3af; }
.bj-btn-muted:hover:not(:disabled) { border-color: #6b7280; color: #fff; }

/* Hand result banner */
.bj-hand-result {
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 10px;
  margin: 0 16px;
  animation: bj-fade-in 0.3s ease;
}
.bj-result-win { background: rgba(16,185,129,0.15); color: #34d399; border: 1.5px solid rgba(16,185,129,0.3); }
.bj-result-lose { background: rgba(239,68,68,0.15); color: #f87171; border: 1.5px solid rgba(239,68,68,0.3); }
.bj-result-push { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1.5px solid rgba(251,191,36,0.3); }

/* Split result: two-panel banner */
.bj-split-result-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bj-split-result-half {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 8px;
  border-radius: 8px;
}
.bj-split-result-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
}
.bj-split-result-chips {
  font-size: 15px;
  font-weight: 800;
}
.bj-split-result-sep {
  font-size: 20px;
  font-weight: 300;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

/* Final results panel */
.bj-results {
  padding: 8px 16px 16px;
  flex-shrink: 0;
}
.bj-results-inner {
  background: rgba(31,41,55,0.6);
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.bj-result-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  background: rgba(31,41,55,0.5);
  border-radius: 8px;
  color: #9ca3af;
}

/* Deal card animation */
@keyframes bj-card-in {
  from { opacity: 0; transform: translateY(-20px) scale(0.8); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.bj-card-dealt {
  animation: bj-card-in 0.3s ease;
}

/* Flying card animation */
.bj-card-fly {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  pointer-events: none;
}
@keyframes bj-fly {
  from { transform: translate(0, 0) scale(0.85); opacity: 0.7; }
  to   { transform: translate(var(--fly-x), var(--fly-y)) scale(1); opacity: 1; }
}
.bj-fly-anim {
  animation: bj-fly 0.35s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

/* Hole card flip */
@keyframes bj-flip-out {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
@keyframes bj-flip-in {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.bj-flip-out { animation: bj-flip-out 0.2s ease-in forwards; }
.bj-flip-in  { animation: bj-flip-in  0.2s ease-out forwards; }

/* General fade */
@keyframes bj-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Modal responsive */
@media (min-height: 600px) {
  #bj-modal { align-items: center; padding: 1rem; }
  #bj-modal > div {
    border-radius: 1rem;
    max-height: 85vh;
    padding-bottom: 1.25rem;
  }
}

/* ── Spelldle ─────────────────────────────────────────────────────────────── */

/* Layout */
.spd-game-wrap {
  position: fixed;
  top: 57px; /* below fixed header */
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8px 8px;
  overflow: hidden;
}

.spd-container {
  width: 100%;
  max-width: 680px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: visible;
}

/* Two-panel layout: frozen name col + scrollable attrs */
.spd-panels {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* Frozen left column */
.spd-frozen-col {
  flex-shrink: 0;
  width: 100px;
  display: flex;
  flex-direction: column;
  background: #111827;
  z-index: 5;
  box-shadow: 3px 0 10px rgba(0,0,0,0.5);
}

.spd-frozen-header {
  display: flex;
  align-items: center;
  padding: 2px 0 2px 4px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  flex-shrink: 0;
}

.spd-names-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: hidden; /* scrollTop synced via JS */
}

/* Scrollable right panel */
.spd-attr-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Column header row — 9 attribute cols only, fixed px on mobile */
.spd-col-labels {
  display: grid;
  grid-template-columns: repeat(9, 56px);
  gap: 3px;
  flex-shrink: 0;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  text-align: center;
  padding: 2px 0;
}

/* Column header tooltips */
.spd-col-labels div[data-tip] {
  position: relative;
  cursor: help;
}
.spd-col-labels div[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  padding: 5px 8px;
  border-radius: 6px;
  white-space: normal;
  text-align: left;
  line-height: 1.45;
  z-index: 500;
  pointer-events: none;
  width: 170px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Board */
.spd-board {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Guess row — 9 attribute cols only, fixed px on mobile */
.spd-row {
  display: grid;
  grid-template-columns: repeat(9, 56px);
  gap: 3px;
  align-items: start;
}

/* Cells */
.spd-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  height: 48px;
  overflow: hidden;
  font-size: 0.6rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  padding: 3px 2px;
  gap: 1px;
}

.spd-name-cell {
  font-size: 0.62rem;
  font-weight: 700;
  text-align: left;
  align-items: flex-start;
  padding: 4px 6px;
  background: #1e293b;
  border: 1px solid #374151;
  color: #e2e8f0;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.2;
  justify-content: center;
}

/* Tile states */
.spd-tile {
  border: 1px solid transparent;
}

.spd-green {
  background: rgba(46, 204, 113, 0.2);
  border-color: #2ecc71;
  color: #86efac;
}

.spd-yellow {
  background: rgba(241, 196, 15, 0.2);
  border-color: #f1c40f;
  color: #fde047;
}

.spd-red {
  background: rgba(100, 116, 139, 0.15);
  border-color: #475569;
  color: #94a3b8;
}

.spd-empty {
  background: rgba(30, 41, 59, 0.3);
  border-color: #1f2937;
}

.spd-empty-cell {
  background: #131e2e;
  border-color: #1f2937;
}

/* Tile inner elements */
.spd-tile-val {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: pre-line;
  text-align: center;
}

.spd-tile-arrow {
  display: block;
  font-size: 0.7rem;
  line-height: 1;
  opacity: 0.9;
}

/* Pop-in animation for new rows */
@keyframes spd-pop-in {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.spd-tile-pop {
  animation: spd-pop-in 0.25s ease both;
}

/* Shake on bad input */
@keyframes spd-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.spd-shake {
  animation: spd-shake 0.4s ease;
}

/* Fade up for results */
@keyframes spd-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.spd-fade-up {
  animation: spd-fade-up 0.4s ease;
}

/* Autocomplete */
.spd-autocomplete-wrap {
  position: relative;
}

.spd-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: #1e293b;
  border: 1px solid #374151;
  border-radius: 8px;
  margin-bottom: 4px;
  overflow: hidden;
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  list-style: none;
  padding: 4px 0;
}

.spd-dropdown li {
  padding: 8px 12px;
  font-size: 0.85rem;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.1s;
}

.spd-dropdown li:hover,
.spd-dropdown-active {
  background: rgba(16, 185, 129, 0.15);
  color: #fff;
}

/* Toast */
.spd-toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  border: 1px solid #475569;
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
  pointer-events: none;
}

.spd-toast-show {
  opacity: 1;
}

/* Demo tiles in How to Play modal */
.spd-demo-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 8px;
  min-width: 52px;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.spd-demo-tile.spd-green {
  background: rgba(46,204,113,0.2);
  border-color: #2ecc71;
  color: #86efac;
}

.spd-demo-tile.spd-yellow {
  background: rgba(241,196,15,0.2);
  border-color: #f1c40f;
  color: #fde047;
}

.spd-demo-tile.spd-red {
  background: rgba(100,116,139,0.15);
  border-color: #475569;
  color: #94a3b8;
}

/* Spelldle modal — bottom-sheet on mobile, centered on taller screens */
#spd-modal { align-items: flex-end; padding: 0; }
#spd-modal > div {
  border-radius: 1.25rem 1.25rem 0 0;
  max-height: 92vh;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
}
@media (min-height: 600px) {
  #spd-modal { align-items: center; padding: 1rem; }
  #spd-modal > div {
    border-radius: 1rem;
    max-height: 85vh;
    padding-bottom: 1.25rem;
  }
}

/* On wider screens: fluid columns, no frozen-col styling needed */
@media (min-width: 580px) {
  .spd-frozen-col    { background: transparent; box-shadow: none; }
  .spd-attr-scroll   { overflow: visible; }
  /* Lock both header rows to the same height so every guess row lines up */
  .spd-frozen-header { height: 26px; }
  .spd-col-labels    { grid-template-columns: repeat(9, 1fr); height: 26px; align-items: center; }
  .spd-row           { grid-template-columns: repeat(9, 1fr); }
}

/* ── Roulettedle ──────────────────────────────────────────────────────────── */

/* Game layout */
.rl-game-wrap {
  position: fixed;
  top: 56px;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
}
.rl-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Wheel section: centered column */
.rl-wheel-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 16px 6px;
  gap: 10px;
  flex-shrink: 0;
}

/* Wheel */
.rl-wheel-wrap {
  position: relative;
  width: min(360px, calc(100vw - 20px));
  height: min(360px, calc(100vw - 20px));
  flex-shrink: 0;
}
.rl-wheel-rotor {
  width: 100%;
  height: 100%;
  will-change: transform;
}
.rl-wheel-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.rl-result-badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #0f172a;
  border: 3px solid #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  z-index: 4;
  transition: background 0.3s, border-color 0.3s;
  box-shadow: 0 0 12px rgba(0,0,0,0.6);
}
.rl-result-red   { background: #991b1b; border-color: #ef4444; }
.rl-result-black { background: #111827; border-color: #6b7280; }
.rl-result-green { background: #14532d; border-color: #22c55e; }

/* Chip info row below wheel */
.rl-wheel-info {
  display: flex;
  align-items: center;
  gap: 20px;
}
.rl-chip-stack {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rl-chip-icon    { width: 24px; height: 24px; }
.rl-chip-icon-lg { width: 32px; height: 32px; }
.rl-chip-count {
  font-size: 24px;
  font-weight: 800;
  color: #10b981;
}
.rl-spin-indicator {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Bet area */
.rl-bet-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 12px;
  flex-shrink: 0;
}

/* Denomination row */
.rl-denom-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.rl-denom-chip {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid #10b981;
  background: radial-gradient(circle at 40% 35%, #1a3a2a, #0d2618);
  color: #10b981;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.rl-denom-chip:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #34d399;
  box-shadow: 0 4px 10px rgba(16,185,129,0.3);
}
.rl-denom-chip.rl-denom-active {
  border-color: #fbbf24;
  color: #fbbf24;
  background: radial-gradient(circle at 40% 35%, #3a2a00, #261a00);
  box-shadow: 0 0 10px rgba(251,191,36,0.4);
}
.rl-denom-allin {
  width: auto;
  border-radius: 24px;
  padding: 0 12px;
  font-size: 10px;
  letter-spacing: 1px;
  border-color: #ef4444;
  color: #ef4444;
  background: radial-gradient(circle at 40% 35%, #3a1a1a, #261010);
}
.rl-denom-allin:hover:not(:disabled) {
  border-color: #f87171;
  box-shadow: 0 4px 10px rgba(239,68,68,0.3);
}
.rl-denom-allin.rl-denom-active {
  border-color: #f87171;
  color: #f87171;
  background: radial-gradient(circle at 40% 35%, #4a1a1a, #300000);
}

/* Board */
.rl-board-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Number section */
.rl-num-section {
  display: flex;
  gap: 3px;
}
.rl-zero-col {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 28px;
}
.rl-zero-spacer {
  flex: 1;
}
.rl-num-rows {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.rl-num-row {
  display: flex;
  gap: 3px;
}
.rl-num-row > * { flex: 1; min-width: 0; }
.rl-col-col {
  flex: 0 0 auto;
  width: 34px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Number cells */
.rl-num {
  height: 32px;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  overflow: visible;
  transition: filter 0.1s, transform 0.1s;
  color: #fff;
}
.rl-num:hover { filter: brightness(1.3); transform: scale(1.05); z-index: 1; }
.rl-num:active { transform: scale(0.97); }
.rl-red  { background: #b91c1c; }
.rl-blk  { background: #1f2937; border: 1px solid #374151; }
.rl-green { background: #15803d; height: 100%; flex: 1; }
.rl-zero-col .rl-num { width: 100%; height: 100%; font-size: 10px; }

/* Column bet buttons */
.rl-col-btn {
  flex: 1;
  background: #1e3a5f;
  border: 1px solid #2563eb;
  border-radius: 4px;
  color: #93c5fd;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  overflow: visible;
  transition: background 0.15s;
}
.rl-col-btn:hover { background: #1e40af; }

/* Dozens row */
.rl-dozens-row {
  display: flex;
  gap: 3px;
  margin-left: 31px;
  margin-right: 37px;
}
.rl-dozens-row .rl-outside-btn { flex: 1; }

/* Outside bets row */
.rl-outside-row {
  display: flex;
  gap: 3px;
  margin-left: 31px;
  margin-right: 37px;
}
.rl-outside-row .rl-outside-btn { flex: 1; }

/* Outside bet buttons */
.rl-outside-btn {
  height: 28px;
  border: 1px solid #374151;
  border-radius: 4px;
  background: #1f2937;
  color: #d1d5db;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  overflow: visible;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.rl-outside-btn:hover { background: #374151; color: #fff; }
.rl-red-outside  { background: #7f1d1d; border-color: #ef4444; color: #fca5a5; }
.rl-red-outside:hover  { background: #991b1b; }
.rl-blk-outside  { background: #111827; border-color: #6b7280; color: #d1d5db; }
.rl-blk-outside:hover  { background: #1f2937; }

/* Active bet overlay */
.rl-bet-overlay {
  position: absolute;
  top: -6px;
  right: -4px;
  background: #fbbf24;
  color: #000;
  font-size: 8px;
  font-weight: 900;
  border-radius: 8px;
  padding: 1px 4px;
  line-height: 1.4;
  z-index: 3;
  pointer-events: none;
}
.rl-has-bet {
  box-shadow: 0 0 0 2px #fbbf24;
}

/* Bet footer */
.rl-bet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 0;
}
.rl-total-bet-display {
  font-size: 14px;
  font-weight: 800;
  color: #fbbf24;
}
.rl-bet-actions {
  display: flex;
  gap: 8px;
}
.rl-btn {
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.rl-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.rl-btn-spin {
  background: #10b981;
  color: #fff;
  font-size: 15px;
  padding: 9px 22px;
}
.rl-btn-spin:hover:not(:disabled) { background: #34d399; }
.rl-btn-muted {
  background: transparent;
  border: 1.5px solid #4b5563;
  color: #9ca3af;
}
.rl-btn-muted:hover:not(:disabled) { border-color: #6b7280; color: #fff; }

/* Spin result banner */
.rl-spin-result {
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 10px;
  margin: 0 12px;
  animation: rl-fade-in 0.3s ease;
  flex-shrink: 0;
}
.rl-result-win  { background: rgba(16,185,129,0.15); color: #34d399; border: 1.5px solid rgba(16,185,129,0.3); }
.rl-result-lose { background: rgba(239,68,68,0.15);  color: #f87171; border: 1.5px solid rgba(239,68,68,0.3); }
.rl-result-push { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1.5px solid rgba(251,191,36,0.3); }

/* Results / broke panels */
.rl-results {
  padding: 8px 16px 16px;
  flex-shrink: 0;
}
.rl-results-inner {
  background: rgba(31,41,55,0.6);
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.rl-result-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  background: rgba(31,41,55,0.5);
  border-radius: 8px;
  color: #9ca3af;
  font-size: 11px;
}

/* Animations */
@keyframes rl-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Modal responsive */
@media (min-height: 600px) {
  #rl-modal { align-items: center; padding: 1rem; }
  #rl-modal > div { border-radius: 1rem; max-height: 85vh; padding-bottom: 1.25rem; }
}

/* ── Holdle ─────────────────────────────────────────────────── */

.hd-game-wrap {
  position: fixed;
  top: 56px;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.hd-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Poker table */
.hd-table {
  flex: 0 0 auto;
  height: 52vh;
  background: radial-gradient(ellipse at 50% 80%, #1a5c2a 0%, #14472a 40%, #0d3320 70%, #0a2618 100%);
  border: 3px solid #2a1a0a;
  border-radius: 0 0 50% 50% / 0 0 18% 18%;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.4), 0 4px 20px rgba(0,0,0,0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 10px;
  overflow: hidden;
}
.hd-table::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000' fill-opacity='0.06'%3E%3Ccircle cx='1' cy='1' r='0.5'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: inherit;
}
.hd-table::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1.5px solid rgba(218,165,32,0.2);
  border-radius: 0 0 50% 50% / 0 0 18% 18%;
  pointer-events: none;
}

/* AI row */
.hd-ai-row {
  display: flex;
  justify-content: space-around;
  width: 100%;
  align-items: flex-start;
  z-index: 1;
}
.hd-ai-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  padding: 3px;
  border-radius: 8px;
  position: relative;
  transition: opacity 0.3s, box-shadow 0.2s, background 0.2s;
}
.hd-ai-seat.hd-ai-folded { opacity: 0.35; }
.hd-ai-seat.hd-ai-allin .hd-ai-name { color: #f87171; }
.hd-ai-seat.hd-ai-active {
  background: rgba(251,191,36,0.07);
  box-shadow: 0 0 0 1.5px rgba(251,191,36,0.5), 0 0 14px rgba(251,191,36,0.2);
}
.hd-ai-name {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  text-align: center;
}
.hd-ai-chips {
  font-size: 9px;
  color: #10b981;
  font-weight: 700;
}
.hd-ai-action {
  font-size: 8px;
  color: #fbbf24;
  font-weight: 700;
  letter-spacing: 0.5px;
  min-height: 11px;
  text-align: center;
}
.hd-ai-action.hd-action-anim {
  animation: hd-action-pop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes hd-action-pop {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}
.hd-ai-cards {
  display: flex;
  gap: 2px;
  transition: filter 0.3s, opacity 0.3s, transform 0.3s;
}
.hd-ai-cards.hd-cards-folded {
  filter: grayscale(1) brightness(0.55);
  opacity: 0.4;
  transform: scale(0.82) translateY(3px);
}

/* Community cards */
.hd-community {
  display: flex;
  gap: 4px;
  align-items: center;
  z-index: 1;
}
.hd-comm-slot {
  width: 38px;
  height: 56px;
  border-radius: 5px;
  background: rgba(0,0,0,0.25);
  border: 1.5px dashed rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hd-comm-slot.filled {
  background: transparent;
  border: none;
}

/* Pot display */
.hd-pot {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 6px;
  z-index: 1;
}
.hd-pot-label {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  line-height: 11px;
}

/* Player area */
.hd-player-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  z-index: 1;
}
.hd-player-hand-label {
  font-size: 10px;
  font-weight: 800;
  color: #fbbf24;
  text-align: center;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  min-height: 13px;
  z-index: 1;
}
.hd-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  text-align: center;
}
.hd-cards {
  display: flex;
  gap: 6px;
  justify-content: center;
  min-height: 76px;
}

/* Cards */
.hd-card {
  border-radius: 6px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  font-family: 'Georgia', serif;
  flex-shrink: 0;
}
/* Player hole cards (larger) */
.hd-cards > .hd-card {
  width: 52px;
  height: 76px;
}
/* AI cards (smaller) */
.hd-ai-card-size {
  width: 30px !important;
  height: 44px !important;
}
.hd-ai-card-size .hd-card-rank { font-size: 9px !important; }
.hd-ai-card-size .hd-card-suit { font-size: 7px !important; }
.hd-ai-card-size .hd-card-center { font-size: 16px !important; }
/* Community cards (medium) */
.hd-comm-slot .hd-card {
  width: 36px;
  height: 54px;
}
.hd-comm-slot .hd-card .hd-card-rank { font-size: 10px; }
.hd-comm-slot .hd-card .hd-card-suit { font-size: 8px; }
.hd-comm-slot .hd-card .hd-card-center { font-size: 18px; }

.hd-card-front {
  background: linear-gradient(145deg, #fff 0%, #f0f0f0 100%);
  border: 1.5px solid rgba(0,0,0,0.15);
}
.hd-card-back {
  background: linear-gradient(145deg, #1e40af, #1e3a8a);
  border: 1.5px solid #3b82f6;
  overflow: hidden;
}
.hd-card-back-pattern {
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 3px,
    rgba(255,255,255,0.04) 3px,
    rgba(255,255,255,0.04) 6px
  );
}
.hd-card-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.hd-card-tl { top: 3px; left: 4px; }
.hd-card-br { bottom: 3px; right: 4px; transform: rotate(180deg); }
.hd-card-rank { font-size: 12px; font-weight: 800; }
.hd-card-suit { font-size: 9px; }
.hd-card-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 22px;
}
.hd-card.hd-card-highlight {
  box-shadow: 0 0 0 2.5px #fbbf24, 0 0 10px rgba(251,191,36,0.55) !important;
  z-index: 3;
}
.hd-card-dealt {
  animation: hd-card-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes hd-card-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.6) rotate(-5deg); }
  to   { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
}

/* Chip bar */
.hd-chip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  flex-shrink: 0;
}
.hd-chip-stack {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hd-chip-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.hd-chip-icon-lg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.hd-chip-count {
  font-size: 20px;
  font-weight: 800;
  color: #10b981;
}
.hd-hand-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Street label */
.hd-street-label {
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 1px 0;
  flex-shrink: 0;
}

/* Betting area */
.hd-bet-area {
  padding: 8px 16px;
  flex-shrink: 0;
}
.hd-bet-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  text-align: center;
  margin-bottom: 6px;
}
.hd-bet-chips {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.hd-bet-chip {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #10b981;
  background: rgba(16,185,129,0.1);
  color: #10b981;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}
.hd-bet-chip:hover {
  background: rgba(16,185,129,0.25);
  border-color: #34d399;
  color: #fff;
}
.hd-bet-chip--active {
  background: rgba(16,185,129,0.35) !important;
  border-color: #34d399 !important;
  color: #fff !important;
  box-shadow: 0 0 0 3px rgba(52,211,153,0.3);
}
.hd-bet-chip:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.hd-bet-selected {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
}
.hd-bet-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* Action buttons */
.hd-actions {
  display: flex;
  gap: 6px;
  padding: 6px 16px;
  flex-shrink: 0;
}
.hd-btn {
  flex: 1;
  padding: 10px 4px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}
.hd-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.hd-btn-primary  { background: #10b981; color: #000; }
.hd-btn-primary:hover:not(:disabled)  { background: #34d399; }
.hd-btn-secondary { background: #374151; color: #fff; }
.hd-btn-secondary:hover:not(:disabled) { background: #4b5563; }
.hd-btn-danger   { background: rgba(239,68,68,0.15); color: #f87171; border: 1.5px solid rgba(239,68,68,0.4); }
.hd-btn-danger:hover:not(:disabled) { background: rgba(239,68,68,0.3); color: #fff; }
.hd-btn-muted    { background: transparent; color: #6b7280; border: 1.5px solid #374151; }
.hd-btn-muted:hover:not(:disabled)  { background: #1f2937; color: #fff; }

/* Raise picker */
.hd-raise-picker {
  display: flex;
  gap: 5px;
  justify-content: center;
  padding: 0 16px 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.hd-raise-opt {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(124,58,237,0.15);
  border: 1.5px solid rgba(124,58,237,0.4);
  color: #c4b5fd;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 58px;
}
.hd-raise-cost {
  font-size: 9px;
  font-weight: 600;
  opacity: 0.7;
  letter-spacing: 0;
}
.hd-raise-opt:hover {
  background: rgba(124,58,237,0.3);
  border-color: #8b5cf6;
  color: #fff;
}

/* Hand result banner */
.hd-hand-result {
  margin: 4px 16px;
  padding: 8px 12px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  animation: hd-fade-in 0.3s ease;
}
.hd-result-win  { background: rgba(16,185,129,0.15); color: #4ade80; border: 1px solid rgba(16,185,129,0.3); }
.hd-result-lose { background: rgba(239,68,68,0.15);  color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.hd-result-push { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.hd-result-fold { background: rgba(107,114,128,0.15); color: #9ca3af; border: 1px solid rgba(107,114,128,0.3); }

/* Final results / broke panel */
.hd-results {
  padding: 6px 16px 16px;
  flex-shrink: 0;
}
.hd-results-inner {
  background: rgba(31,41,55,0.6);
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* AI reveal row in results */
.hd-ai-reveal-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.hd-ai-reveal-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  background: rgba(31,41,55,0.5);
  border-radius: 6px;
}
.hd-ai-reveal-name {
  font-weight: 800;
  font-size: 9px;
  color: #d1d5db;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Hand result dots */
.hd-result-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  background: rgba(31,41,55,0.5);
  border-radius: 8px;
  color: #9ca3af;
  font-size: 11px;
}

/* Winner glow at showdown */
.hd-winner {
  animation: hd-winner-glow 1.2s ease-in-out 2;
}
@keyframes hd-winner-glow {
  0%,100% { filter: drop-shadow(0 0 0px rgba(251,191,36,0)); }
  50%      { filter: drop-shadow(0 0 10px rgba(251,191,36,0.9)); }
}

@keyframes hd-fade-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Reduce table height on short viewports (landscape mobile / small phones) */
@media (max-height: 600px) {
  .hd-table { height: 38vh; }
}

/* Modal responsive */
@media (min-height: 600px) {
  #hd-modal { align-items: center; padding: 1rem; }
  #hd-modal > div { border-radius: 1rem; max-height: 85vh; padding-bottom: 1.25rem; }
}

/* Guide modal - hand rankings */
.hd-guide-hand {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.hd-guide-hand-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}
.hd-guide-rank-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(124,58,237,0.3);
  border: 1px solid rgba(124,58,237,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #c4b5fd;
  flex-shrink: 0;
}
.hd-guide-hand-name {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}
.hd-guide-cards-row {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
/* Mini card chips used in guide */
.hd-mc {
  background: #f1f5f9;
  color: #1e293b;
  border-radius: 3px;
  padding: 2px 4px;
  font-size: 9px;
  font-weight: 800;
  font-family: Georgia, serif;
  white-space: nowrap;
  display: inline-block;
  line-height: 1.3;
  border: 1px solid rgba(0,0,0,0.12);
}
.hd-mc.r { color: #dc2626; }
.hd-guide-hand-desc {
  font-size: 10px;
  color: #9ca3af;
  line-height: 1.4;
  margin: 0;
}

/* Madelyn chat bubble */
.hd-chat-bubble {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #111;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 10px;
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
  animation: hd-bubble-in 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
}
.hd-chat-bubble::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: #fff;
}
.hd-chat-bubble-out {
  animation: hd-bubble-out 0.25s ease-in both;
}
@keyframes hd-bubble-in {
  from { opacity: 0; transform: translateX(-50%) scale(0.7); }
  to   { opacity: 1; transform: translateX(-50%) scale(1); }
}
@keyframes hd-bubble-out {
  from { opacity: 1; transform: translateX(-50%) scale(1); }
  to   { opacity: 0; transform: translateX(-50%) scale(0.7); }
}
