:root {
  color-scheme: dark;
  --site-bg: #082334;
  --site-panel: #0d2d40;
  --site-panel-raised: #11374a;
  --site-border: #17465d;
  --site-text: #f1f6f8;
  --site-muted: #90a5ae;
  --site-accent: #28a9e8;
}

html, body, #root { min-height: 100%; background: var(--site-bg) !important; }
body, button, input, select, textarea { color: var(--site-text); font-family: Arial, Helvetica, sans-serif !important; }
.site-sidebar { background: var(--site-bg) !important; border-color: var(--site-border) !important; }
.sidebar-item, .sidebar-menu-button, .sidebar-brand, .sidebar-switcher { color: #f5f8fa !important; }
.sidebar-item svg, .sidebar-menu-button svg, .sidebar-brand svg { color: #fff !important; stroke: currentColor; }
.sidebar-item:hover, .sidebar-item.active, .sidebar-item[aria-current="page"] { background: #25343b !important; color: #fff !important; }
.sidebar-label, .sidebar-meta { color: #aebbc1 !important; }
.header, .mobile-navigation-heading { background: #151d21 !important; border-color: var(--site-border) !important; }
.header, .mobile-navigation-heading { background: var(--site-bg) !important; }
.header .brand > .brand-symbol, .mobile-navigation-heading .brand > .brand-symbol { display: none !important; }
.header .brand > i, .mobile-navigation-heading .brand > i { display: none !important; }
.header-auth-button.button.ghost, .header-auth-button:not(.primary) {
  background: #11374a !important;
  border-color: #11374a !important;
  color: #90a5ae !important;
}
.header-game-search, .search-input, input, select, textarea { border-color: var(--site-border); }
.home-showcase, .home-featured-promo, .home-payment-panel, .home-security-panel,
.casino-game-card, .home-game-card, .slot-card, .promotion-card, .category-art-card,
.sports-category-card, .betting-center-card, .balance-card, .content-page {
  border: 1px solid var(--site-border) !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 26px rgb(0 0 0 / 18%);
}
.home-game-card, .casino-game-card { overflow: hidden; background: var(--site-panel) !important; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.home-game-card:hover, .casino-game-card:hover { transform: translateY(-3px); border-color: #48616d !important; box-shadow: 0 12px 30px rgb(0 0 0 / 30%); }
.home-game-cover, .casino-game-cover, .slot-game-cover { aspect-ratio: 1 / 1; object-fit: cover; }
.home-game-caption, .casino-game-info, .casino-card-caption, .slot-card-caption { color: var(--site-text) !important; background: #1b2429 !important; }
.home-section-head { margin-block: 28px 14px; }
.home-kicker { letter-spacing: .14em; }
button, .header-auth-button, .sidebar-auth-login, .sidebar-auth-register { border-radius: 10px; }
.header-auth-button, .sidebar-auth-register { font-weight: 700; }
img { max-width: 100%; }

.account-content .payment-method-cards > div {
  min-height: 164px;
}

.account-content .payment-method-cards .payment-method-logo {
  display: block;
  width: 100%;
  height: 78px;
  margin: -2px 0 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, #26343c);
  border-radius: 11px;
  background: #071015;
  object-fit: contain;
}

@media (max-width: 767px) {
  .account-content .payment-method-cards > div { min-height: 148px; }
  .account-content .payment-method-cards .payment-method-logo { height: 64px; }
}

@media (max-width: 760px) {
  .site-sidebar { display: none !important; }
  .header { position: sticky; top: 0; z-index: 40; }
  .header-game-search { min-width: 0; }
  .home-showcase { border-radius: 12px !important; gap: 12px !important; }
  .home-game-row, .casino-games-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .home-game-card, .casino-game-card { min-width: 0; }
  .home-game-caption, .casino-game-info { font-size: 12px; }
  .home-section-head { margin-block: 8px 10px; }
  .content-page, .account-content { padding-inline: 14px !important; }
  .bottom-nav, .mobile-navigation { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}

@media (max-width: 767px) {
  .header-game-search { display: none !important; }
  .header-actions { gap: 6px; }
  .header-actions .header-auth-button {
    width: auto !important;
    min-width: 0 !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 8px !important;
    gap: 0 !important;
    font-size: 11px !important;
  }
  .header-actions .header-auth-button span { display: inline-block !important; }
  .header-actions .header-auth-button svg { display: none !important; }
  .header-actions .header-auth-button.button.ghost {
    background: #123f52 !important;
    border-color: #123f52 !important;
    color: #e4f1f5 !important;
  }
  .header-actions .header-auth-button.button.primary {
    background: #0878e6 !important;
    border-color: #0878e6 !important;
    color: #fff !important;
  }
}

@media (max-width: 420px) {
  .header-actions { gap: 4px; }
  .home-game-row, .casino-games-grid { gap: 8px !important; }
  .home-game-tag, .catalog-card-badge { font-size: 10px; }
}
/* Mobile brand logo and right-aligned auth controls */
.header .brand { flex: 0 1 auto; min-width: 0; margin-right: auto; }
.header .brand-logo, .mobile-navigation-heading .brand-logo {
  display: block; width: auto !important; height: 30px !important; max-height: 30px !important;
  max-width: 162px !important; object-fit: contain;
}
@media (max-width: 767px) {
  .header { gap: 6px !important; padding-inline: 10px !important; }
  .header .brand { flex: 0 1 auto !important; min-width: 0 !important; margin-right: auto !important; }
  .header .brand-logo { height: 24px !important; max-height: 24px !important; max-width: 82px !important; }
  .header-actions { margin-left: auto !important; margin-right: 0 !important; flex: 0 0 auto !important; justify-content: flex-end !important; gap: 4px !important; }
  .header-actions .header-auth-button {
    flex: 0 0 auto !important; width: auto !important; min-width: max-content !important;
    height: 38px !important; min-height: 38px !important; padding: 0 7px !important;
    gap: 4px !important; font-size: 11px !important;
  }
  .header-actions .header-auth-button span {
    position: static !important; inset: auto !important; display: inline-block !important;
    width: auto !important; height: auto !important; max-width: none !important;
    overflow: visible !important; clip-path: none !important; white-space: nowrap !important;
    visibility: visible !important; opacity: 1 !important; font-size: inherit !important; line-height: 1.2 !important;
  }
  .header-actions .header-auth-button svg { display: none !important; }
}
@media (max-width: 360px) {
  .header { gap: 4px !important; padding-inline: 6px !important; }
  .header .brand-logo { height: 18px !important; max-height: 18px !important; max-width: 54px !important; }
  .header-actions { gap: 3px !important; }
  .header-actions .header-auth-button {
    height: 34px !important; min-height: 34px !important; padding: 0 4px !important; font-size: 9px !important;
  }
}
/* NiroBet responsive hero artwork */
.home-hero-static { overflow: hidden; margin: 0 0 24px; border: 1px solid var(--site-border); border-radius: 16px; background: #071521; }
.home-hero-static picture { display: block; }
.home-hero-static-image { display: block; width: 100%; height: auto; object-fit: contain; }
@media (max-width: 767px) {
  .home-hero-static { margin-bottom: 14px; border-radius: 12px; }
  .home-hero-static-image { width: 100%; height: auto; }
}
/* Mobile bottom navigation follows the supplied five item reference */
@media (max-width: 767px) {
  .reference-shell .bottom-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
  .reference-shell .bottom-nav a, .reference-shell .bottom-nav button {
    min-width: 0; min-height: 54px; gap: 4px; font-size: 9px; line-height: 1.1;
    font-weight: 650; white-space: nowrap;
  }
  .reference-shell .bottom-nav svg { width: 21px; height: 21px; flex: 0 0 auto; }
}

/* Keep account dialogs visible and scrollable on touch devices. */
.auth-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #07090bba;
  -webkit-backdrop-filter: blur(11px);
  backdrop-filter: blur(11px);
}

.auth-dialog {
  box-sizing: border-box;
  flex: none;
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.auth-dialog-inner { min-height: 0; }

@media (max-width: 700px) {
  html,
  body,
  #root {
    min-height: 100%;
    height: auto;
  }

  body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-dialog-overlay {
    align-items: flex-start;
    padding: 10px 10px max(10px, env(safe-area-inset-bottom));
  }

  .auth-dialog {
    width: 100%;
    max-height: calc(100dvh - 20px);
    margin: 0 auto;
    overflow-y: auto;
  }
}

/* Home game cards are a two-column grid on mobile; let vertical page gestures pass through. */
@media (max-width: 767px) {
  .home-game-row {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    touch-action: pan-y !important;
    scroll-snap-type: none !important;
    scroll-padding-inline: 0;
    overscroll-behavior: auto !important;
    -webkit-overflow-scrolling: auto;
  }
}
