/* ============================================================================
   CASINO PREMIUM  ·  UI/UX polish + animation for Casino & Live Casino
   ADDITIVE · load AFTER casino.css · hooks existing classes + theme tokens.
   Works with the virtualized grid (transforms only the cards, not the grid).
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. HERO — animated luxury glow + shimmering title
   -------------------------------------------------------------------------- */
.casino-hero { position: relative; overflow: hidden; }
.casino-hero::before {
  content: ""; position: absolute; inset: -40%;
  background:
    radial-gradient(420px 280px at 12% 10%, rgba(245,197,24,.16), transparent 60%),
    radial-gradient(420px 280px at 88% 0%, rgba(34,224,122,.12), transparent 60%);
  animation: cpHeroGlow 9s ease-in-out infinite alternate;
  pointer-events: none;
}
.casino-hero__inner { position: relative; z-index: 1; }
.casino-hero__title {
  background: linear-gradient(90deg, #fff 0%, var(--it-accent, #f5c518) 45%, #fff 70%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: cpShimmer 5s linear infinite;
}
.casino-hero__eyebrow { animation: cpFadeDown .5s ease both; }
.casino-hero__sub { animation: cpFadeDown .5s .08s ease both; }
.casino-hero__wallet { box-shadow: 0 0 0 1px rgba(34,224,122,.25), 0 8px 24px rgba(34,224,122,.12); }

@keyframes cpHeroGlow { 0% { transform: translate3d(-3%,-2%,0) scale(1); } 100% { transform: translate3d(3%,2%,0) scale(1.08); } }
@keyframes cpShimmer  { 0% { background-position: 120% 0; } 100% { background-position: -40% 0; } }
@keyframes cpFadeDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------------
   2. SEARCH + SYNC — focus glow, tactile sync
   -------------------------------------------------------------------------- */
.casino-search { transition: border-color .2s, box-shadow .2s, background .2s; }
.casino-search:focus-within {
  border-color: var(--it-accent, #f5c518);
  box-shadow: 0 0 0 3px rgba(245,197,24,.18);
  background: rgba(255,255,255,.06);
}
.casino-sync-btn { transition: transform .3s cubic-bezier(.34,1.56,.64,1), border-color .2s, color .2s; }
.casino-sync-btn:hover { border-color: var(--it-accent, #f5c518); color: var(--it-accent, #f5c518); }
.casino-sync-btn:active i { animation: cpSpin .6s ease; }
@keyframes cpSpin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
   3. CATEGORY / PROVIDER CHIPS — premium pills with active glow
   -------------------------------------------------------------------------- */
.casino-chip { transition: background .2s, border-color .2s, color .2s, transform .12s, box-shadow .2s; }
.casino-chip:hover { transform: translateY(-2px); border-color: rgba(245,197,24,.4); }
.casino-chip.is-active {
  box-shadow: 0 6px 18px rgba(245,197,24,.35);
  animation: cpChipPop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes cpChipPop { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* ---------------------------------------------------------------------------
   4. JACKPOT — premium animated mega + tier display with rolling odometer
   -------------------------------------------------------------------------- */
.cjp {
  position: relative; overflow: hidden;
  margin: 0 0 18px; border-radius: 18px; padding: clamp(16px, 3vw, 26px);
  background:
    radial-gradient(120% 150% at 50% -25%, rgba(245,197,24,.20), transparent 60%),
    linear-gradient(160deg, #16213c 0%, #0b1120 55%, #0a0e1a 100%);
  border: 1px solid rgba(245,197,24,.32);
  box-shadow: 0 18px 50px rgba(0,0,0,.5), inset 0 0 60px rgba(245,197,24,.06);
}
.cjp::before {
  content: ""; position: absolute; inset: -45%; z-index: 0;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(245,197,24,.12) 80%, transparent 92%);
  animation: cjpSpin 9s linear infinite;
}
@keyframes cjpSpin { to { transform: rotate(360deg); } }
.cjp__shine {
  position: absolute; top: 0; left: -60%; width: 45%; height: 100%; z-index: 1; pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.16), transparent);
  transform: skewX(-18deg); animation: cjpShine 5.5s ease-in-out infinite;
}
@keyframes cjpShine { 0%,55% { left: -60%; } 82%,100% { left: 130%; } }
.cjp__coins { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.cjp__coins span {
  position: absolute; bottom: -26px; opacity: 0; font-size: 18px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.45)); animation: cjpRise 6s ease-in infinite;
}
.cjp__coins span:nth-child(1) { left: 8%;  animation-delay: 0s; }
.cjp__coins span:nth-child(2) { left: 28%; animation-delay: 1.4s; font-size: 14px; }
.cjp__coins span:nth-child(3) { left: 52%; animation-delay: 2.8s; }
.cjp__coins span:nth-child(4) { left: 73%; animation-delay: .8s; font-size: 22px; }
.cjp__coins span:nth-child(5) { left: 90%; animation-delay: 3.6s; font-size: 13px; }
@keyframes cjpRise { 0% { transform: translateY(0) rotate(0); opacity: 0; } 12% { opacity: .85; } 100% { transform: translateY(-190px) rotate(220deg); opacity: 0; } }

.cjp__inner { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; }
.cjp__feat { display: flex; flex-direction: column; gap: 6px; }
.cjp__head { display: flex; align-items: center; gap: 9px; }
.cjp__crown { color: var(--it-accent, #f5c518); font-size: 1.05rem; filter: drop-shadow(0 0 8px rgba(245,197,24,.6)); animation: cjpCrown 2.2s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes cjpCrown { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-2px) rotate(5deg); } }
.cjp__eyebrow { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; font-weight: 800; color: #ffe9a8; }

.cjp__amount { display: flex; align-items: baseline; gap: 6px; }
.cjp__ccy { font-size: clamp(1rem, 2.4vw, 1.6rem); font-weight: 800; color: var(--it-accent, #f5c518); }
.cjp__odo { display: inline-flex; align-items: stretch; font-size: clamp(2rem, 6.5vw, 3.6rem); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.cjp-digit {
  position: relative; height: 1em; line-height: 1em; overflow: hidden; margin: 0 1px; padding: .06em .12em; border-radius: .14em;
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.3));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), inset 0 -3px 6px rgba(0,0,0,.5);
}
.cjp-digit__reel { display: flex; flex-direction: column; transition: transform .7s cubic-bezier(.16,1,.3,1); }
.cjp-digit__reel span {
  height: 1em; line-height: 1em; text-align: center;
  background: linear-gradient(180deg, #fff3c4, #f5c518 55%, #d99a16);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 16px rgba(245,197,24,.4);
}
.cjp-sep { align-self: flex-end; padding: 0 .02em; color: var(--it-accent, #f5c518); text-shadow: 0 0 14px rgba(245,197,24,.4); }

.cjp__tiers { display: flex; gap: 10px; flex-wrap: wrap; }
.cjp__tier { display: flex; flex-direction: column; gap: 3px; padding: 9px 14px; min-width: 120px; border-radius: 12px; background: rgba(0,0,0,.32); border: 1px solid rgba(245,197,24,.18); }
.cjp__tier-label { font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: rgba(255,233,168,.72); }
.cjp__tier-amount { display: flex; align-items: baseline; gap: 3px; }
.cjp__tier-ccy { font-size: .8rem; font-weight: 800; color: var(--it-accent, #f5c518); }
.cjp__odo--sm { font-size: clamp(1rem, 3vw, 1.4rem); font-weight: 800; }
.cjp__odo--sm .cjp-digit { background: none; box-shadow: none; padding: 0; margin: 0 .5px; }

@media (max-width: 560px) {
  .cjp__inner { flex-direction: column; align-items: stretch; }
  .cjp__tiers { width: 100%; }
  .cjp__tier { flex: 1; min-width: 0; }
}

/* ---------------------------------------------------------------------------
   5. GAME CARDS — lift, glow, image zoom, play-button reveal, live badges
   -------------------------------------------------------------------------- */
.casino-card { transition: transform .22s ease, box-shadow .28s ease, border-color .2s ease; }
.casino-card__thumb img { transition: transform .4s cubic-bezier(.2,.6,.2,1); }

/* hover dim backdrop behind the Demo/Real buttons */
.casino-card__thumb::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(180deg, rgba(8,12,22,.12), rgba(8,12,22,.72));
  opacity: 0; transition: opacity .25s ease; pointer-events: none;
}

/* Demo / Real action buttons revealed over the thumbnail */
.cc-overlay {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  opacity: 0; transition: opacity .22s ease; pointer-events: none;
}
.cc-play {
  pointer-events: auto; cursor: pointer; font-family: inherit;
  min-width: 104px; min-height: 38px; padding: 8px 18px;
  border-radius: 999px; font-weight: 800; font-size: .8rem; letter-spacing: .02em;
  border: 0; transform: translateY(10px);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), filter .15s ease;
  touch-action: manipulation;
}
.cc-play__ico { font-size: .72em; margin-right: 2px; }
.cc-play--real { color: #0a0e1a; background: linear-gradient(180deg, var(--it-accent, #f5c518), #d9a91a); box-shadow: 0 8px 22px rgba(245,197,24,.42); }
.cc-play--demo { color: #eaf0fb; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.4); }
.cc-play:hover { filter: brightness(1.09); }
.cc-play:active { transform: scale(.94); }
.casino-card__name { transition: color .2s ease; }

@media (hover: hover) and (pointer: fine) {
  .casino-card:hover {
    transform: translateY(-6px);
    border-color: var(--it-accent, #f5c518);
    box-shadow: 0 20px 44px rgba(0,0,0,.5), 0 0 0 1px rgba(245,197,24,.5), 0 0 26px rgba(245,197,24,.18);
  }
  .casino-card:hover .casino-card__thumb img { transform: scale(1.09); }
  .casino-card:hover .casino-card__thumb::after,
  .casino-card:hover .cc-overlay { opacity: 1; }
  .casino-card:hover .cc-play { transform: translateY(0); }
  .casino-card:hover .cc-play--demo { transition-delay: .04s; }
  .casino-card:hover .casino-card__name { color: var(--it-accent, #f5c518); }
}

/* touch devices (no hover): always-visible compact action bar */
@media (hover: none) {
  .cc-overlay {
    opacity: 1; inset: auto 0 0 0; flex-direction: row; gap: 6px; padding: 6px;
    background: linear-gradient(0deg, rgba(8,12,22,.92), transparent);
  }
  .cc-play { transform: none; min-width: 0; flex: 1; min-height: 34px; padding: 6px 4px; font-size: .72rem; }
}

.casino-card:active { transform: scale(.97); }

/* animated badges */
.casino-card__badge--hot {
  background: linear-gradient(180deg, var(--it-accent, #f5c518), #d9a91a);
  animation: cpHot 1.8s ease-in-out infinite;
}
@keyframes cpHot { 0%,100% { box-shadow: 0 0 0 0 rgba(245,197,24,.55); } 50% { box-shadow: 0 0 0 5px rgba(245,197,24,0); } }
.casino-card__badge--live::before {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: #fff; margin-right: 4px; animation: cpLive 1.4s ease-in-out infinite;
}
@keyframes cpLive { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------------------------------------------------------------------------
   6. GAME MODAL — smooth entrance
   -------------------------------------------------------------------------- */
.casino-modal:not(.hidden) { animation: cpModalIn .28s ease; }
@keyframes cpModalIn { from { opacity: 0; } to { opacity: 1; } }
.casino-modal__bar { box-shadow: 0 6px 20px rgba(0,0,0,.5); }

/* ---------------------------------------------------------------------------
   7. Loading state polish
   -------------------------------------------------------------------------- */
.casino-loading i { animation: cpSpin 1s linear infinite; }

/* ---------------------------------------------------------------------------
   8. SMART SEARCH + searchable PROVIDER DROPDOWN
   -------------------------------------------------------------------------- */
.casino-toolbar { flex-wrap: wrap; align-items: center; }
.casino-search { position: relative; flex: 1 1 220px; }
.casino-search__spin { display: none; color: var(--it-accent, #f5c518); }
.casino-search.is-searching .casino-search__icon { display: none; }
.casino-search.is-searching .casino-search__spin { display: inline-block; }
.casino-search__clear {
  border: 0; cursor: pointer; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background .15s, transform .08s;
}
.casino-search__clear:hover { background: rgba(239,68,68,.6); }
.casino-search__clear:active { transform: scale(.9); }

.casino-dropdown { position: relative; flex: 0 0 auto; }
.casino-dd-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; max-width: 220px;
  border-radius: 999px; cursor: pointer; font-family: inherit; font-weight: 700; font-size: .82rem;
  background: var(--bs-surface-3, rgba(255,255,255,.05));
  border: 1px solid var(--bs-border-strong, rgba(255,255,255,.14));
  color: var(--bs-text, #eaf0fb);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.casino-dd-btn:hover { border-color: var(--it-accent, #f5c518); }
.casino-dd-btn > i:first-child { color: var(--it-accent, #f5c518); }
.casino-dd-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.casino-dd-caret { margin-left: auto; font-size: .7em; transition: transform .2s; }
.casino-dropdown.is-open .casino-dd-btn { border-color: var(--it-accent, #f5c518); box-shadow: 0 0 0 3px rgba(245,197,24,.16); }
.casino-dropdown.is-open .casino-dd-caret { transform: rotate(180deg); }

.casino-dd-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  width: 280px; max-width: 80vw;
  background: var(--bs-surface, #0d1322);
  border: 1px solid var(--bs-border-strong, #2b3958); border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,.6); overflow: hidden; animation: cpDD .18s ease;
}
@keyframes cpDD { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.casino-dd-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--bs-border, #1d2740); }
.casino-dd-search i { color: var(--bs-text-muted, #9fb0cf); font-size: 12px; }
.casino-dd-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--bs-text, #fff); font-size: 13px; }
.casino-dd-list { max-height: 300px; overflow-y: auto; padding: 6px; }
.casino-dd-list::-webkit-scrollbar { width: 6px; }
.casino-dd-list::-webkit-scrollbar-thumb { background: rgba(245,197,24,.3); border-radius: 3px; }
.casino-dd-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 9px 12px; border: 0; border-radius: 9px; cursor: pointer; text-align: left;
  background: transparent; color: var(--bs-text, #eaf0fb); font-family: inherit; font-size: .84rem; font-weight: 600;
  transition: background .12s, color .12s;
}
.casino-dd-item:hover { background: rgba(245,197,24,.08); }
.casino-dd-item.is-active { background: linear-gradient(180deg, rgba(245,197,24,.18), rgba(245,197,24,.05)); color: var(--it-accent, #f5c518); }
.casino-dd-item__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.casino-dd-count { flex: none; font-size: .68rem; font-weight: 700; color: var(--bs-text-muted, #9fb0cf); background: rgba(255,255,255,.06); padding: 2px 7px; border-radius: 999px; }
.casino-dd-empty { padding: 18px; text-align: center; color: var(--bs-text-muted, #9fb0cf); font-size: .82rem; }

@media (max-width: 560px) {
  .casino-dropdown { flex: 1 1 100%; order: 3; }
  .casino-dd-btn { max-width: none; width: 100%; justify-content: flex-start; }
  .casino-dd-panel { width: 100%; left: 0; right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .casino-hero::before, .casino-hero__title, .casino-hero__eyebrow, .casino-hero__sub,
  .casino-card__badge--hot, .casino-card__badge--live::before,
  .casino-card, .casino-card__thumb img, .casino-modal:not(.hidden), .casino-loading i,
  .cc-overlay, .cc-play, .casino-dd-panel, .casino-dd-caret,
  .cjp::before, .cjp__shine, .cjp__coins span, .cjp__crown, .cjp-digit__reel {
    animation: none !important; transition: none !important;
  }
}
