/* ==========================================================================
   MJL Public Website — Responsive System
   Desktop 1200+ | Laptop ≤1199 | Tablet ≤1023 | Mobile ≤767 | Small ≤480
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
svg,
canvas {
  max-width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   Mobile nav toggle (hidden on desktop)
   -------------------------------------------------------------------------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(0, 255, 136, 0.22);
  border-radius: 12px;
  background: rgba(7, 17, 11, 0.82);
  cursor: pointer;
  z-index: 1202;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  border-radius: 999px;
  background: #00FF88;
  transition: transform 180ms ease, opacity 180ms ease;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1198;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.nav-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

body.nav-open {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Laptop ≤1199px
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) and (min-width: 1024px) {
  .container,
  .nav {
    width: min(1400px, calc(100% - 32px));
  }

  .games-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }

  .home-hero-title {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
  }

  .v2-hero,
  .home-shot-hero {
    padding: 100px 0 60px;
  }
}

@media (max-width: 1199px) {
  .container,
  .nav {
    width: min(1400px, calc(100% - 32px));
  }
}

/* --------------------------------------------------------------------------
   Tablet ≤1023px
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) and (min-width: 768px) {
  .games-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .v2-header {
    height: auto;
    min-height: 72px;
  }

  .v2-nav {
    min-height: 72px;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
  }

  .v2-nav-center {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .v2-nav-center::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .games-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .games-hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
  }

  .pricing-grid,
  .gallery-grid,
  .tournament-grid,
  .events-grid,
  .feature-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid,
  .level-hero-grid,
  .contact-grid,
  .form-grid,
  .two-col-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Mobile ≤767px
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .container,
  .nav {
    width: min(1400px, calc(100% - 24px));
  }

  .v2-nav {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
  }

  .nav-toggle {
    display: flex;
  }

  .site-header.is-nav-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header.is-nav-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  .site-header.is-nav-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-links.v2-nav-center {
    position: fixed;
    top: 72px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 0;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(7, 11, 10, 0.98);
    border-top: 1px solid rgba(0, 255, 136, 0.12);
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 220ms ease, opacity 220ms ease, visibility 220ms ease;
  }

  .site-header.is-nav-open .nav-links.v2-nav-center {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links a {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 0.82rem;
  }

  .login-btn,
  .book-now-btn {
    min-height: 40px;
    padding-inline: 14px;
    font-size: 0.78rem;
  }

  .v2-hero,
  .home-shot-hero,
  .games-hero {
    min-height: auto;
    padding: 88px 0 48px;
  }

  .home-hero-title,
  .hero h1,
  .games-hero-title {
    font-size: clamp(1.8rem, 8vw, 2.6rem);
    line-height: 1.05;
  }

  .hero-copy p,
  .games-hero-subtitle,
  .section-lead {
    font-size: 0.95rem;
  }

  .hero-actions,
  .cta-row,
  .button-row {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .hero-actions .btn,
  .cta-row .btn,
  .button-row .btn,
  .games-request-card .btn,
  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .games-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .games-catalog-controls,
  .games-toolbar,
  .games-category-pills {
    width: 100%;
  }

  .games-category-pills {
    flex-wrap: wrap;
  }

  .games-category-pills button {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  .game-library-card,
  .pricing-card,
  .gallery-tile,
  .glass-card,
  .event-card {
    min-width: 0;
    overflow: hidden;
  }

  .game-cover,
  .game-cover.has-image,
  .game-cover.is-placeholder {
    min-width: 0;
  }

  .game-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .pricing-grid,
  .gallery-grid,
  .tournament-grid,
  .events-grid,
  .feature-grid,
  .stats-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .application-grid,
  .contact-form-grid,
  .field-row,
  .form-row {
    grid-template-columns: 1fr !important;
  }

  .form-control,
  input,
  select,
  textarea {
    font-size: 16px;
    min-height: 44px;
  }

  textarea.form-control {
    min-height: 120px;
  }

  .site-footer {
    padding: 40px 0 24px;
  }

  .game-modal,
  .lightbox-panel {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }
}

/* --------------------------------------------------------------------------
   Small phones ≤480px
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .container,
  .nav {
    width: calc(100% - 20px);
  }

  .v2-logo {
    font-size: 1.05rem;
  }

  .v2-logo::before {
    width: 10px;
    height: 10px;
    margin-right: 8px;
  }

  .login-btn,
  .book-now-btn {
    padding-inline: 12px;
  }

  .games-category-pills button {
    flex-basis: 100%;
  }

  .section-title,
  .page-title {
    font-size: clamp(1.35rem, 6vw, 1.8rem);
  }

  .toast-stack {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
}
