:root {
  --bg-dark: #090e1a;
  --bg-gradient: linear-gradient(135deg, #090e1a 0%, #15243e 50%, #0b1326 100%);
  --panel-bg: rgba(18, 29, 50, 0.75);
  --panel-elevated: rgba(26, 41, 71, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-focus: #3b82f6;
  --gold-primary: #f59e0b;
  --gold-glow: #fbbf24;
  --emerald: #10b981;
  --crimson: #ef4444;
  --violet: #8b5cf6;
  --blue-neon: #38bdf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 14, 26, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
}

.bar {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--gold-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.spacer { flex: 1; }

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--panel-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.user-badge strong { color: #fff; }

.wallet-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--gold-glow);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.15);
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  padding: 0 20px 10px;
  overflow-x: auto;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav a:hover, .nav a.active {
  color: #fff;
  background: var(--panel-elevated);
  border: 1px solid var(--border-subtle);
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* Glass Panels */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.sub-panel {
  background: rgba(11, 19, 34, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 16px 0;
}

/* Hero */
.hero {
  background: var(--panel-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  margin-bottom: 32px;
  text-align: center;
  backdrop-filter: blur(16px);
}

.hero h1 {
  font-size: 2.3rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.hero p {
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
}

/* Game Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.card {
  background: var(--panel-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  backdrop-filter: blur(12px);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.card-tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  background: var(--panel-elevated);
  color: var(--text-muted);
}
.card-tag.live {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.card-tag.instant {
  background: rgba(245, 158, 11, 0.2);
  color: var(--gold-primary);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.card h3 { font-size: 1.25rem; font-weight: 800; margin-bottom: 6px; }
.card p { font-size: 0.88rem; color: var(--text-muted); flex: 1; margin-bottom: 18px; }

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 0;
  cursor: pointer;
  background: var(--gold-primary);
  color: #0b1220;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn:hover:not(:disabled) {
  background: #d97706;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.3);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.secondary {
  background: var(--panel-elevated);
  border: 1px solid var(--border-subtle);
  color: #fff;
}
.btn.secondary:hover:not(:disabled) { background: rgba(35, 54, 94, 0.9); }

.btn.success {
  background: var(--emerald);
  color: #032514;
}

.btn.danger { background: var(--crimson); color: #fff; }

.input {
  background: rgba(9, 14, 26, 0.85);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.input:focus { border-color: var(--border-focus); }

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

/* Results & Feedback */
.result {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  background: rgba(9, 14, 26, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 18px 0;
  padding: 16px;
  text-align: center;
}
.result.win {
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
}
.result.loss {
  color: var(--crimson);
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
}

.notice {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--panel-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 14px;
}
.notice.ok {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--emerald);
}
.notice.err {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--crimson);
}

.muted { color: var(--text-muted); font-size: 0.88rem; }
.hidden { display: none !important; }

/* 3D COIN TOSS GRAPHICS */
.coin-wrap {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 900px;
  position: relative;
  margin: 16px 0;
}
.coin {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.5s cubic-bezier(.2,.8,.2,1);
}
.face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  backface-visibility: hidden;
  border: 6px solid #f4bd3d;
  background: radial-gradient(circle at 35% 30%, #ffe99a, #e9a915 65%, #b87500);
  color: #6b4200;
  box-shadow: inset 0 0 0 4px #ffd965, 0 10px 25px rgba(0, 0, 0, 0.4);
}
.tails { transform: rotateY(180deg); }

@keyframes tossCoin {
  0% { transform: translateY(0) rotateY(0deg) scale(1); }
  12% { transform: translateY(-45px) rotateY(180deg) scale(1.02); }
  30% { transform: translateY(-125px) rotateY(540deg) scale(1.05); }
  50% { transform: translateY(-165px) rotateY(900deg) scale(1.08); }
  68% { transform: translateY(-120px) rotateY(1260deg) scale(1.05); }
  84% { transform: translateY(-48px) rotateY(1620deg) scale(1.02); }
  94% { transform: translateY(7px) rotateY(1800deg) scale(.98); }
  100% { transform: translateY(0) rotateY(1980deg) scale(1); }
}
.tossing { animation: tossCoin 1.6s cubic-bezier(.18, .72, .25, 1) forwards; }

.coin-wrap .hand {
  position: absolute;
  left: 50%;
  bottom: 0px;
  transform: translateX(-50%);
  width: 100px;
  height: 58px;
  pointer-events: none;
  opacity: 0;
}
.coin-wrap .hand:before {
  content: "";
  position: absolute;
  left: 10px;
  bottom: 0;
  width: 80px;
  height: 42px;
  border-radius: 40px 40px 15px 15px;
  background: #d99a72;
  box-shadow: inset 0 -4px 0 #bd7954;
}
.coin-wrap .hand:after {
  content: "";
  position: absolute;
  left: 36px;
  bottom: 28px;
  width: 30px;
  height: 42px;
  border-radius: 18px;
  background: #e2a27b;
  transform: rotate(-18deg);
}
.coin-wrap .hand.show { opacity: 1; animation: handToss 1.6s ease forwards; }
@keyframes handToss {
  0% { transform: translateX(-50%) translateY(0); opacity: 1; }
  15% { transform: translateX(-50%) translateY(5px); opacity: 1; }
  30% { transform: translateX(-50%) translateY(15px); opacity: .9; }
  45%, 100% { transform: translateX(-50%) translateY(35px); opacity: 0; }
}

/* TIC TAC TOE */
.board {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  gap: 12px;
  justify-content: center;
  margin: 20px auto;
}
.cell {
  width: 100px;
  height: 100px;
  background: var(--panel-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 3rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}
.cell:hover:not(:disabled) {
  background: rgba(40, 62, 105, 0.9);
  transform: scale(1.03);
}
.cell.x { color: var(--blue-neon); }
.cell.o { color: var(--crimson); }
.cell.win {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--emerald);
}

/* Playing Cards */
.cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
  justify-content: center;
}

/* ========================================================
   LUXURY CASINO FELT TABLE & CARD SIMULATION STYLES
   ======================================================== */
.felt-table {
  background: radial-gradient(ellipse at center, #065f46 0%, #064e3b 45%, #022c22 100%);
  border: 8px solid #1c1917;
  border-radius: 28px;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8), 0 20px 40px rgba(0, 0, 0, 0.6);
  outline: 2px solid rgba(217, 119, 6, 0.5);
  padding: 24px;
  position: relative;
  overflow: hidden;
  margin: 18px 0;
}

.felt-table::before {
  content: '👑 ROYALPLAY CASINO';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.04);
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}

/* Individual Professional Casino Block Card */
.playing {
  width: 66px;
  height: 96px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  font-weight: 900;
  font-size: 1.15rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.38), inset 0 0 4px rgba(255, 255, 255, 0.8);
  user-select: none;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
  box-sizing: border-box;
}

.playing:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.playing.red {
  color: #dc2626;
}

.playing.black {
  color: #0f172a;
}

.playing .card-corner-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}

.playing .card-corner-top .crank {
  font-size: 0.95rem;
  font-weight: 900;
}

.playing .card-corner-top .csuit {
  font-size: 0.85rem;
  margin-top: 1px;
}

.playing .card-center-suit {
  align-self: center;
  font-size: 1.7rem;
  line-height: 1;
  opacity: 0.92;
}

.playing .card-corner-bottom {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
  transform: rotate(180deg);
}

.playing .card-corner-bottom .crank {
  font-size: 0.95rem;
  font-weight: 900;
}

.playing .card-corner-bottom .csuit {
  font-size: 0.85rem;
  margin-top: 1px;
}

/* Authentic Red Casino Card Back (Junglee / Royal Rummy Style) */
.playing.card-back, .shuffler-deck, .card-back-red {
  background: radial-gradient(circle at 50% 50%, #dc2626 0%, #b91c1c 45%, #7f1d1d 100%) !important;
  border: 2px solid #fecaca !important;
  border-radius: 10px !important;
  color: #fef08a !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), inset 0 0 0 2px #7f1d1d, inset 0 0 0 4px rgba(254, 240, 138, 0.4) !important;
  position: relative !important;
  overflow: hidden !important;
}

.playing.card-back::before, .shuffler-deck::before, .card-back-red::before {
  content: "" !important;
  position: absolute !important;
  inset: 4px !important;
  border: 1px dashed rgba(254, 240, 138, 0.55) !important;
  border-radius: 6px !important;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.06) 0, rgba(255,255,255,0.06) 4px, transparent 4px, transparent 8px) !important;
  pointer-events: none !important;
}

.playing.card-back::after, .shuffler-deck::after, .card-back-red::after {
  content: "👑" !important;
  font-size: 1.45rem !important;
  color: #fef08a !important;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8) !important;
  position: relative !important;
  z-index: 2 !important;
}

/* 3D Realistic Riffle Shuffling (From Video 00:00 - 00:02) */
.shuffler-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 140px;
  margin: 10px 0;
  perspective: 900px;
}

.shuffler-decks-wrap {
  position: relative;
  width: 240px;
  height: 98px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.shuffler-deck {
  width: 66px;
  height: 96px;
  position: absolute;
  top: 0;
  transition: all 0.3s ease;
}

.shuffler-deck.deck-left {
  left: 25px;
  transform: rotate(-10deg);
  box-shadow: -5px 8px 18px rgba(0,0,0,0.6);
}

.shuffler-deck.deck-right {
  right: 25px;
  transform: rotate(10deg);
  box-shadow: 5px 8px 18px rgba(0,0,0,0.6);
}

@keyframes realisticRiffleLeft {
  0% { transform: translateX(0) rotate(-10deg); }
  20% { transform: translateX(-45px) rotate(-20deg) scale(0.94); }
  40% { transform: translateX(-65px) rotate(-26deg) scale(0.91); }
  55% { transform: translateX(-15px) rotate(-8deg) scale(1.05); }
  70% { transform: translateX(25px) rotate(-2deg) scale(0.98); }
  85% { transform: translateX(-5px) rotate(-5deg); }
  100% { transform: translateX(0) rotate(-10deg); }
}

@keyframes realisticRiffleRight {
  0% { transform: translateX(0) rotate(10deg); }
  20% { transform: translateX(45px) rotate(20deg) scale(0.94); }
  40% { transform: translateX(65px) rotate(26deg) scale(0.91); }
  55% { transform: translateX(15px) rotate(8deg) scale(1.05); }
  70% { transform: translateX(-25px) rotate(2deg) scale(0.98); }
  85% { transform: translateX(5px) rotate(5deg); }
  100% { transform: translateX(0) rotate(10deg); }
}

.shuffler-box.shuffling .deck-left {
  animation: realisticRiffleLeft 0.72s ease-in-out infinite;
}

.shuffler-box.shuffling .deck-right {
  animation: realisticRiffleRight 0.72s ease-in-out infinite;
}

/* "Shuffle powered by RNG" Badge from Video */
.rng-shuffle-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(9, 14, 26, 0.88);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #f1f5f9;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  margin-top: 14px;
  letter-spacing: 0.4px;
}

.rng-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981, 0 0 16px #10b981;
  animation: pulseRng 1.2s infinite ease-in-out;
}

@keyframes pulseRng {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Center Table Card Shoe (Closed Deck, Cut Joker, Open Deck, Finish Slot) */
.rummy-shoe-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  margin: 12px 0 18px;
  flex-wrap: wrap;
}

/* Closed Deck with 3D stacked depth */
.closed-deck-stack {
  position: relative;
  width: 68px;
  height: 98px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.closed-deck-stack:hover {
  transform: translateY(-4px) scale(1.03);
}

.closed-deck-stack .playing.card-back {
  box-shadow: 2px 2px 0 #7f1d1d, 4px 4px 0 #991b1b, 6px 6px 0 #450a0a, 0 12px 22px rgba(0,0,0,0.6) !important;
}

/* Wild Joker tucked horizontally under the closed deck */
.wild-joker-under {
  position: absolute;
  left: -22px;
  bottom: -4px;
  transform: rotate(-90deg) scale(0.88);
  transform-origin: center;
  z-index: 1;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Open Deck Discard Tray */
.open-deck-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
}

.open-deck-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.75);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Finish Slot from Video */
.finish-slot-box {
  width: 68px;
  height: 98px;
  border: 2px dashed rgba(52, 211, 153, 0.5);
  border-radius: 10px;
  background: rgba(6, 78, 59, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.4);
}

.finish-slot-box:hover {
  border-color: #34d399;
  background: rgba(6, 78, 59, 0.6);
  transform: translateY(-2px);
}

.finish-slot-box .finish-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: #6ee7b7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

/* Seamless Natural Table Rummy Melds (NO BOXES / NO BLOCKS - Cards Sit Directly on Felt) */
.rummy-melds-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
  width: 100%;
}

.rummy-meld-slot {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-shadow: none !important;
  outline: none !important;
  min-width: auto !important;
  flex: none !important;
}

.rummy-meld-slot.valid {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.rummy-meld-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding-left: 4px;
}

/* Points badge above each group (e.g. 29 Points, 9 Pts.) */
.meld-points-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: #fde047;
  background: rgba(15, 23, 42, 0.85);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(253, 224, 71, 0.3);
}

.meld-status-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.4px;
}

/* Fanned overlapping cards in hand */
.rummy-card-group {
  display: flex;
  align-items: center;
  min-height: 104px;
  padding-top: 12px;
  padding-bottom: 4px;
  overflow: visible;
}

.rummy-card-group .playing {
  margin-right: -24px;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s;
  cursor: pointer;
  user-select: none;
}

.rummy-card-group .playing:last-child {
  margin-right: 0;
}

.rummy-card-group .playing:hover {
  transform: translateY(-8px);
  z-index: 5;
}

/* Laptop Click-To-Throw Hover Enhancement */
.rummy-melds-container.can-throw .playing {
  cursor: pointer !important;
  position: relative;
}

.rummy-melds-container.can-throw .playing:hover {
  transform: translateY(-26px) scale(1.08) !important;
  box-shadow: 0 16px 30px rgba(220, 38, 38, 0.7), 0 0 16px rgba(251, 191, 36, 0.95) !important;
  border: 2px solid #f59e0b !important;
  z-index: 25 !important;
}

.rummy-melds-container.can-throw .playing:hover::after {
  content: "THROW 🗑️";
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
  pointer-events: none;
  letter-spacing: 0.5px;
}


/* Elevated Selected Card */
.rummy-card-group .playing.card-lifted {
  transform: translateY(-22px) scale(1.05) !important;
  z-index: 10 !important;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.7), 0 0 16px rgba(251, 191, 36, 0.9) !important;
  border: 2px solid #fbbf24 !important;
}

/* Joker Clown Badge on Wild Joker Cards */
.card-joker-tag {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: #f59e0b;
  color: #000;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* Circular Turn Timer Ring (Sample Video around Avatar) */
.turn-avatar-wrap {
  position: relative;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.turn-timer-svg {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 58px;
  height: 58px;
  transform: rotate(-90deg);
  pointer-events: none;
}

.turn-timer-circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 4;
}

.turn-timer-circle-progress {
  fill: none;
  stroke: #10b981;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 160;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.25s linear, stroke 0.3s;
}

.turn-timer-circle-progress.warning {
  stroke: #f59e0b;
}

.turn-timer-circle-progress.danger {
  stroke: #ef4444;
}

/* Live Discard In-Table Toast Banner (Sample Video 00:20) */
.rummy-toast {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  animation: toastFadeIn 0.3s ease-out;
  margin: 6px auto;
}

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

@keyframes dealSlideIn {
  0% {
    opacity: 0;
    transform: perspective(800px) translate3d(0, -55px, 60px) rotate(-12deg) scale(0.7);
  }
  70% {
    transform: perspective(800px) translate3d(0, 4px, 0px) rotate(2deg) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: perspective(800px) translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
}

@keyframes cardFlip3D {
  0% {
    transform: perspective(700px) rotateY(90deg) scale(0.92);
    opacity: 0.2;
  }
  50% {
    transform: perspective(700px) rotateY(45deg) scale(1.06);
    box-shadow: 0 14px 28px rgba(245, 158, 11, 0.45);
  }
  100% {
    transform: perspective(700px) rotateY(0deg) scale(1);
    opacity: 1;
  }
}

@keyframes cardWinGlow {
  0%, 100% {
    transform: scale(1.06);
    box-shadow: 0 0 18px #fbbf24, 0 0 35px rgba(251, 191, 36, 0.7);
    border: 2px solid #fbbf24;
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 0 26px #f59e0b, 0 0 50px rgba(245, 158, 11, 0.95);
    border: 2px solid #ffffff;
  }
}

@keyframes cardDrawIn {
  0% {
    opacity: 0;
    transform: translateY(-40px) scale(0.6) rotate(8deg);
  }
  60% {
    transform: translateY(6px) scale(1.05) rotate(-2deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes potBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.22); box-shadow: 0 0 25px #fbbf24, 0 0 45px rgba(245, 158, 11, 0.85); }
  100% { transform: scale(1); }
}

.pot-pulse-active {
  animation: potBump 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

/* Flying Gold Poker Chip Element */
.flying-chip-coin {
  position: fixed;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffbeb, #f59e0b 60%, #b45309 100%);
  border: 2px dashed #ffffff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.65), 0 0 14px rgba(245, 158, 11, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: #78350f;
  pointer-events: none;
  z-index: 999999;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s ease;
}

@keyframes cardSheenSweep {
  0% { transform: translateX(-120%) rotate(30deg); opacity: 0; }
  30% { opacity: 0.7; }
  100% { transform: translateX(180%) rotate(30deg); opacity: 0; }
}

.card-sheen-effect {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  pointer-events: none;
  animation: cardSheenSweep 0.65s ease-out forwards;
}

.playing.anim-deal {
  animation: dealSlideIn 0.38s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
}

.playing.anim-flip {
  animation: cardFlip3D 0.45s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
}

.playing.anim-draw {
  animation: cardDrawIn 0.35s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
}

.playing.anim-win {
  animation: cardWinGlow 1.2s infinite ease-in-out;
  z-index: 15 !important;
}

/* Choice buttons */
.choices {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.choice {
  padding: 10px 18px;
  background: var(--panel-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.choice:hover { color: #fff; border-color: var(--border-focus); }
.choice.selected {
  background: rgba(245, 158, 11, 0.2);
  color: var(--gold-primary);
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 0.88rem;
}
.table th, .table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}
.table th {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* ==============================================================
   NUMBER COLOR GRAPHICS
   ============================================================== */
.nc-wallet-card {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 60%, #1e40af 100%);
  border-radius: var(--radius-md);
  padding: 24px;
  color: #fff;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
  margin-bottom: 22px;
}
.nc-wallet-title {
  font-size: 1.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nc-wallet-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.nc-chip {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nc-chip:hover, .nc-chip.active {
  background: #fff;
  color: #1e3a8a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nc-bet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0;
}
.nc-bet-btn {
  border: 0;
  border-radius: var(--radius-md);
  padding: 18px 10px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.nc-bet-btn:hover {
  transform: translateY(-3px);
  filter: brightness(1.1);
}
.nc-bet-btn.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.nc-bet-btn.violet { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.nc-bet-btn.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.nc-bet-btn.selected {
  outline: 4px solid #fff;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
}

.nc-number-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 18px 0;
}
.nc-num-btn {
  height: 64px;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.nc-num-btn:hover {
  transform: scale(1.05);
  filter: brightness(1.12);
}
.nc-num-btn.green { background: #22c55e; }
.nc-num-btn.red { background: #ef4444; }
.nc-num-btn.zero {
  background: linear-gradient(135deg, #a855f7 0%, #a855f7 50%, #ef4444 50%, #ef4444 100%);
}
.nc-num-btn.five {
  background: linear-gradient(135deg, #a855f7 0%, #a855f7 50%, #22c55e 50%, #22c55e 100%);
}
.nc-num-btn.selected {
  outline: 4px solid #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-block;
}
.dot.green { background: #22c55e; }
.dot.red { background: #ef4444; }
.dot.violet { background: #a855f7; }

/* ==============================================================
   LUCKY ROOMS 100-BLOCK GRID & LOTTERY GRAPHICS
   ============================================================== */
.lucky-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 18px 0;
}
.lucky-room-card {
  background: linear-gradient(145deg, rgba(26, 41, 71, 0.9), rgba(15, 24, 43, 0.95));
  border: 2px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.lucky-room-card:hover, .lucky-room-card.selected {
  border-color: var(--gold-primary);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.25);
  transform: translateY(-3px);
}
.lucky-room-card.selected:before {
  content: "ACTIVE DRAW";
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: var(--gold-primary);
  color: #000;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.lottery-sphere-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  margin: 10px 0;
  perspective: 800px;
}
.lottery-ball {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7d6, #eab308 55%, #854d0e 90%);
  color: #451a03;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: 900;
  box-shadow: inset -6px -6px 14px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(234, 179, 8, 0.35);
  border: 4px solid #fef08a;
  transition: transform 0.6s ease;
}
.lottery-ball.rolling {
  animation: rollBall 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes rollBall {
  0% { transform: scale(0.6) rotate(0deg); opacity: 0.5; }
  50% { transform: scale(1.15) rotate(360deg); }
  100% { transform: scale(1) rotate(720deg); opacity: 1; }
}

/* 100 BLOCKS GRID (00 to 99) */
.lucky-100-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
  padding: 12px;
  background: rgba(9, 14, 26, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 16px 0;
}
.lucky-block {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s ease, box-shadow 0.2s ease, border-color 0.15s ease;
  user-select: none;
  overflow: hidden;
}
.lucky-block:hover {
  background: rgba(59, 130, 246, 0.35);
  color: #fff;
  border-color: #60a5fa;
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
  z-index: 2;
}
.lucky-block.selected {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: #090e1a;
  border-color: #fff;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.75), inset 0 0 8px rgba(255,255,255,0.6);
  transform: scale(1.14);
  font-weight: 900;
  animation: numberSelectPop 0.25s ease-out;
  z-index: 5;
}
.lucky-block.locked {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border-color: #6ee7b7 !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.8), inset 0 0 8px rgba(255,255,255,0.4) !important;
  transform: scale(1.12);
  animation: lockPulse 1.8s infinite alternate ease-in-out;
  z-index: 4;
}
.lucky-block.other-locked {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}
.lucky-block.other-locked::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  background: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 6px #38bdf8;
}
.lucky-block.scanning {
  background: rgba(251, 191, 36, 0.35) !important;
  border-color: #fbbf24 !important;
  color: #fff !important;
  transform: scale(1.08);
  transition: all 0.08s ease;
}
.lucky-block.anim-win {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%) !important;
  color: #0f172a !important;
  border-color: #fff !important;
  box-shadow: 0 0 35px rgba(251, 191, 36, 1), 0 0 60px rgba(245, 158, 11, 0.7) !important;
  transform: scale(1.28) !important;
  font-size: 1.05rem !important;
  font-weight: 900 !important;
  animation: luckyWinBlast 0.6s infinite alternate ease-in-out;
  z-index: 10;
}

@keyframes numberSelectPop {
  0% { transform: scale(0.9); }
  60% { transform: scale(1.22); }
  100% { transform: scale(1.14); }
}

@keyframes lockPulse {
  0% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.5); }
  100% { box-shadow: 0 0 24px rgba(16, 185, 129, 0.95); transform: scale(1.15); }
}

@keyframes luckyWinBlast {
  0% { transform: scale(1.2); box-shadow: 0 0 25px #fbbf24; }
  100% { transform: scale(1.32); box-shadow: 0 0 45px #f59e0b, 0 0 70px #ef4444; }
}

@keyframes ballHyperSpin {
  0% { transform: rotate(0deg) scale(1); filter: hue-rotate(0deg); }
  50% { transform: rotate(180deg) scale(1.12); filter: hue-rotate(90deg); }
  100% { transform: rotate(360deg) scale(1); filter: hue-rotate(180deg); }
}

.quick-pick-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: 0;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.quick-pick-btn:hover { filter: brightness(1.15); }

/* ==============================================================
   COMPREHENSIVE MOBILE RESPONSIVE ENGINE (SMARTPHONES & TABLETS)
   ============================================================== */
@media (max-width: 768px) {
  .bar {
    padding: 10px 14px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 1.15rem;
  }
  .user-badge, .wallet-badge {
    padding: 4px 10px;
    font-size: 0.78rem;
  }
  .nav {
    padding: 0 12px 10px;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav a {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
  .wrap {
    padding: 14px 12px 40px;
  }
  .panel {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }
  .hero {
    padding: 24px 16px;
    margin-bottom: 20px;
  }
  .hero h1 {
    font-size: 1.6rem;
  }
  .hero p {
    font-size: 0.88rem;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .card {
    padding: 18px;
  }
  .playing {
    width: 48px;
    height: 70px;
    font-size: 1rem;
  }
  .cards {
    gap: 6px;
  }
  .aviator-screen {
    height: 240px;
  }
  #aviatorCanvas {
    height: 240px;
  }
  .sub-panel .row {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }
  .sub-panel .row > div {
    width: 100%;
  }
  .sub-panel .row > div input {
    width: 100% !important;
  }
  #betBtn, #cashoutBtn {
    width: 100% !important;
  }
  .board {
    grid-template-columns: repeat(3, 80px);
  }
  .cell {
    width: 80px;
    height: 80px;
    font-size: 2.2rem;
  }
  .coin {
    width: 110px;
    height: 110px;
  }
  .nc-number-grid {
    gap: 8px;
  }
  .nc-num-btn {
    height: 50px;
    font-size: 1.25rem;
  }
  .nc-bet-grid {
    gap: 8px;
  }
  .nc-bet-btn {
    font-size: 0.95rem;
    padding: 14px 6px;
  }
  .lucky-100-grid {
    grid-template-columns: repeat(5, 1fr);
    max-height: 300px;
  }
  .lucky-block {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .bar {
    padding: 8px 10px;
  }
  .brand {
    font-size: 1.05rem;
  }
  .user-badge {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .wallet-badge {
    padding: 4px 8px;
    font-size: 0.85rem;
  }
  .hero h1 {
    font-size: 1.35rem;
  }
  .board {
    grid-template-columns: repeat(3, 72px);
    gap: 8px;
  }
  .cell {
    width: 72px;
    height: 72px;
    font-size: 1.9rem;
  }
  .coin {
    width: 95px;
    height: 95px;
  }
  .coin-wrap {
    height: 150px;
  }
  .playing {
    width: 40px;
    height: 60px;
    font-size: 0.82rem;
  }
  .shot-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .shot-btn {
    padding: 10px 6px;
  }
  .over-balls {
    gap: 4px;
  }
  .ball-dot {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
  .modal-card {
    padding: 18px 14px;
  }
}

/* MODAL STYLES */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}
.modal-overlay.active { display: flex; }
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.7);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: #fff; }

/* ========================================================
   FATAKA BLAST (FIRECRACKER CELEBRATION WIN ANIMATION)
   ======================================================== */
#fataka-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#fataka-overlay.active {
  display: flex;
}

#fataka-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.fataka-banner-wrap {
  position: relative;
  z-index: 10;
  text-align: center;
  pointer-events: none;
  animation: fatakaBannerEntry 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.fataka-banner {
  display: inline-block;
  background: radial-gradient(circle at center, rgba(30, 27, 75, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 2px solid #fbbf24;
  border-radius: 20px;
  padding: 18px 36px;
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.85), 0 0 100px rgba(239, 68, 68, 0.6), inset 0 0 20px rgba(251, 191, 36, 0.4);
  color: #fff;
  position: relative;
}

.fataka-banner::before {
  content: '';
  position: absolute;
  inset: -10px;
  border: 2px dashed rgba(251, 191, 36, 0.6);
  border-radius: 26px;
  animation: fatakaGlowRing 3s linear infinite;
  pointer-events: none;
}

.fataka-title {
  font-size: 1.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #fef08a 0%, #f59e0b 50%, #ef4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.6));
  margin-bottom: 4px;
}

.fataka-payout {
  font-size: 2.4rem;
  font-weight: 900;
  color: #34d399;
  text-shadow: 0 0 25px rgba(52, 211, 153, 0.85), 0 2px 6px rgba(0,0,0,0.9);
  font-variant-numeric: tabular-nums;
}

.fataka-sub {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fde047;
  letter-spacing: 1px;
  margin-top: 4px;
  text-transform: uppercase;
}

@keyframes fatakaBannerEntry {
  0% { transform: scale(0.3) translateY(60px); opacity: 0; filter: blur(10px); }
  65% { transform: scale(1.12) translateY(-10px); opacity: 1; filter: blur(0); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes fatakaGlowRing {
  0% { transform: rotate(0deg) scale(0.98); opacity: 0.7; }
  50% { transform: rotate(180deg) scale(1.02); opacity: 1; }
  100% { transform: rotate(360deg) scale(0.98); opacity: 0.7; }
}

/* Card Selection & Left/Right Movement Toolbar */
.card-nav-controls {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 50;
  pointer-events: auto;
  white-space: nowrap;
}

.card-nav-btn {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #f59e0b;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  user-select: none;
}

.card-nav-btn:hover {
  background: #f59e0b;
  color: #000;
  transform: scale(1.08);
}

.card-nav-btn.throw-btn {
  background: #dc2626;
  border-color: #ef4444;
}

.card-nav-btn.throw-btn:hover {
  background: #b91c1c;
  color: #fff;
}

/* Slot target highlight when a card is selected */
.rummy-meld-slot.selectable-target {
  cursor: pointer;
  position: relative;
  border-radius: 8px;
}

.rummy-meld-slot.selectable-target:hover {
  background: rgba(16, 185, 129, 0.15) !important;
  outline: 1.5px dashed rgba(52, 211, 153, 0.6) !important;
}

.rummy-meld-slot.selectable-target:hover::after {
  content: "Move card here ⬇️";
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 78, 59, 0.95);
  color: #a7f3d0;
  border: 1px solid #34d399;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 30;
}

/* ========================================================
   RUMMY MOBILE OPTIMIZATIONS (LARGE CARDS & LANDSCAPE FIT)
   ======================================================== */

/* 1. Mobile Portrait Viewport (< 650px): Keep Cards Large & Legible */
@media (max-width: 650px) and (orientation: portrait) {
  .rummy-page .felt-table {
    padding: 10px 8px 14px !important;
    border-radius: 16px !important;
    border-width: 4px !important;
  }

  /* Make cards large, clear, and easy to read/tap */
  .rummy-page .playing,
  .rummy-page .rummy-card-group .playing {
    width: 52px !important;
    height: 78px !important;
    font-size: 1.1rem !important;
    margin-right: -24px !important;
  }

  .rummy-page .playing .crank {
    font-size: 0.85rem !important;
    font-weight: 900 !important;
  }

  .rummy-page .playing .csuit {
    font-size: 0.82rem !important;
  }

  .rummy-page .playing .card-center-suit {
    font-size: 1.3rem !important;
  }

  /* Smooth horizontal scroll across all 4 groups */
  .rummy-page .rummy-melds-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    justify-content: flex-start !important;
    padding: 4px 6px 14px !important;
    gap: 14px !important;
    scrollbar-width: none !important;
    scroll-snap-type: x proximity;
  }

  .rummy-page .rummy-melds-container::-webkit-scrollbar {
    display: none;
  }

  .rummy-page .rummy-meld-slot {
    scroll-snap-align: start;
    flex-shrink: 0 !important;
  }
}

/* 2. Mobile Landscape Viewport (< 550px height) & Fullscreen Mode */
@media (orientation: landscape) and (max-height: 550px), (max-height: 480px) {
  body.rummy-page {
    overflow: hidden !important;
  }

  .rummy-page header.top,
  .rummy-page .gamehead,
  .rummy-page .panel:not(.in-table-panel) {
    display: none !important;
  }

  .rummy-page .wrap {
    padding: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  /* Expand felt table to 100% viewport fit - ZERO VERTICAL SCROLL */
  .rummy-page .felt-table {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    outline: none !important;
    margin: 0 !important;
    padding: 4px 10px 6px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    z-index: 9999 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .rummy-page .rummy-table-top-bar {
    margin-bottom: 2px !important;
    padding: 2px 8px !important;
    font-size: 0.72rem !important;
    height: 26px !important;
  }

  #oppRummyBox {
    margin-bottom: 2px !important;
    padding: 2px 8px !important;
    height: 32px !important;
    border-radius: 8px !important;
  }

  #oppRummyBox .turn-avatar-wrap {
    width: 28px !important;
    height: 28px !important;
  }

  #oppRummyBox .turn-avatar-wrap .turn-timer-svg {
    width: 32px !important;
    height: 32px !important;
  }

  #oppRummyBox .playing.card-back {
    width: 20px !important;
    height: 28px !important;
  }

  /* Center shoe scaled compactly */
  .rummy-shoe-row {
    margin: 2px 0 !important;
    gap: 16px !important;
    transform: scale(0.8);
    transform-origin: center;
  }

  /* Cards in hand fit perfectly without scroll */
  .rummy-page .rummy-melds-container {
    display: flex !important;
    justify-content: center !important;
    align-items: flex-end !important;
    gap: 10px !important;
    margin-top: 0 !important;
    padding: 0 !important;
    flex-wrap: nowrap !important;
  }

  .rummy-page .playing,
  .rummy-page .rummy-card-group .playing {
    width: 44px !important;
    height: 66px !important;
    margin-right: -18px !important;
    font-size: 0.95rem !important;
  }

  .rummy-page .playing .crank {
    font-size: 0.78rem !important;
  }

  .rummy-page .playing .csuit {
    font-size: 0.75rem !important;
  }

  .rummy-page .playing .card-center-suit {
    font-size: 1rem !important;
  }

  .rummy-page .meld-points-badge {
    font-size: 0.68rem !important;
    padding: 1px 5px !important;
  }

  .rummy-page .meld-status-badge {
    font-size: 0.62rem !important;
  }

  .rummy-page .rummy-btn-bar {
    margin-top: 2px !important;
    gap: 6px !important;
    padding: 0 !important;
  }

  .rummy-page .rummy-btn-bar .btn {
    padding: 4px 10px !important;
    font-size: 0.75rem !important;
    height: 30px !important;
  }

  .rummy-page .turn-avatar-wrap {
    width: 32px !important;
    height: 32px !important;
  }

  .rummy-page .turn-avatar-wrap .turn-timer-svg {
    width: 38px !important;
    height: 38px !important;
  }
}

/* Fallback for Fullscreen class on iOS Safari */
body.rummy-fullscreen-mode header.top,
body.rummy-fullscreen-mode .gamehead,
body.rummy-fullscreen-mode .panel:not(.in-table-panel) {
  display: none !important;
}

body.rummy-fullscreen-mode .wrap {
  padding: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
}

body.rummy-fullscreen-mode .felt-table {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  border-radius: 0 !important;
  border: none !important;
  outline: none !important;
  margin: 0 !important;
  padding: 4px 10px 6px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  z-index: 9999 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* 4-Player AI Table Bar */
.rummy-ai-players-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  width: 100%;
}

.ai-player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 12px;
  flex: 1;
  transition: all 0.3s ease;
  position: relative;
}

.ai-player-card.active-turn {
  border-color: #f59e0b;
  background: rgba(30, 41, 59, 0.95);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.45);
  transform: translateY(-2px);
}

.ai-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

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

.ai-name {
  font-size: 0.84rem;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-status {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
}

.ai-player-card.active-turn .ai-status {
  color: #34d399;
}

/* Round Result Modal */
.rummy-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.rummy-modal-card {
  background: radial-gradient(ellipse at top, #1e293b, #0f172a);
  border: 2px solid #f59e0b;
  border-radius: 20px;
  max-width: 640px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 30px rgba(245, 158, 11, 0.35);
  color: #fff;
  text-align: center;
  animation: modalScaleIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.rummy-result-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.85rem;
}

.rummy-result-table th, .rummy-result-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rummy-result-table th {
  color: #94a3b8;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.72rem;
}

/* Landscape adjustment for 4-Player AI bar */
@media (orientation: landscape) and (max-height: 550px) {
  .rummy-ai-players-bar {
    gap: 6px !important;
    margin-bottom: 2px !important;
  }
  .ai-player-card {
    padding: 2px 8px !important;
    height: 32px !important;
    border-radius: 8px !important;
  }
  .ai-avatar {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.8rem !important;
  }
  .ai-name {
    font-size: 0.75rem !important;
  }
  .ai-status {
    font-size: 0.65rem !important;
  }
}

/* ==========================================================================
   24-HOUR BROADCAST NOTICE, MOVING MARQUEE, AND PUSH NOTIFICATIONS
   ========================================================================== */

/* Top Marquee Ticker */
.marquee-ticker-wrap {
  background: linear-gradient(90deg, #1e1b4b 0%, #311042 50%, #1e1b4b 100%);
  border-top: 1px solid rgba(251, 191, 36, 0.35);
  border-bottom: 1px solid rgba(168, 85, 247, 0.45);
  height: 42px;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 85;
}
.marquee-tag {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #050711;
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 0.8px;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
  z-index: 2;
  white-space: nowrap;
}
.marquee-track {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  display: flex;
  align-items: center;
}
.marquee-content {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  font-weight: 700;
  font-size: 0.95rem;
  color: #f8fafc;
  animation: marqueeScroll 26s linear infinite;
}
.marquee-ticker-wrap:hover .marquee-content {
  animation-play-state: paused;
}
@keyframes marqueeScroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}
.marquee-timer {
  background: rgba(168, 85, 247, 0.25);
  border-left: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0 12px;
  height: 100%;
  display: flex;
  align-items: center;
  z-index: 2;
  white-space: nowrap;
}

/* Large Broadcast Hero Banner */
.large-broadcast-card {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.95) 0%, rgba(88, 28, 135, 0.9) 100%);
  border: 2px solid #fbbf24;
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(251, 191, 36, 0.25);
  position: relative;
  animation: fadeInDown 0.3s ease;
}
.large-broadcast-card .banner-badge {
  display: inline-block;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #050711;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}
.large-broadcast-card .banner-title {
  color: #fbbf24;
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.large-broadcast-card .banner-text {
  color: #f8fafc;
  font-size: 1.05rem;
  line-height: 1.55;
  font-weight: 600;
  margin-bottom: 14px;
}
.large-broadcast-card .banner-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

/* Header Notification Bell */
.notif-bell-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fbbf24;
  font-size: 1.15rem;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  margin-left: 6px;
  flex-shrink: 0;
}
.notif-bell-btn:hover {
  background: rgba(251, 191, 36, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.5);
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
  animation: pulseBadge 2s infinite;
}
@keyframes pulseBadge {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* Notification Modal / Drawer */
.notif-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 17, 0.75);
  backdrop-filter: blur(6px);
  z-index: 999999;
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.2s ease;
}
.notif-modal-box {
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: #0b1120;
  border-left: 2px solid rgba(251, 191, 36, 0.4);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.7);
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.notif-modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #162036;
}
.notif-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.notif-close-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.notif-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.notif-item-card {
  background: #162036;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid #3b82f6;
  border-radius: 10px;
  padding: 14px;
  transition: transform 0.15s ease;
}
.notif-item-card:hover {
  transform: translateX(-2px);
  border-color: rgba(251, 191, 36, 0.3);
}
.notif-item-card.type-bonus { border-left-color: #10b981; }
.notif-item-card.type-alert { border-left-color: #ef4444; }
.notif-item-card.type-winner { border-left-color: #fbbf24; }
.notif-item-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.notif-item-msg {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin-bottom: 8px;
}
.notif-item-meta {
  font-size: 0.74rem;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
}

/* Live Push Toast Alerts */
.push-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  pointer-events: none;
}
.push-toast-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 14px 16px;
  color: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 20px rgba(251, 191, 36, 0.4);
  pointer-events: auto;
  animation: slideInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* Link Buttons and Target Tags in Notifications */
.notif-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #050711 !important;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 10px rgba(251, 191, 36, 0.35);
}
.notif-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.55);
  background: #fbbf24;
}
.notif-target-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.notif-target-tag.scope-all {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.notif-target-tag.scope-admin {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.notif-target-tag.scope-player {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.link-preset-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.link-preset-chip:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: #fbbf24;
  color: #fbbf24;
}
