@media (max-width: 968px) {
  .layout-wrapper { grid-template-columns: 1fr; }
  .sidebar { order: -1; display: none; }
  .casino-body { grid-template-columns: 1fr; }
  .review-pros-cons { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .main-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--dark); flex-direction: column; padding: 20px; gap: 12px;
  }
  .main-nav.active { display: flex; }
  .nav-toggle { display: block; }
  .search-box { display: none; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 14px; }
  .hero-actions { flex-direction: column; }
  .casino-hero { flex-direction: column; align-items: flex-start; }
  .casino-hero__right { align-items: flex-start; width: 100%; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  
  .compliance-logos { gap: 12px; }
  .compliance-logos img { height: 32px; }
  .responsible-gambling-link { font-size: 12px; }

}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .casino-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 24px; }
  .hero h1 { font-size: 24px; }
  .info-card dl { grid-template-columns: 1fr; }
  .info-card dd { text-align: left; }
}


/* =====================================================
   PHASE H: MOBILE OPTIMIZATION
   ===================================================== */

/* ---- Global Mobile Tweaks ---- */
@media (max-width: 768px) {
  html {
    scroll-behavior: smooth;
    text-size-adjust: 100%;
  }

  body {
    overscroll-behavior-y: contain;
    padding-bottom: 56px; /* Space for bottom nav */
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  /* Touch-friendly inputs */
  .form-group input,
  .form-group select,
  .form-group textarea,
  .admin-form input,
  .admin-form select,
  .admin-form textarea {
    min-height: 44px;
    font-size: 16px; /* Prevents iOS zoom */
  }

  .btn {
    min-height: 44px;
    padding: 10px 18px;
  }

  .btn--sm {
    min-height: 36px;
  }

  /* Better tap targets for table action buttons */
  .table-actions {
    gap: 6px;
  }

  .table-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* ---- Mobile Bottom Navigation ---- */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    justify-content: space-around;
    align-items: center;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(12px);
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    z-index: 999;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s;
    flex: 1;
    min-width: 0;
    border-radius: 8px;
  }

  .mobile-nav-item:hover {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
  }

  .mobile-nav-item.active {
    color: var(--primary);
  }

  .mobile-nav-icon {
    font-size: 20px;
    line-height: 1;
  }

  .mobile-nav-label {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* Hide bottom nav on admin/dashboard pages */
}

/* ---- Swipeable Casino Cards ---- */
@media (max-width: 768px) {
  .casino-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .casino-grid::-webkit-scrollbar {
    display: none;
  }

  .casino-grid > .casino-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    min-width: 280px;
  }

  /* Edge fade indicators */
  .casino-grid-wrapper {
    position: relative;
  }

  .casino-grid-wrapper::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 16px;
    width: 40px;
    background: linear-gradient(to right, transparent, var(--bg));
    pointer-events: none;
    z-index: 1;
  }

  .casino-grid-wrapper::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 16px;
    width: 40px;
    background: linear-gradient(to left, transparent, var(--bg));
    pointer-events: none;
    z-index: 1;
  }

  /* Swipe hint pulse on first card */
  .casino-grid > .casino-card:first-child {
    animation: swipeHint 2s ease-out 1s 1;
  }

  @keyframes swipeHint {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-8px); }
  }
}

/* ---- Sticky Mobile CTA ---- */
.mobile-sticky-cta {
  display: none;
}

@media (max-width: 768px) {
  .mobile-sticky-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    bottom: 56px;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    background: var(--white);
    padding: 10px 16px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
    z-index: 998;
    gap: 12px;
    border-top: 1px solid var(--light-gray);
  }

  .mobile-cta-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
  }

  .mobile-cta-logo {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
  }

  .mobile-cta-info > div {
    min-width: 0;
  }

  .mobile-cta-info strong {
    display: block;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-cta-info span {
    display: block;
    font-size: 12px;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-cta-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-cta-btn {
    flex-shrink: 0;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 700;
  }

  /* Hide sticky CTA on admin pages */
  body:has(.admin-wrapper) .mobile-sticky-cta {
    display: none;
  }
}

/* ---- Scroll to Top Button ---- */
.scroll-to-top {
  display: none;
  position: fixed;
  bottom: 70px;
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  border: none;
  font-size: 20px;
  cursor: pointer;
  z-index: 997;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  align-items: center;
  justify-content: center;
}

.scroll-to-top.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 769px) {
  .scroll-to-top {
    bottom: 24px;
  }
}

/* ---- Improved Mobile Typography ---- */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 26px;
    line-height: 1.3;
  }

  .hero p {
    font-size: 15px;
  }

  .section {
    padding: 30px 0;
  }

  .section-header h2 {
    font-size: 22px;
  }

  .casino-card__body h3 {
    font-size: 16px;
  }

  .review-header h1 {
    font-size: 24px;
  }

  .news-header h1 {
    font-size: 24px;
  }

  .info-block {
    padding: 16px;
  }

  .casino-hero {
    padding: 20px;
  }

  .casino-hero__logo {
    width: 60px;
    height: 60px;
  }

  .bonus-amount {
    font-size: 18px;
  }
}

/* ---- Mobile Admin Table Improvements ---- */
@media (max-width: 768px) {
  .admin-table {
    font-size: 13px;
  }

  .admin-table th {
    padding: 8px 10px;
    font-size: 11px;
  }

  .admin-table td {
    padding: 8px 10px;
  }

  .admin-content {
    padding: 16px;
  }

  .admin-form {
    padding: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 24px;
  }

  .stat-icon {
    font-size: 24px;
  }
}

/* ---- Mobile Sidebar Hidden, Content Full Width ---- */
@media (max-width: 968px) {
  .layout-wrapper {
    grid-template-columns: 1fr;
    gap: 0;
    margin: 16px auto;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    width: 100%;
  }
}

/* ---- Mobile Casino Body Layout ---- */
@media (max-width: 768px) {
  .casino-body {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .casino-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .casino-aside .info-card {
    margin-bottom: 0;
  }
}

/* ---- Mobile Review Pros/Cons ---- */
@media (max-width: 768px) {
  .review-pros-cons {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .review-summary-table th {
    width: 120px;
    font-size: 13px;
  }

  .review-summary-table td {
    font-size: 13px;
  }
}

/* ---- Mobile Footer ---- */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding-bottom: 24px;
  }

  .footer-col h4 {
    font-size: 12px;
  }

  .footer-col a {
    font-size: 12px;
  }

  .compliance-logos {
    gap: 10px;
  }

  .compliance-logos img {
    height: 28px !important;
  }

  .footer-compliance-box {
    padding: 20px 0 16px;
    margin-bottom: 20px;
  }

  .rg-text {
    font-size: 12px;
  }

  .disclaimer-text {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .casino-aside {
    grid-template-columns: 1fr;
  }
}

/* ---- Mobile Nav Toggle (Hamburger) ---- */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
  }

  .main-nav.active {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--dark);
    padding: 16px 20px;
    gap: 4px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

  .main-nav.active a {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 15px;
  }

  .main-nav.active a:hover {
    background: rgba(255, 255, 255, 0.08);
  }
}

/* ---- Mobile Search ---- */
@media (max-width: 768px) {
  .search-box {
    display: none !important;
  }

  .mobile-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
  }

  .mobile-search-container.active {
    padding: 12px 16px;
  }

  .mobile-search-container input {
    font-size: 16px; /* Prevents iOS zoom */
    min-height: 44px;
  }

  .search-results,
  .mobile-search-results {
    font-size: 14px;
  }

  .search-result-item {
    padding: 12px 14px;
    min-height: 44px;
  }
}

/* ---- Mobile Auth Pages ---- */
@media (max-width: 768px) {
  .auth-card {
    padding: 24px 20px;
    border-radius: 16px;
    margin: 0 16px;
  }

  .auth-card h1 {
    font-size: 24px;
  }
}

/* ---- Mobile News Cards ---- */
@media (max-width: 768px) {
  .news-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .news-grid::-webkit-scrollbar {
    display: none;
  }

  .news-grid > .news-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    min-width: 280px;
  }
}

/* ---- Mobile Features Grid ---- */
@media (max-width: 768px) {
  .features-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .features-grid::-webkit-scrollbar {
    display: none;
  }

  .features-grid > .feature-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
    min-width: 240px;
  }
}

/* ---- Mobile Category/Country Chips ---- */
@media (max-width: 768px) {
  .country-chips,
  .category-list {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .country-chips::-webkit-scrollbar,
  .category-list::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* ---- Pull-to-Refresh Feel ---- */
@media (max-width: 768px) {
  body {
    overscroll-behavior-y: contain;
  }
}

/* ---- Mobile Casino Card Refinements ---- */
@media (max-width: 768px) {
  .casino-card {
    border-radius: 14px;
  }

  .casino-card__header {
    padding: 12px;
  }

  .casino-card__logo {
    width: 40px;
    height: 40px;
  }

  .casino-card__body {
    padding: 0 12px 12px;
  }

  .casino-card__actions {
    padding: 0 12px 12px;
    gap: 6px;
  }

  .casino-card__actions .btn {
    font-size: 13px;
    padding: 8px 12px;
  }

  .geo-badge {
    width: 32px;
    height: 32px;
    top: 6px;
    right: 6px;
  }

  .geo-badge__flag {
    font-size: 22px;
  }

  .geo-badge__icon {
    font-size: 14px;
  }
}


html,
body {
  max-width: 100%;
  overflow-x: clip;
}

* {
  box-sizing: border-box;
}

img,
video,
iframe,
table,
pre,
code {
  max-width: 100%;
}
