/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablet: <= 1024px */
@media (max-width: 1024px) {
  .side-border {
    display: none;
  }
  .banking-inner {
    flex-direction: column;
  }
  .banking-left {
    width: 100%;
    flex-direction: row;
  }
  .banking-stat {
    flex: 1;
  }
  .bank-logos-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .footer-provider-grid {
    gap: 24px;
  }
}

/* Mobile: <= 768px */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  /* Force full viewport width — prevent any horizontal overflow or gap */
  html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .page-wrapper {
    max-width: 100%;
    width: 100%;
  }
  .main-content {
    max-width: 100vw;
    width: 100%;
    overflow: visible !important;
  }

  /* Hide desktop elements */
  .header-topbar,
  .main-nav,
  .nav-category-bar,
  .side-border,
  .floating-phone,
  .auth-desktop-bar {
    display: none !important;
  }

  /* Show mobile elements */
  .mobile-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: var(--header-height);
    padding: 0 12px;
  }
  .mobile-balance-bar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--color-bg-darkest);
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .mobile-balance-info {
    display: flex;
    flex-direction: column;
  }
  .mobile-balance-info .balance-label {
    font-size: 10px;
  }
  .mobile-balance-info .balance-amount {
    font-size: 16px;
  }

  .header-inner {
    padding: 0;
  }

  /* Hamburger Button */
  .hamburger-btn {
    width: 36px;
    height: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
  }
  .hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text-white);
    border-radius: 2px;
    transition: all 0.3s;
  }
  .hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .hamburger-btn.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .mobile-logo .logo-text {
    font-size: 22px;
  }

  /* Mobile Bottom Bar */
  .mobile-bottom-bar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--color-bg-dark);
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: var(--z-header);
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  /* Bottom bar - 5 tabs for both states */
  .bottom-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    color: var(--color-text-dim);
    font-size: 10px;
    transition: color 0.2s;
  }
  .bottom-bar-item.active {
    color: var(--color-primary);
  }
  .bottom-bar-item span {
    line-height: 1;
  }

  /* Adjust body padding for bottom bar */
  body {
    padding-bottom: 60px;
  }

  /* Mobile floating shortcut buttons — stacked vertically below contact FAB */
  .mobile-float-shortcuts {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 6px;
    top: calc(50% + 40px);
    z-index: 999;
    gap: 8px;
  }
  .mobile-float-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s;
  }
  .mobile-float-btn span {
    font-size: 8px;
    font-weight: 700;
    margin-top: 1px;
    line-height: 1;
  }
  .mobile-float-btn svg {
    width: 18px;
    height: 18px;
  }
  .mobile-float-btn:active {
    transform: scale(0.9);
  }

  /* Ticker — on mobile, show page-level ticker, hide header-level marquee */
  .header-marquee {
    display: none !important;
  }
  .ticker-bar {
    display: flex !important; /* show page-level ticker on mobile */
    height: 24px;
  }
  .ticker-text {
    font-size: 11px;
  }
  .ticker-right {
    display: none;
  }

  /* Mobile Login + Register buttons — full width side-by-side like katakjitu */
  .mobile-auth-buttons {
    display: flex;
    gap: 0;
    padding: 0;
  }
  .mobile-auth-btn {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s;
  }
  .mobile-auth-btn:active {
    opacity: 0.8;
  }
  .mobile-auth-login {
    background: #fff;
    color: #1a1a2e;
  }
  .mobile-auth-register {
    background: #c8ff00;
    color: #1a1a2e;
  }

  /* Banner — match actual image ratio (500x167 = 3:1) so cover doesn't crop */
  .banner-slider {
    aspect-ratio: 3/1;
    max-height: none;
    border-radius: 0;
  }
  .slide-title {
    font-size: 20px;
  }
  .slide-big {
    font-size: 48px;
  }
  .slide-badge {
    font-size: 11px;
    padding: 3px 10px;
  }
  .slide-content {
    padding: 20px;
  }
  .slide-character {
    width: 160px;
    right: 5%;
  }
  .slider-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  /* Game Categories — horizontal scroll, vertical icon+label layout on mobile */
  .game-categories-section {
    padding: 4px 0;
    overflow: visible !important;
  }
  .game-categories-row {
    overflow-x: auto;
    overflow-y: visible;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 12px;
    padding: 8px 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }
  .game-categories-row::-webkit-scrollbar {
    display: none;
  }
  .game-cat-item {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: auto;
    padding: 10px 8px;
    gap: 6px;
    border-radius: 16px;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
  }
  .game-cat-icon {
    width: 40px;
    height: 40px;
  }
  .game-cat-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .game-cat-label {
    font-size: 10px;
    text-align: center;
  }
  /* No transform on mobile — prevents size inconsistency between active/inactive */
  .game-cat-item:hover,
  .game-cat-item.is-active {
    transform: none;
  }

  /* Game grid — prevent overflow that causes layout shift on mobile */
  .game-grid-scroll {
    margin: 0;
    padding: 0 12px;
    max-width: 100%;
  }

  /* Jackpot — mobile: hide mascots, smaller text */
  .jackpot-mascot {
    display: none;
  }
  .jackpot-wrapper {
    padding: 0 8px;
  }
  .jackpot-number {
    font-size: 28px;
    letter-spacing: 1px;
  }
  .jackpot-display-panel {
    padding: 10px 16px;
  }
  .jackpot-label {
    font-size: 12px;
    letter-spacing: 4px;
  }
  .jackpot-logo-badge {
    padding: 4px 16px;
  }
  .chevron-arrow {
    font-size: 20px;
  }

  /* Game Sections */
  .game-section {
    padding: 16px 12px;
  }
  .section-title-text {
    font-size: 16px;
  }
  .game-card {
    width: 120px;
  }
  .game-card-img {
    width: 120px;
    height: 120px;
  }
  .game-card-name {
    max-width: 120px;
    font-size: 10px;
  }

  /* Banking */
  .banking-section {
    padding: 24px 12px;
  }
  .banking-left {
    flex-direction: column;
    width: 100%;
  }
  .bank-logos-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .bank-logo-placeholder {
    padding: 8px 4px;
    min-height: 32px;
  }
  .bank-name {
    font-size: 9px;
  }

  /* Banking card layout — stacks on mobile */
  .banking-card-layout {
    padding: 20px 16px;
  }

  /* Contact Us — stack on mobile */
  .contact-us-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    padding: 20px 16px;
  }

  /* SEO */
  .seo-section {
    padding: 24px 12px;
  }
  .seo-main-title {
    font-size: 16px;
  }
  .seo-contact {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  /* Footer */
  .footer-provider-grid {
    flex-direction: column;
    gap: 0;
  }
  .footer-provider-logos {
    gap: 12px;
  }
  .footer-logo-placeholder {
    padding: 4px 10px;
    font-size: 10px;
  }
  .footer-copyright {
    flex-direction: column;
    gap: 8px;
  }
  .site-footer {
    padding-bottom: 80px;
  }


  /* Popup */
  .popup-modal {
    max-width: 100%;
    margin: 0 8px;
    max-height: 85vh;
  }
  .popup-img-placeholder {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }
}

/* Small mobile: <= 480px */
@media (max-width: 480px) {
  .slide-title {
    font-size: 16px;
  }
  .slide-big {
    font-size: 36px;
  }
  .slide-info {
    gap: 12px;
  }
  .slide-tag {
    font-size: 10px;
  }
  .slide-tag strong {
    font-size: 13px;
  }
  .game-categories-row {
    gap: 10px;
  }
  .game-cat-item {
    width: 64px;
    padding: 8px 6px;
  }
  .game-cat-icon {
    width: 36px;
    height: 36px;
  }
  .cat-icon-placeholder svg {
    width: 28px;
    height: 28px;
  }
  .bank-logos-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
