/**
 * CafeTal777 — Consolidated Responsive Styles
 * Merged from: cafetal777-responsive.css + cafetal777-mobile-tablet.css
 * Organized by breakpoint: base → 991px → 768px → 576px → tablet-landscape → print
 */

/* ==========================================================================
   BASE (no media query) — overflow, safe areas, tokens
   ========================================================================== */

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  overflow-x: hidden;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}

.cafetal777-layout {
  overflow-x: hidden;
  min-width: 0;
  --mt-gutter-sm: 12px;
  --mt-gutter-md: 16px;
  --mt-gutter-lg: 20px;
  --mt-radius: 12px;
  --mt-radius-sm: 8px;
  --mt-touch: 48px;
  --mt-nav-h: 56px;
  --mt-header-h: 52px;
}

/* Bet slip backdrop: default off */
.betslip-panel-backdrop {
  display: none;
}

/* Safe area for notched devices (iPhone X+, etc.) */
@supports (padding: max(0px)) {
  .cafetal777-layout .header-primary,
  .app-nav {
    padding-inline-start: max(12px, env(safe-area-inset-left));
    padding-inline-end: max(12px, env(safe-area-inset-right));
  }
  .app-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .sports-body,
  .betting-body {
    padding-inline-start: max(12px, env(safe-area-inset-left));
    padding-inline-end: max(12px, env(safe-area-inset-right));
  }
}

/* Container query support for card components */
.card-container-query {
  container-type: inline-size;
  container-name: card;
}

@container card (max-width: 300px) {
  .card-container-query .card-body { padding: 12px; }
  .card-container-query .card-title { font-size: 0.95rem; }
  .card-container-query .card-text { font-size: 0.85rem; }
}


/* ==========================================================================
   TABLET (max-width: 991px)
   ========================================================================== */
@media (max-width: 991px) {

  /* --- Body scroll lock when sidebar open --- */
  body.sidebar-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  /* --- Touch-friendly tap targets (min 44px) --- */
  a.btn,
  button.btn {
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .oddBtn {
    min-height: 44px;
    padding: 10px 12px;
  }

  .sports-category__link,
  .sports-category__game-link,
  .app-nav__menu-link {
    min-height: 44px;
  }

  .sports-category__games-toggle {
    min-height: 40px;
    padding: 10px 14px;
  }

  /* --- Touch: prevent double-tap zoom --- */
  .cafetal777-layout .oddBtn,
  .cafetal777-layout .btn,
  .app-nav__menu-link,
  .cafetal777-layout .sub-category-drawer__link {
    touch-action: manipulation;
  }

  /* --- Container overflow --- */
  .container-fluid {
    padding-inline-start: 12px;
    padding-inline-end: 12px;
  }

  .row.g-3 {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
  }

  /* --- No black bar: full-bleed content --- */
  .cafetal777-layout .home-page {
    display: block !important;
    min-height: auto;
    overflow-x: hidden;
    padding-inline-start: 0 !important;
    margin-inline-start: 0 !important;
  }

  /* --- Header: compact, single row --- */
  .cafetal777-layout .header-primary {
    min-height: var(--mt-header-h);
    padding: 0 !important;
    position: sticky;
    top: 0;
    z-index: var(--ct-z-sticky);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  }

  .cafetal777-layout .header-primary .container-fluid {
    padding-inline-start: var(--mt-gutter-md);
    padding-inline-end: var(--mt-gutter-md);
    max-width: 100%;
  }

  .cafetal777-layout .header-fluid-custom-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--mt-gutter-sm);
    min-height: var(--mt-header-h);
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
  }

  .cafetal777-layout .logo {
    flex-shrink: 0;
    max-width: 130px;
    min-width: 0;
  }

  .cafetal777-layout .logo-text-brand {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .cafetal777-layout .primary-menu-container {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
    display: flex;
    align-items: center;
  }

  .cafetal777-layout .right-side-nav {
    flex-shrink: 0;
    margin-left: 0;
  }

  /* --- Header mobile menu button --- */
  .header-mobile-menu__btn {
    background: rgba(0, 212, 255, 0.15) !important;
    color: var(--ct777-accent) !important;
    border: 1px solid rgba(0, 212, 255, 0.4) !important;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
  }

  .header-mobile-menu__btn:hover {
    background: rgba(0, 212, 255, 0.25) !important;
    color: var(--ct777-accent) !important;
  }

  .header-mobile-dropdown {
    background: var(--ct777-dark-card, #1A2233);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 8px 0;
    margin-top: 8px;
    min-width: 260px;
  }

  .header-mobile-dropdown .dropdown-item {
    color: var(--ct777-text);
    padding: 10px 16px;
  }

  .header-mobile-dropdown .dropdown-item:hover {
    background: rgba(0, 212, 255, 0.1);
    color: var(--ct777-accent);
  }

  .header-mobile-dropdown .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
  }

  .header-mobile-dropdown .form-select {
    background: var(--ct777-dark);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--ct777-text);
  }

  .cafetal777-layout .right-side-nav .select-lang--container {
    max-width: 100px;
  }

  .cafetal777-layout .right-side-nav .form-select.oddsType {
    font-size: 12px;
    padding: 8px 10px;
    min-height: 36px;
  }

  .cafetal777-layout .btn--signup {
    padding: 8px 14px !important;
    font-size: 13px !important;
    min-height: 38px;
    border-radius: var(--mt-radius-sm);
  }

  /* --- Main content --- */
  .cafetal777-layout .sports-body {
    width: 100% !important;
    flex: none !important;
    min-width: 0 !important;
    margin-inline-start: 0 !important;
    padding-inline-start: var(--mt-gutter-md) !important;
    padding: var(--mt-gutter-md) var(--mt-gutter-md) calc(var(--mt-nav-h) + var(--mt-gutter-lg) + env(safe-area-inset-bottom, 0px)) !important;
    min-height: 60vh;
  }

  .cafetal777-layout .sports-body .row {
    margin-left: -6px;
    margin-right: -6px;
  }

  .cafetal777-layout .sports-body .row > [class*="col-"] {
    padding-left: 6px;
    padding-right: 6px;
  }

  .cafetal777-layout .betting-body {
    padding-top: 4px;
  }

  /* --- Sidebar: overlay drawer --- */
  .sports-category:not(.active-category-side),
  .cafetal777-layout .sports-category:not(.active-category-side) {
    left: -400px !important;
    transform: translateX(0) !important;
    box-shadow: none !important;
    transition: left 0.3s ease, box-shadow 0.3s ease;
  }

  .sports-category,
  .cafetal777-layout .sports-category {
    width: 85% !important;
    max-width: 300px !important;
    min-width: 0 !important;
    position: fixed !important;
    left: 0;
    top: 0;
    height: 100vh !important;
    max-height: 100vh !important;
    z-index: var(--ct-z-sidebar);
    background: linear-gradient(180deg, #001a2a 0%, var(--ct777-primary, #00D4FF) 8%, var(--ct777-dark-soft, #111827) 15%, var(--ct777-dark-card, #1A2233) 100%) !important;
    border-inline-end: 2px solid rgba(0, 212, 255, 0.25) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .sports-category.active-category-side,
  .cafetal777-layout .sports-category.active-category-side {
    left: 0 !important;
    transform: translateX(0) !important;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
    transition: left 0.3s ease, box-shadow 0.3s ease;
  }

  /* Backdrop overlay when sidebar is open */
  .sports-category.active-category-side::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: -1;
    pointer-events: none;
  }

  .sports-category .sports-category__link.live-btn,
  .sports-category .sports-category__stats {
    flex-shrink: 0;
  }

  .sports-category .sports-category__search-wrap {
    flex-shrink: 0;
    padding: 8px 12px;
  }

  .sports-category .sports-category__search-wrap input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--ct777-border, rgba(255, 255, 255, 0.15));
    background: var(--ct777-dark-card, #1A2233);
    color: var(--ct777-text);
    font-size: 14px;
  }

  .sports-category .sports-category__list {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    padding: 10px 8px 20px !important;
  }

  .sports-category--premium .sports-category__heading {
    flex-shrink: 0;
  }

  /* --- Slider / Hero: full bleed --- */
  .cafetal777-layout .banner-slider--hero,
  .cafetal777-layout .banner-slider.hero-slider {
    margin-left: calc(-1 * var(--mt-gutter-md));
    margin-right: calc(-1 * var(--mt-gutter-md));
    max-width: none;
    border-radius: 0;
    overflow: hidden;
    aspect-ratio: 700 / 360;
    min-height: 120px;
    max-height: none;
  }

  .cafetal777-layout .banner-slider--hero .banner_slide,
  .cafetal777-layout .banner-slider--hero .banner_image {
    min-height: 0;
    max-height: none;
    object-fit: cover;
  }

  .cafetal777-layout .banner-placeholder {
    min-height: 120px;
    padding: 24px 16px;
  }

  .cafetal777-layout .hero-slider__progress { height: 2px; }
  .cafetal777-layout .banner-slider__nav.navDots { bottom: 18px; }

  /* --- Betting body + sport hub --- */
  .cafetal777-layout .betting-body.betting-body--hub {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }

  .cafetal777-layout .sport-hub-section-wrap { margin-bottom: 1.25rem; }

  .cafetal777-layout .sport-hub--creative {
    border-radius: 12px;
    margin-left: 0;
    margin-right: 0;
  }

  .cafetal777-layout .sport-hub__header--creative { padding: 12px var(--mt-gutter-md); }
  .cafetal777-layout .sport-hub__header-inner { gap: 8px 10px; }
  .cafetal777-layout .sport-hub__sport-emoji { font-size: 1.35rem; }
  .cafetal777-layout .sport-hub__title { font-size: 1.1rem; }
  .cafetal777-layout .sport-hub__match-badge { font-size: 0.7rem; padding: 3px 8px; }

  .cafetal777-layout .sport-hub__tabs--pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px var(--mt-gutter-md);
    gap: 6px;
  }

  .cafetal777-layout .sport-hub__tabs--pills::-webkit-scrollbar { display: none; }

  .cafetal777-layout .sport-hub__tabs--pills .sport-hub__tab {
    flex: 0 0 auto;
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .cafetal777-layout .sport-hub__toolbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px var(--mt-gutter-md);
  }

  .cafetal777-layout .sport-hub__date-filter { width: 100%; order: 3; }
  .cafetal777-layout .sport-hub__date-filter .sport-hub__date-input { min-height: 44px; }
  .cafetal777-layout .sport-hub__last-updated { font-size: 0.75rem; }

  .cafetal777-layout .sport-table-desktop {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .cafetal777-layout .sport-table-wrap {
    margin: 0;
    padding: 0;
  }

  /* Desktop table only (hidden on small screens — see sport_match_fragment + d-lg-block) */
  .cafetal777-layout .sport-table-desktop .sport-table--creative {
    min-width: 640px;
  }

  .cafetal777-layout .sport-table__th,
  .cafetal777-layout .sport-table__cell {
    padding: 10px 8px;
    font-size: 0.8rem;
  }

  .cafetal777-layout .sport-table__cell--match .sport-table__match-link { font-size: 0.85rem; }

  .cafetal777-layout .sport-table__cell--odd .oddBtn {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 0.9rem;
    touch-action: manipulation;
  }

  .cafetal777-layout .sport-hub__sidebar { padding: var(--mt-gutter-md); border-top: 1px solid var(--ct777-border); }
  .cafetal777-layout .sport-widget__item { padding: 12px; }

  .cafetal777-layout .hero-slider__arrow { width: 34px; height: 34px; margin-top: -17px; font-size: 1.1rem; }
  .cafetal777-layout .hero-live-badge { top: 8px; left: 8px; padding: 5px 10px; font-size: 0.75rem; }
  .cafetal777-layout .banner-placeholder__text { font-size: 1rem; letter-spacing: 0.15em; }
  .cafetal777-layout .banner-placeholder__sub { font-size: 0.85rem; }

  /* --- Leagues strip: pill chips, smooth scroll --- */
  .cafetal777-layout .top-sticky {
    position: sticky;
    top: var(--mt-header-h);
    z-index: var(--ct-z-sticky);
    background: var(--ct777-dark, #0B0F14);
    margin-left: calc(-1 * var(--mt-gutter-md));
    margin-right: calc(-1 * var(--mt-gutter-md));
    padding: var(--mt-gutter-sm) var(--mt-gutter-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .cafetal777-layout .top-sticky::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 32px;
    background: linear-gradient(to left, var(--ct777-dark-soft, #111827) 0%, transparent 100%);
    pointer-events: none;
  }

  .cafetal777-layout .leagues-strip__scroll.sub-category-drawer,
  .cafetal777-layout .sub-category-drawer {
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--ct777-accent, #00D4FF) transparent;
    padding: 8px 12px;
    scroll-behavior: smooth;
  }

  .cafetal777-layout .leagues-strip__scroll.sub-category-drawer::-webkit-scrollbar,
  .cafetal777-layout .sub-category-drawer::-webkit-scrollbar {
    height: 6px;
  }

  .cafetal777-layout .leagues-strip__scroll .sub-category-drawer__list,
  .cafetal777-layout .sub-category-drawer__list {
    display: flex;
    flex-wrap: nowrap !important;
    gap: 10px;
    min-width: min-content;
    padding: 4px 0;
  }

  .cafetal777-layout .leagues-strip__scroll .sub-category-drawer__list li { flex-shrink: 0; }
  .leagues-strip__nav { display: flex; }

  .cafetal777-layout .sub-category-drawer__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    background: var(--ct777-dark-card, #1A2233);
    border: 1px solid var(--ct777-border, rgba(255, 255, 255, 0.1));
    color: var(--ct777-text-muted, rgba(255, 255, 255, 0.85));
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
  }

  .cafetal777-layout .sub-category-drawer__link:hover { background: rgba(255, 255, 255, 0.08); color: var(--ct777-text); }

  .cafetal777-layout .sub-category-drawer__link.active {
    background: var(--ct777-accent, #00D4FF);
    border-color: var(--ct777-accent);
    color: var(--ct777-dark, #0B0F14);
    font-weight: 600;
  }

  .cafetal777-layout .sub-category-drawer__flag-img { width: 22px; height: 22px; object-fit: contain; border-radius: 4px; }

  /* --- Game cards: stack, no horizontal scroll --- */
  .cafetal777-layout .sports-card {
    border-radius: var(--mt-radius);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--ct777-border, rgba(255, 255, 255, 0.08));
    margin-bottom: var(--mt-gutter-md);
    display: block !important;
  }

  .cafetal777-layout .sports-card-wrapper {
    min-width: 0 !important;
    flex-wrap: wrap !important;
    display: flex !important;
    flex-direction: column;
  }

  .cafetal777-layout .sports-card-left {
    width: 100% !important;
    min-width: 0 !important;
    border-inline-end: none;
    border-bottom: 1px solid var(--ct777-border, rgba(255, 255, 255, 0.08));
    padding: var(--mt-gutter-md);
  }

  .cafetal777-layout .sports-card-heading { margin-bottom: 8px; }

  .cafetal777-layout .sports-card__info-text,
  .cafetal777-layout .sports-card__stream { font-size: 12px; font-weight: 500; }
  .cafetal777-layout .sports-card__info-text:not(.empty) { color: var(--ct777-text-muted); }

  .cafetal777-layout .sports-card-body { padding: 0 var(--mt-gutter-md) var(--mt-gutter-md); }

  .cafetal777-layout .sports-card-left-bottom a { font-size: 12px; padding: 6px 0; display: inline-block; }

  .cafetal777-layout .sports-card__team { display: flex; align-items: center; gap: 10px; }
  .cafetal777-layout .sports-card__team-flag-img { width: 28px; height: 28px; object-fit: contain; }
  .cafetal777-layout .sports-card__team-name { font-size: 14px; font-weight: 600; color: var(--ct777-text); }

  .cafetal777-layout .sports-card-inner {
    min-width: 0 !important;
    width: 100% !important;
    flex: 1 1 auto;
    border-inline-end: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: var(--mt-gutter-sm) var(--mt-gutter-md);
  }

  .cafetal777-layout .sports-card-inner:last-child { border-bottom: none; }

  .cafetal777-layout .sports-card-top-inner.sports-card-heading .team-select-title { font-size: 13px; font-weight: 600; }
  .cafetal777-layout .option-odd-lists { display: flex; flex-wrap: wrap; gap: 8px; }

  /* --- Odds buttons: touch-friendly --- */
  .cafetal777-layout .oddBtn {
    min-height: var(--mt-touch);
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--mt-radius-sm);
    flex: 1 1 0;
    min-width: 70px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .cafetal777-layout .oddBtn:active { transform: scale(0.98); }
  .cafetal777-layout .oddBtn.active { box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.5); }

  /* --- Bet slip: full width / bottom sheet --- */
  .cafetal777-layout .betslip {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 85vh !important;
    max-height: 85vh !important;
    border-radius: var(--mt-radius) var(--mt-radius) 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    z-index: var(--ct-z-modal) !important;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex !important;
    flex-direction: column !important;
  }

  body.open-betslip .cafetal777-layout .betslip { transform: translateY(0); }

  .betslip-panel-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--ct-z-modal-backdrop);
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    animation: mt-fadeIn 0.2s ease;
  }

  body.open-betslip .betslip-panel-backdrop { display: block !important; }

  @keyframes mt-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .cafetal777-layout .betslip-header {
    flex-shrink: 0;
    padding: var(--mt-gutter-md);
    border-bottom: 1px solid var(--ct777-border);
  }

  .betslip-header__row .betslip-close-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--mt-radius-sm);
  }

  .cafetal777-layout .betslip-header .bet-type__btn {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: var(--mt-radius-sm);
  }

  .cafetal777-layout .bet-slip-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Instant Bet Widget Responsive */
  .widget-box.instant-bet-widget { padding: 16px !important; margin-top: 16px !important; }
  .instant-bet-title { font-size: 1.25rem !important; margin-bottom: 16px !important; }
  .instant-bet-btn { padding: 10px 20px !important; font-size: 0.9rem !important; }

  /* --- Bottom navigation: premium bar --- */
  .app-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--mt-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--ct777-dark-soft, #111827) !important;
    border-top: 2px solid rgba(0, 212, 255, 0.25);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
    z-index: var(--ct-z-fixed);
    align-items: center;
    justify-content: center;
  }

  .app-nav .container-fluid { max-width: 100%; padding-inline-start: 8px; padding-inline-end: 8px; }

  .app-nav__menu {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    width: 100%;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .app-nav__menu li { flex: 1; display: flex; justify-content: center; align-items: stretch; max-width: 80px; }

  .app-nav__menu-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px 10px;
    min-height: var(--mt-touch);
    color: var(--ct777-text-muted);
    text-decoration: none;
    border-radius: var(--mt-radius-sm);
    transition: color 0.2s, background 0.2s;
    width: 100%;
  }

  .app-nav__menu-link:hover { color: var(--ct777-text); }
  .app-nav__menu-link.active { color: var(--ct777-accent) !important; }

  .app-nav__menu-link.active .app-nav__menu-icon,
  .app-nav__menu-link.active .app-nav__menu-text {
    color: var(--ct777-accent) !important;
  }

  .app-nav__menu-icon { font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center; }
  .app-nav__menu-icon img { height: 22px; width: auto; }
  .app-nav__menu-text { font-size: 10px; font-weight: 500; line-height: 1.2; }

  .app-nav__menu-link-important-container { max-width: 64px; flex: 0 0 auto; }

  .app-nav__menu-link-important {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.25rem !important;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4) !important;
  }

  .app-nav__menu-link.open-betslip { position: relative; }

  .app-nav__menu-link .bet-count {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translate(50%, 0);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* --- app-nav__drawer --- */
  .app-nav__drawer {
    position: fixed !important;
    left: -400px !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 300px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    transform: none !important;
    z-index: var(--ct-z-sidebar);
    visibility: hidden;
    transition: left 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
  }

  .app-nav__drawer.active-sidebar {
    left: 0 !important;
    visibility: visible;
  }

  /* --- Footer: compact --- */
  .cafetal777-layout .footer-ct777,
  .cafetal777-layout .footer--light {
    padding: var(--mt-gutter-lg) var(--mt-gutter-md);
  }

  .cafetal777-layout .footer-ct777__grid { gap: var(--mt-gutter-lg); }

  .cafetal777-layout .footer-bottom-ct777__inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .cafetal777-layout .footer-compliance__text,
  .cafetal777-layout .footer-legal__text { font-size: 12px; }

  .cafetal777-layout .footer-legal-links { flex-wrap: wrap; justify-content: center; gap: 8px; }

  .cafetal777-layout .footer-bottom-ct777__crypto {
    font-size: 12px;
    padding: 10px;
    text-align: center;
  }

  .cafetal777-layout .footer-bottom-ct777__crypto span { display: block; }

  /* --- Empty state --- */
  .cafetal777-layout .empty-message { padding: var(--mt-gutter-lg) var(--mt-gutter-md); text-align: center; }
  .cafetal777-layout .empty-message img { max-width: 200px; margin-bottom: var(--mt-gutter-md); }
  .cafetal777-layout .empty-message p { font-size: 15px; color: var(--ct777-text-muted); }

  /* --- User dashboard --- */
  .user-dashboard .container { max-width: 100%; padding-inline-start: 12px; padding-inline-end: 12px; }
  .dashboard-wrapper { flex-direction: column; }
  .dashboard-right { width: 100%; min-width: 0; padding: 0; }

  /* Clear fixed bottom app-nav (hidden ≥992px in main.css) */
  .cafetal777-layout .user-dashboard {
    padding-bottom: calc(var(--mt-nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
  }

  .dashboard-sidebar__close {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.65) !important;
  }

  .dashboard-sidebar__close:hover,
  .dashboard-sidebar__close:focus-visible {
    color: var(--ct777-accent, #00d4ff) !important;
  }

  .widget-card__head .widget-card__id {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Bet slip footer: stack on narrow screens (prevents horizontal squeeze) */
  .cafetal777-layout .betslip .list.betslip__footer-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    min-width: 0;
  }

  .cafetal777-layout .betslip .betslip-right {
    width: 100%;
    min-width: 0;
    padding-inline: 0;
  }

  .cafetal777-layout .betslip .betslip__footer .betslip-select {
    margin-bottom: 0 !important;
  }

  .cafetal777-layout .betslip .bet-return {
    text-align: start;
    word-break: break-word;
  }

  .cafetal777-layout .betslip .stake-presets {
    justify-content: flex-start;
  }

  /* Mobile menu dropdown: never wider than viewport */
  .header-mobile-dropdown {
    max-width: min(320px, calc(100vw - 16px));
  }

  /* FAB sits above fixed bottom app-nav (same stacking context as --ct-z-fixed) */
  .cafetal777-layout .betslip-fab {
    bottom: calc(var(--mt-nav-h) + env(safe-area-inset-bottom, 0px) + 10px);
    z-index: calc(var(--ct-z-fixed, 300) + 25);
  }
}


/* ==========================================================================
   MOBILE (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .cafetal777-layout {
    --mt-gutter-sm: 10px;
    --mt-gutter-md: 12px;
    --mt-gutter-lg: 16px;
  }

  .cafetal777-layout .header-primary .container-fluid {
    padding-inline-start: var(--mt-gutter-md);
    padding-inline-end: var(--mt-gutter-md);
  }

  .cafetal777-layout .header-fluid-custom-parent { padding: 8px 0; }
  .cafetal777-layout .logo-text-brand { font-size: 1.1rem; }

  /* Hide odds dropdown on small mobile */
  .cafetal777-layout .right-side-nav .select-lang--container { display: none; }

  .cafetal777-layout .sports-body {
    padding: var(--mt-gutter-md) var(--mt-gutter-md) calc(var(--mt-nav-h) + 16px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .sports-category,
  .cafetal777-layout .sports-category {
    width: 90% !important;
    max-width: 280px !important;
  }

  /* Stats strip compact */
  .sports-category__stats-row { justify-content: center; gap: 6px; flex-wrap: wrap; }
  .sports-category__stats-item { font-size: 11px; }
  .sports-category__stats-value { min-width: 1em; }

  /* Premium sidebar on mobile */
  .sports-category--premium .sports-category__link--category {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    text-align: start !important;
    padding: 12px 40px 12px 12px !important;
    min-height: 48px !important;
    max-height: none !important;
    flex: none !important;
    gap: 10px !important;
  }

  .sports-category--premium .sports-category__link--category .sports-category__icon { flex-shrink: 0 !important; width: 28px !important; height: 28px !important; font-size: 1.1rem !important; }
  .sports-category--premium .sports-category__link--category .sports-category__label-wrap { flex: 1 !important; min-width: 0 !important; display: flex !important; flex-direction: column !important; gap: 3px !important; }
  .sports-category--premium .sports-category__link--category .sports-category__text { font-size: 13px !important; text-align: start !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
  .sports-category--premium .sports-category__link--category .sports-category__counts { font-size: 10px !important; gap: 6px !important; }
  .sports-category--premium .sports-category__link--category .sports-category__count { gap: 2px !important; }
  .sports-category--premium .sports-category__link--category .sports-category__count i { font-size: 9px !important; }
  .sports-category--premium .sports-category__link--category .sports-category__pin { position: absolute !important; right: 8px !important; top: 50% !important; transform: translateY(-50%) !important; width: 28px !important; height: 28px !important; font-size: 14px !important; }
  .sports-category--premium .sports-category__link.live-btn { display: flex !important; flex-direction: row !important; align-items: center !important; text-align: start !important; padding: 12px 14px !important; flex: none !important; max-height: none !important; }
  .sports-category--premium .sports-category__stats { margin: 0 8px 10px !important; padding: 10px !important; }
  .sports-category--premium .sports-category__list { flex: 1 !important; min-height: 0 !important; overflow-y: auto !important; overflow-x: hidden !important; padding: 10px 8px 20px !important; }
  .sports-category--premium .sports-category__heading { padding: 12px 10px 8px !important; }

  /* Block titles */
  .sports-category__block-title { font-size: 11px; padding: 6px 8px 4px; }
  .sports-category__game-link { font-size: 11px !important; padding: 5px 6px 5px 4px !important; }
  .sports-category__game-count { font-size: 10px; }

  /* Banner */
  .cafetal777-layout .banner-slider--hero { min-height: 100px; }
  .cafetal777-layout .banner-placeholder { min-height: 100px; padding: 16px 12px; }
  .cafetal777-layout .banner-slider__nav.navDots { bottom: 6px; }

  .cafetal777-layout .top-sticky { padding: 8px var(--mt-gutter-md); }
  .cafetal777-layout .sub-category-drawer__link { padding: 8px 14px; font-size: 12px; }

  .cafetal777-layout .sports-card-left,
  .cafetal777-layout .sports-card-body { padding: var(--mt-gutter-md); }
  .cafetal777-layout .sports-card-inner { padding: var(--mt-gutter-sm) var(--mt-gutter-md); }

  .cafetal777-layout .oddBtn { min-height: 46px; padding: 10px 14px; font-size: 14px; }

  /* Odds buttons: touch-friendly min height */
  .cafetal777-layout .option-odd-list__item .oddBtn,
  .option-odd-list__item .oddBtn { min-height: 44px; padding: 10px 12px; font-size: 13px; }

  /* Footer text */
  .cafetal777-layout .footer-ct777__title { font-size: 13px; }
  .cafetal777-layout .footer-ct777__about,
  .cafetal777-layout .footer-ct777__link { font-size: 12px; }

  /* Bottom nav */
  .app-nav { padding: 8px 4px max(8px, env(safe-area-inset-bottom)); }
  .app-nav__menu { gap: 4px; }
  .app-nav__menu-link, .app-nav__menu-link-important { flex: 1; min-width: 0; flex-direction: column; gap: 4px; padding: 6px 4px; }
  .app-nav__menu-icon { font-size: 20px; }
  .app-nav__menu-link-important .fa-bars { font-size: 1.35rem; }
  .app-nav__menu-text { font-size: 9px; }
  .app-nav__menu-link .bet-count { top: 2px; right: 50%; transform: translate(50%, 0); min-width: 18px; height: 18px; font-size: 10px; }

  /* Dashboard */
  .user-dashboard .container { padding-inline-start: 10px; padding-inline-end: 10px; }
  .card.custom--card .card-body { padding: 1rem; }
  .deposit-empty-state { padding: 1.5rem 1rem; margin: 0; }
  .deposit-empty-state__icon { font-size: 2.5rem; }
  .deposit-empty-state__title { font-size: 1.1rem; }
  .deposit-empty-state__text { font-size: 0.85rem; }
  .deposit-empty-state .btn { display: block; width: 100%; margin-left: 0 !important; margin-right: 0 !important; margin-top: 8px !important; }
  .payment-system-list.is-scrollable { max-height: min(400px, 60vh); }
  .payment-item { min-height: 44px; }

  /* Odd list (markets page) */
  .odd-list__head { flex-wrap: wrap; gap: 8px; }
  .odd-list__team-name { font-size: 11px; }
  .odd-list__outcome.oddBtn { min-height: 44px; padding: 10px 12px; width: 100%; }
  .odd-list__outcomes li { flex-direction: column; align-items: stretch; }
  .odd-list__outcome-text { margin-bottom: 8px; }

  /* Touch targets: WCAG minimum 44px (exclude text/number fields — layout + iOS zoom handled separately) */
  button:not(.stake-preset-btn):not(.dashboard-sidebar__close),
  a.btn,
  .btn:not(.stake-preset-btn),
  [role="button"],
  select,
  input[type="checkbox"],
  input[type="radio"] { min-height: 44px; min-width: 44px; }

  .stake-preset-btn {
    min-height: 44px;
    min-width: 40px;
    touch-action: manipulation;
  }

  /* iOS: avoid focus-zoom on stake inputs */
  .cafetal777-layout .betslip input#total_invest,
  .cafetal777-layout .betslip input.amount,
  .cafetal777-layout .betslip .investAmount {
    font-size: 16px !important;
  }

  /* Dashboard title row: avoid overflow on small screens */
  .dashboard-right > .d-flex.justify-content-between.gap-3 {
    flex-wrap: wrap;
    min-width: 0;
  }

  .dashboard-right > .d-flex.justify-content-between.gap-3 > h5 {
    min-width: 0;
    word-break: break-word;
  }
}


/* ==========================================================================
   SMALL PHONES (max-width: 576px)
   ========================================================================== */
@media (max-width: 576px) {
  .cafetal777-layout {
    --mt-gutter-sm: 8px;
    --mt-gutter-md: 10px;
    --mt-gutter-lg: 14px;
    --mt-nav-h: 52px;
    --mt-header-h: 48px;
  }

  .cafetal777-layout .header-primary { min-height: var(--mt-header-h); }
  .cafetal777-layout .header-primary .container-fluid { padding-inline-start: 10px; padding-inline-end: 10px; }
  .cafetal777-layout .header-fluid-custom-parent { min-height: var(--mt-header-h); }

  .cafetal777-layout .logo { max-width: 110px; min-width: 70px; }
  .cafetal777-layout .logo-text-brand { font-size: 0.95rem; }

  .cafetal777-layout .sports-body {
    padding: var(--mt-gutter-md) var(--mt-gutter-sm) calc(var(--mt-nav-h) + 12px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .cafetal777-layout .sports-card-heading,
  .cafetal777-layout .team-select-title { font-size: 11px; }

  .cafetal777-layout .sports-card__info-text,
  .cafetal777-layout .sports-card__stream { font-size: 11px; }

  .cafetal777-layout .banner-slider--hero { min-height: 90px; }
  .cafetal777-layout .banner-placeholder__text { font-size: 0.85rem; letter-spacing: 0.1em; }

  .cafetal777-layout .top-sticky { top: var(--mt-header-h); padding: 6px var(--mt-gutter-sm); }
  .cafetal777-layout .sub-category-drawer__link { padding: 6px 12px; font-size: 11px; }
  .cafetal777-layout .sub-category-drawer__flag-img { width: 18px; height: 18px; }

  .cafetal777-layout .sport-hub__tabs--pills .sport-hub__tab { padding: 8px 12px; font-size: 0.8rem; }
  .cafetal777-layout .sport-table-desktop .sport-table--creative { min-width: 560px; }

  .cafetal777-layout .sport-table__th,
  .cafetal777-layout .sport-table__cell { padding: 8px 6px; font-size: 0.75rem; }

  .cafetal777-layout .sport-table__cell--odd .oddBtn { min-width: 40px; min-height: 40px; padding: 6px 8px; font-size: 0.85rem; }

  .cafetal777-layout .sports-card { border-radius: 10px; margin-bottom: var(--mt-gutter-md); }
  .cafetal777-layout .oddBtn { min-width: 64px; font-size: 13px; }

  .cafetal777-layout .footer-ct777__grid,
  .footer-ct777__grid { grid-template-columns: 1fr; gap: 16px; }

  .cafetal777-layout .footer-bottom-ct777__copy,
  .cafetal777-layout .footer-bottom-ct777__tip,
  .footer-bottom-ct777__copy,
  .footer-bottom-ct777__tip { font-size: 11px; }

  .footer-bottom-ct777__inner { flex-direction: column; text-align: center; gap: 8px; }

  .cafetal777-layout .footer-ct777__title { font-size: 13px; }
  .cafetal777-layout .footer-ct777__about,
  .cafetal777-layout .footer-ct777__link { font-size: 12px; }

  .container-fluid { padding-inline-start: 10px; padding-inline-end: 10px; }

  /* Dashboard */
  .user-dashboard .container { padding-inline-start: 8px; padding-inline-end: 8px; }
  .deposit-info__input-group .form--control { font-size: 16px; /* prevents zoom on iOS */ }

  /* Smart features: slip presets */
  .slip-stake-presets { gap: 6px; }
  .slip-stake-preset { min-height: 44px; }
  .slip-smart-stats { flex-direction: column; align-items: flex-start; }
  .first-time-hint { bottom: 80px; left: 12px; right: 12px; transform: none; max-width: none; }

  /* Extra compact sidebar on small phones */
  .sports-category--premium .sports-category__link--category { padding: 10px 36px 10px 10px !important; min-height: 44px !important; }
  .sports-category--premium .sports-category__link--category .sports-category__text { font-size: 12px !important; }
  .sports-category--premium .sports-category__link--category .sports-category__counts { font-size: 9px !important; gap: 4px !important; }
  .sports-category--premium .sports-category__stats { padding: 8px !important; margin: 0 6px 8px !important; }
  .sports-category--premium .sports-category__stats-item { font-size: 10px !important; }

  /* Bet slip tabs: allow shrink next to close control */
  .cafetal777-layout .betslip-header__segment .list-group.bet-type {
    min-width: 0;
  }
}


/* ==========================================================================
   TABLET LANDSCAPE (768px–991px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 991px) {
  .cafetal777-layout .sports-body .row.g-3 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
  }

  .cafetal777-layout .betting-body--hub .sport-hub__content { grid-template-columns: 1fr; }

  .cafetal777-layout .sport-hub__sidebar {
    border-inline-start: none;
    border-top: 1px solid var(--ct777-border);
  }

  .cafetal777-layout .sport-table-desktop {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .cafetal777-layout .sport-table-desktop .sport-table--creative { min-width: 600px; }
}
