/* ═══════════════════════════════════════════════════════════════════════════
   PRELOADER — replaces logo+progress with animated BINGO splash
   ═══════════════════════════════════════════════════════════════════════════ */
.preloader {
    background: radial-gradient(ellipse at 50% -5%, #3a008a 0%, #12002e 50%, #06000f 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
}
/* Kill the old .canvas centering — we handle it ourselves */
.preloader .canvas {
    position: static !important;
    transform: none !important;
    display: flex; flex-direction: column; align-items: center;
}
/* Hide legacy elements — kept in DOM so app.js doesn't throw */
.preloader .canvas > img,
.preloader .loading-progress-bar,
.preloader .loading-percentage {
    display: none !important;
}

/* Aura blobs */
.bj-pre-blob {
    position: absolute; border-radius: 50%;
    filter: blur(70px); pointer-events: none;
}
.bj-pre-blob-1 {
    width: 340px; height: 340px;
    background: rgba(98,54,255,.42);
    top: -8%; left: -12%;
    animation: bjPreFloat 5s ease-in-out infinite;
}
.bj-pre-blob-2 {
    width: 260px; height: 260px;
    background: rgba(255,61,127,.35);
    bottom: -5%; right: -10%;
    animation: bjPreFloat 5s ease-in-out 2s infinite;
}
.bj-pre-blob-3 {
    width: 180px; height: 180px;
    background: rgba(255,233,77,.22);
    top: 42%; left: 58%;
    animation: bjPreFloat 5s ease-in-out 3.5s infinite;
}
@keyframes bjPreFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-22px)} }

/* BINGO letters row */
.bj-pre-logo {
    display: flex; gap: 8px; margin-bottom: 10px;
}
.bj-pre-logo span {
    font-family: 'Fredoka One', cursive;
    font-size: 3.4rem; line-height: 1;
    width: 64px; height: 64px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 18px;
    animation: bjPreLetter .55s cubic-bezier(.16,1,.3,1) both;
}
@keyframes bjPreLetter {
    from { opacity:0; transform:translateY(28px) scale(.65); }
    to   { opacity:1; transform:translateY(0)    scale(1); }
}
.bj-pre-b { background:#6236ff; color:#fff;    animation-delay:.00s; box-shadow:0 6px 24px rgba(98,54,255,.50); }
.bj-pre-i { background:#FF3D7F; color:#fff;    animation-delay:.07s; box-shadow:0 6px 24px rgba(255,61,127,.50); }
.bj-pre-n { background:#FFE94D; color:#1a0048; animation-delay:.14s; box-shadow:0 6px 24px rgba(255,233,77,.40); }
.bj-pre-g { background:#22c55e; color:#fff;    animation-delay:.21s; box-shadow:0 6px 24px rgba(34,197,94,.45); }
.bj-pre-o { background:#00C9FF; color:#1a0048; animation-delay:.28s; box-shadow:0 6px 24px rgba(0,201,255,.45); }

/* Subtitle */
.bj-pre-sub {
    font-family: 'Fredoka One', cursive;
    font-size: 1.15rem; letter-spacing: 6px;
    text-transform: uppercase;
    color: rgba(255,255,255,.50);
    margin-bottom: 44px;
    animation: bjPreSub .5s cubic-bezier(.16,1,.3,1) .38s both;
}
@keyframes bjPreSub { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* Progress bar */
.bj-pre-bar {
    width: 160px; height: 3px;
    background: rgba(255,255,255,.10); border-radius: 999px; overflow: hidden;
    animation: bjPreSub .4s ease .48s both;
}
.bj-pre-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #6236ff 0%, #FF3D7F 50%, #FFE94D 100%);
    border-radius: 999px;
    transition: width .28s ease;
}

/* Fade-out when done */
.preloader.bj-pre-done {
    animation: bjPreOut .55s cubic-bezier(.4,0,1,1) forwards !important;
    pointer-events: none !important;
}
@keyframes bjPreOut {
    0%   { opacity:1; transform:scale(1); }
    100% { opacity:0; transform:scale(1.04); }
}

/* ── App Navigation: Topbar + Bottom Nav ─────────────────────────────────── */

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: var(--clr-nav-bg);
  backdrop-filter: blur(var(--nav-blur));
  -webkit-backdrop-filter: blur(var(--nav-blur));
  border-bottom: 1px solid var(--clr-glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: var(--nav-zindex);
}

.topbar-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  height: 44px;
}

.topbar-logo img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-balance-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid var(--clr-glass-border);
  border-radius: 20px;
  padding: 5px 12px;
  color: #fff;
  font-family: 'Nunito', 'Fredoka One', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  line-height: 1;
}

.topbar-balance-btn:hover,
.topbar-balance-btn:active {
  background: rgba(255, 255, 255, 0.22);
}

.topbar-currency {
  opacity: 0.75;
  font-weight: 600;
}

.topbar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid var(--clr-glass-border);
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.topbar-icon-btn:hover,
.topbar-icon-btn:active {
  background: rgba(255, 255, 255, 0.22);
}

.topbar-logout-btn {
  color: rgba(255, 130, 130, 0.85);
  text-decoration: none;
}
.topbar-logout-btn:hover,
.topbar-logout-btn:active {
  background: rgba(239, 68, 68, 0.22);
  color: #ffb3b3;
}

/* ── Bottom Nav ───────────────────────────────────────────────────────────── */
.app-bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--clr-nav-bg);
  backdrop-filter: blur(var(--nav-blur));
  -webkit-backdrop-filter: blur(var(--nav-blur));
  border-top: 1px solid var(--clr-glass-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: var(--nav-zindex);
}

.bottomnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  height: var(--bottomnav-h);
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.65rem;
  font-family: 'Nunito', 'Fredoka One', sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color 0.18s;
  position: relative;
}

.bottomnav-item i {
  font-size: 1.25rem;
  transition: transform 0.18s;
}

.bottomnav-item span {
  display: block;
  margin-top: 1px;
}

.bottomnav-item.active,
.bottomnav-item:active {
  color: #fff;
}

.bottomnav-item.active i {
  transform: scale(1.1);
}

/* Active pill highlight */
.bottomnav-item.active::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 48px;
  height: 30px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  z-index: -1;
}

/* Notification dot on bottomnav item */
.bottomnav-item .nav-dot {
  position: absolute;
  top: 10px;
  right: calc(50% - 16px);
  width: 8px;
  height: 8px;
  background: var(--clr-accent-pink);
  border-radius: 50%;
  border: 2px solid var(--clr-nav-bg);
  display: none;
}

.bottomnav-item.has-dot .nav-dot {
  display: block;
}

/* ── Body scroll fix: bingo.css sets height:100vh + overflow:hidden on body  ─
   Without this override every has-app-nav page clips at viewport height and
   the bottom nav is hidden behind content on mobile.                          */
body.has-app-nav {
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

/* ── Body content padding when app-nav is active ─────────────────────────── */
body.has-app-nav #content-page {
  padding-top: var(--topbar-h);
  padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px) + 8px);
}

/* ── Bottom nav: sit above iOS home-indicator bar ───────────────────────────
   viewport-fit=cover is now in the meta tag, so env() returns the real inset  */
.app-bottomnav {
  bottom: 0 !important;
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 6px) !important;
  height: calc(var(--bottomnav-h) + max(env(safe-area-inset-bottom, 0px), 6px)) !important;
}

/* Modals should appear above the nav bars */
body.has-app-nav .modal {
  z-index: 1055;
}

body.has-app-nav .modal-backdrop {
  z-index: 1054;
}

/* ── Hide old floating nav buttons when app-nav is active ────────────────── */
body.has-app-nav .btn-home,
body.has-app-nav .btn-profile,
body.has-app-nav .btn-wallet,
body.has-app-nav .btn-wallet-profile,
body.has-app-nav .btn-gamepad,
body.has-app-nav .btn-gamepad-profile,
body.has-app-nav .btn-qrcode,
body.has-app-nav .btn-logout,
body.has-app-nav .btn-sliders,
body.has-app-nav .btn-gear,
body.has-app-nav .btn-statistics,
body.has-app-nav .btn-game {
  display: none !important;
}

/* ── Scrollable authenticated pages (profile, etc.) need extra bottom room ── */
body.has-app-nav.scrollable-view {
  min-height: calc(100vh + var(--bottomnav-h));
}

/* ── Fix container-section height to account for topbar ─────────────────── */
body.has-app-nav .container-section {
  height: calc(100vh - var(--topbar-h));
}

/* ── Game board views are full-screen: hide app nav entirely ─────────────── */
body.playing-view .app-topbar,
body.playing-view .app-bottomnav {
  display: none !important;
}

body.playing-view.has-app-nav #content-page {
  padding-top: 0;
  padding-bottom: 0;
}

/* Restore game-specific nav buttons on board views */
body.playing-view.has-app-nav .btn-home,
body.playing-view.has-app-nav .btn-wallet,
body.playing-view.has-app-nav .btn-wallet-profile,
body.playing-view.has-app-nav .btn-logout {
  display: flex !important;
}

/* ── Volume panel: position below topbar when app-nav is active ──────────── */
body.has-app-nav .volume-panel {
  top: calc(var(--topbar-h) + 8px);
  right: 16px;
  left: auto;
  z-index: 1100;
}

/* ── Nunito font utility ──────────────────────────────────────────────────── */
.font-nunito {
  font-family: 'Nunito', sans-serif;
}

/* ── Generic Bottom Sheet (global) ───────────────────────────────────────── */
.bj-sheet { position: fixed; inset: 0; z-index: 1060; pointer-events: none; }
.bj-sheet.open { pointer-events: auto; }

.bj-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(10,0,40,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 280ms; z-index: 0;
}
.bj-sheet.open .bj-sheet-backdrop { opacity: 1; }

.bj-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 85vh; max-height: 90vh;
  background: linear-gradient(180deg, #2a0d6e, #1a0048);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,.4);
  transform: translateY(100%);
  transition: transform 300ms cubic-bezier(.4,0,.2,1);
  z-index: 1; display: flex; flex-direction: column;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bj-sheet.open .bj-sheet-panel { transform: translateY(0); }

.bj-sheet-handle-bar { display: flex; justify-content: center; padding: 10px 0 4px; }
.bj-sheet-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.25);
}

.bj-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 18px 12px; flex-shrink: 0;
}
.bj-sheet-header h2 {
  font-family: 'Fredoka One', cursive; font-weight: 600;
  font-size: 1.1rem; color: #fff; margin: 0; letter-spacing: -.2px;
}
.bj-sheet-close {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.10); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}

.bj-sheet-content {
  flex: 1; overflow-y: auto; padding: 0 4px 16px;
  -webkit-overflow-scrolling: touch;
}

/* Normalise modal-dialog content loaded into any sheet */
.bj-sheet-content .modal-dialog { margin: 0; max-width: none; }
.bj-sheet-content .modal-content { background: transparent; border: none; box-shadow: none; color: #fff; }
.bj-sheet-content .modal-header { display: none; }
.bj-sheet-content .modal-body { padding: 0 10px 8px; }
.bj-sheet-content .btn-bingo { border-radius: 14px !important; }

/* Loading spinner */
.bj-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; color: rgba(255,255,255,.6); font-size: 1.4rem;
}

/* ── Dark-theme overrides for forms loaded into action sheet ─────────────── */
#bjActionSheetContent { padding: 0 2px 24px; }

/* Strip Bootstrap modal chrome — we're inside the sheet already */
#bjActionSheetContent .modal-body { padding: 0 12px 8px; }

/* Form layout: comfortable spacing */
#bjActionSheetContent .row { gap: 0; }
#bjActionSheetContent .col-md-12,
#bjActionSheetContent .col-md-6 { margin-bottom: 2px; }

/* Labels: small uppercase */
#bjActionSheetContent .form-label {
  color: rgba(255,255,255,.60) !important;
  font-family: 'Fredoka One', cursive;
  font-size: .72rem;
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* Inputs & selects: glass pill */
#bjActionSheetContent .form-control,
#bjActionSheetContent .form-bingo {
  background: rgba(255,255,255,.08) !important;
  border: 1.5px solid rgba(255,255,255,.18) !important;
  border-radius: 14px !important;
  color: #fff !important;
  font-family: 'Fredoka One', cursive;
  font-size: .95rem;
  height: 48px;
  padding: 0 16px;
  transition: border-color .18s, background .18s;
}
#bjActionSheetContent textarea.form-control {
  height: auto !important;
  padding: 12px 16px;
  resize: none;
}
#bjActionSheetContent .form-control:focus,
#bjActionSheetContent .form-bingo:focus {
  background: rgba(255,255,255,.12) !important;
  border-color: rgba(98,54,255,.70) !important;
  box-shadow: 0 0 0 3px rgba(98,54,255,.22) !important;
  outline: none;
}
#bjActionSheetContent .form-control.is-invalid,
#bjActionSheetContent .form-bingo.is-invalid {
  border-color: rgba(255,80,120,.60) !important;
}
#bjActionSheetContent select.form-control option { background: #1a0048; color: #fff; }
#bjActionSheetContent select.form-control {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,.5)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  padding-right: 36px !important;
}

/* CTA submit button: pink gradient */
#bjActionSheetContent .btn-bingo,
#bjActionSheetContent .btn-primary {
  background: linear-gradient(135deg, #FF3D7F 0%, #e0245e 100%) !important;
  border: none !important;
  border-radius: 14px !important;
  color: #fff !important;
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  font-weight: 600;
  height: 50px;
  width: 100% !important;
  box-shadow: 0 4px 18px rgba(255,61,127,.40) !important;
  transition: opacity .18s, transform .12s;
  margin-top: 8px;
}
#bjActionSheetContent .btn-bingo:hover,
#bjActionSheetContent .btn-primary:hover { opacity: .92; }
#bjActionSheetContent .btn-bingo:active,
#bjActionSheetContent .btn-primary:active { transform: scale(.98); }
#bjActionSheetContent .btn-bingo:disabled,
#bjActionSheetContent .btn-primary:disabled { opacity: .55 !important; }

/* Inline helper text */
#bjActionSheetContent .help-block {
  color: rgba(255,255,255,.65);
  font-size: .82rem;
  text-align: center;
  margin-bottom: 14px;
}

/* Error messages */
#bjActionSheetContent small.text-danger { color: #ff8fa3 !important; font-size: .72rem; }

/* Info cards (bank detail, user card) */
#bjActionSheetContent .card {
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.15) !important;
  border-radius: 16px !important;
  color: #fff !important;
}
#bjActionSheetContent .text-muted { color: rgba(255,255,255,.55) !important; }
#bjActionSheetContent h6 { color: #fff; }

/* Tabs */
#bjActionSheetContent .nav-tabs { border-color: rgba(255,255,255,.15); }
#bjActionSheetContent .nav-link { color: rgba(255,255,255,.70); }
#bjActionSheetContent .nav-link.active {
  background: rgba(255,255,255,.12) !important;
  border-color: rgba(255,255,255,.18) transparent !important;
  color: #fff !important;
}

/* Voucher image thumbnail */
#bjActionSheetContent img { max-width: 100%; border-radius: 10px; }
#bjActionSheetContent .img-thumbnail {
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.15) !important;
}

/* Divider + balance footer */
#bjActionSheetContent hr {
  border-color: rgba(255,255,255,.12);
  margin: 16px 0 10px;
}
#bjActionSheetContent > .modal-dialog > .modal-content > .modal-body > .text-center:last-child,
#bjActionSheetContent .modal-body > .text-center:last-child {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  padding: 10px 16px;
  font-family: 'Fredoka One', cursive;
  font-size: .85rem;
  color: rgba(255,255,255,.75);
}
#bjActionSheetContent .modal-body > .text-center:last-child .available-wallet {
  color: #FFE94D;
  font-weight: 700;
}

/* Checkbox label */
#bjActionSheetContent .form-check-label { color: rgba(255,255,255,.80); font-size: .85rem; }
#bjActionSheetContent .form-check-input {
  background-color: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.30);
}

/* Paste link */
#bjActionSheetContent .text-primary { color: #a285ff !important; }

/* ── Dark-theme overrides for payments list in wallet sheet ──────────────── */
#bjWalletSheetContent .card {
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.15) !important;
  color: #fff !important;
}
#bjWalletSheetContent .table {
  color: #fff;
  --bs-table-striped-bg: rgba(255,255,255,.04);
  --bs-table-hover-bg: rgba(255,255,255,.07);
}
#bjWalletSheetContent .table thead th { border-color: rgba(255,255,255,.15); }
#bjWalletSheetContent .table td { border-color: rgba(255,255,255,.08); }
#bjWalletSheetContent .text-muted { color: rgba(255,255,255,.60) !important; }
#bjWalletSheetContent .form-control,
#bjWalletSheetContent .form-bingo {
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.18) !important;
  color: #fff !important;
}
#bjWalletSheetContent select.form-control option { background: #1a0048; color: #fff; }

/* ── Dark-theme overrides for games sheet ────────────────────────────────── */
#bjGamesSheetContent .form-label { color: rgba(255,255,255,.85) !important; }
#bjGamesSheetContent .form-control,
#bjGamesSheetContent .form-bingo {
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.18) !important;
  color: #fff !important;
}
#bjGamesSheetContent select.form-control option { background: #1a0048; color: #fff; }
#bjGamesSheetContent .card {
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.15) !important;
}
#bjGamesSheetContent .table {
  color: #fff;
  --bs-table-color: #fff;
  --bs-table-bg: transparent;
  --bs-table-striped-color: #fff;
  --bs-table-striped-bg: rgba(255,255,255,.04);
  --bs-table-hover-color: #fff;
  --bs-table-hover-bg: rgba(255,255,255,.07);
}
#bjGamesSheetContent .table thead th {
  background: rgba(255,255,255,.10) !important;
  border-color: rgba(255,255,255,.15) !important;
  color: rgba(255,255,255,.85) !important;
}
#bjGamesSheetContent .table td,
#bjGamesSheetContent .table th {
  border-color: rgba(255,255,255,.08);
  color: #fff;
}
#bjGamesSheetContent .table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-color-type: #fff;
  --bs-table-bg-type: rgba(255,255,255,.04);
}
#bjGamesSheetContent .table-striped > tbody > tr:nth-of-type(even) > * {
  --bs-table-color-type: #fff;
  --bs-table-bg-type: transparent;
}
#bjGamesSheetContent .progress { background: rgba(255,255,255,.12); }
#bjGamesSheetContent .form-check-label { color: rgba(255,255,255,.80); }
#bjGamesSheetContent .form-check-input { background-color: rgba(255,255,255,.10); border-color: rgba(255,255,255,.25); }
#bjGamesSheetContent .text-muted { color: rgba(255,255,255,.55) !important; }
/* Ensure button text inside table cells is readable */
#bjGamesSheetContent .table td .btn { border-color: rgba(255,255,255,.25); }
#bjGamesSheetContent .table td .btn-outline-primary,
#bjGamesSheetContent .table td .btn-outline-info,
#bjGamesSheetContent .table td .btn-outline-secondary {
  color: rgba(255,255,255,.85) !important;
  border-color: rgba(255,255,255,.30) !important;
}
#bjGamesSheetContent .pagination .page-link {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.15);
  color: #fff;
}
#bjGamesSheetContent .pagination .page-item.active .page-link {
  background: var(--clr-primary, #6236ff);
  border-color: var(--clr-primary, #6236ff);
}
#bjGamesSheetContent .pagination .page-item.disabled .page-link {
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.40);
}
