/* Bet X Run — mobile UI (layout Pinco, palette: green / red / platinum) */
@media (max-width: 768px) {
  :root {
    --mobile-nav-h: calc(68px + env(safe-area-inset-bottom, 0px));
    --mobile-head-h: 56px;
  }

  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    background: var(--bg0);
    color: var(--text);
    padding-bottom: var(--mobile-nav-h);
    overflow-x: hidden;
  }

  body.has-mobile-nav {
    padding-bottom: var(--mobile-nav-h);
  }

  .wrap {
    padding-left: 14px;
    padding-right: 14px;
  }

  /* hide desktop clutter */
  .topbar {
    display: none;
  }

  .bg-grid {
    opacity: 0.04;
  }

  /* ——— compact header ——— */
  header.main-head {
    top: 0;
    background: rgba(10, 11, 18, 0.96);
    border-bottom: 1px solid rgba(226, 232, 240, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  }

  .head-inner {
    padding: 8px 12px;
    gap: 10px;
    min-height: var(--mobile-head-h);
  }

  .logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .logo-type .logo-wordmark {
    font-size: 1.15rem;
  }

  .logo-type .logo-x {
    font-size: 1.85em;
  }

  .logo-type .club {
    font-size: 8px;
    letter-spacing: 0.28em;
  }

  .nav-toggle,
  nav.main-nav {
    display: none !important;
  }

  .head-actions {
    flex: 1;
    justify-content: flex-end;
    gap: 6px;
  }

  .head-actions .btn {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 13px;
  }

  .head-actions .btn span {
    display: inline;
  }

  .auth-user-email {
    display: none;
  }

  .auth-balance {
    font-size: 11px;
    padding: 8px 10px;
    background: rgba(253, 224, 71, 0.1);
    border-color: rgba(253, 224, 71, 0.28);
    color: #fde68a;
  }

  .head-auth-logged {
    gap: 6px;
  }

  /* ——— bottom navigation (Pinco) ——— */
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    gap: 0;
    min-height: 56px;
    padding: 0 2px calc(env(safe-area-inset-bottom, 0px));
    background: #0a0b12;
    border-top: 1px solid rgba(226, 232, 240, 0.1);
    box-shadow: 0 -1px 0 rgba(253, 224, 71, 0.06);
  }

  .mobile-bottom-nav .mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-height: 56px;
    padding: 8px 2px 10px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-align: center;
    text-decoration: none;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
  }

  .mobile-bottom-nav .mob-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    color: inherit;
  }

  .mobile-bottom-nav .mob-nav-icon svg {
    width: 24px;
    height: 24px;
    display: block;
  }

  .mobile-bottom-nav .mob-nav-label {
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bottom-nav .mob-nav-item.active {
    color: var(--green);
  }

  .mobile-bottom-nav .mob-nav-item.active .mob-nav-icon {
    color: var(--green);
    filter: drop-shadow(0 0 8px var(--green-glow));
  }

  .mobile-bottom-nav .mob-nav-item:active {
    opacity: 0.85;
  }

  /* центральная кнопка «Казино» как у Pinco */
  .mobile-bottom-nav .mob-nav-center {
    justify-content: flex-end;
    padding-bottom: 6px;
    gap: 2px;
  }

  .mobile-bottom-nav .mob-nav-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-top: -22px;
    margin-bottom: 2px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(180deg, #fb7185 0%, var(--red) 48%, var(--red-d) 100%);
    border: 3px solid #0a0b12;
    box-shadow:
      0 8px 24px rgba(244, 63, 94, 0.45),
      0 0 0 1px rgba(253, 224, 71, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .mobile-bottom-nav .mob-nav-fab svg {
    width: 26px;
    height: 26px;
    stroke: #fff;
  }

  .mobile-bottom-nav .mob-nav-center .mob-nav-label {
    color: #94a3b8;
    font-weight: 700;
  }

  .mobile-bottom-nav .mob-nav-center.active .mob-nav-label {
    color: var(--green);
  }

  .mobile-bottom-nav .mob-nav-center.active .mob-nav-fab {
    transform: scale(1.04);
    box-shadow:
      0 10px 32px rgba(244, 63, 94, 0.55),
      0 0 0 1px rgba(253, 224, 71, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }

  .mobile-bottom-nav .mob-nav-center:active .mob-nav-fab {
    transform: scale(0.96);
  }

  /* ——— hero ——— */
  .hero {
    padding: 16px 0 4px;
  }

  .hero-card {
    padding: 18px 16px 16px;
    border-radius: 16px;
    border-color: rgba(226, 232, 240, 0.12);
  }

  .hero-card::before {
    background: linear-gradient(
      125deg,
      rgba(244, 63, 94, 0.55) 0%,
      rgba(253, 224, 71, 0.4) 28%,
      rgba(241, 245, 249, 0.25) 42%,
      transparent 55%,
      rgba(52, 211, 153, 0.45) 100%
    );
  }

  .hero-kicker {
    font-size: 10px;
    margin-bottom: 8px;
    color: #a7f3d0;
  }

  .hero h1 {
    font-size: 1.45rem;
    line-height: 1.15;
    margin-bottom: 10px;
  }

  .hero-lead {
    font-size: 14px;
    line-height: 1.5;
    max-width: none;
    margin-bottom: 14px;
  }

  .hero-cta {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }

  .hero-cta .btn {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
    border-radius: 14px;
  }

  .hero-note {
    font-size: 12px;
    border-color: var(--gold);
    padding-left: 10px;
    line-height: 1.45;
  }

  .hero-side {
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .hero-side::-webkit-scrollbar {
    display: none;
  }

  .jackpot-tile,
  .stat-grid {
    flex: 0 0 min(78vw, 280px);
    scroll-snap-align: start;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    min-width: min(78vw, 280px);
  }

  .jackpot-tile .sum {
    font-size: 22px;
  }

  /* ——— sections ——— */
  section.block {
    padding: 14px 0 6px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 12px;
  }

  .section-head h2 {
    font-size: 1.1rem;
  }

  .section-head p {
    font-size: 13px;
  }

  .link-more {
    font-size: 13px;
    padding: 8px 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* casino / sport split cards */
  .casino-sport-split,
  .casino-sport-split-3 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .split-card {
    padding: 16px;
    min-height: auto;
    border-radius: 14px;
    border-color: rgba(255, 255, 255, 0.08);
  }

  .split-card-actions {
    flex-direction: column;
  }

  .split-card-actions .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  /* game grid — 2 columns like Pinco */
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .game-card {
    min-height: 0;
    border-radius: 12px;
  }

  .game-card .thumb {
    height: 110px;
  }

  .game-card .meta b {
    font-size: 13px;
  }

  .game-card .meta span {
    font-size: 11px;
  }

  /* live — horizontal scroll */
  .live-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  .live-row::-webkit-scrollbar {
    display: none;
  }

  .live-card {
    flex: 0 0 min(72vw, 260px);
    scroll-snap-align: start;
  }

  .live-card .cover {
    height: 120px;
    font-size: 13px;
  }

  /* providers */
  .prov-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .prov-card {
    min-height: 88px;
    padding: 14px 10px;
  }

  /* sports page */
  .sports-page {
    padding: 12px 0 24px;
  }

  .sports-hero {
    gap: 12px;
    margin-bottom: 14px;
  }

  .sports-hero-main {
    padding: 18px 16px;
    border-radius: 16px;
  }

  .sports-hero-title {
    font-size: 1.35rem;
  }

  .sports-hero-lead {
    font-size: 14px;
  }

  .sports-toolbar {
    flex-wrap: nowrap;
    margin-bottom: 14px;
    padding-bottom: 8px;
    mask-image: linear-gradient(90deg, #000 92%, transparent);
  }

  .sports-chip {
    min-height: 44px;
    padding: 10px 16px;
  }

  .match-card-body {
    padding: 12px 14px 14px;
  }

  .match-odds {
    justify-content: stretch;
    width: 100%;
  }

  .odds-cell {
    flex: 1;
    min-width: 0;
    min-height: 44px;
  }

  .sports-aside {
    gap: 10px;
  }

  /* events */
  .events-hero-main {
    padding: 18px 16px;
  }

  /* legal strip + footer */
  .legal-strip {
    margin: 20px 0 16px;
    padding: 14px;
    font-size: 13px;
    border-radius: 14px;
  }

  footer.site-ft {
    padding: 20px 0 28px;
    font-size: 12px;
  }

  .ft-grid {
    gap: 16px;
  }

  .ft-grid h4 {
    font-size: 11px;
  }

  /* buttons — как в основной теме, без фиолетового */
  .btn {
    min-height: 44px;
  }

  .btn-hot {
    background: linear-gradient(180deg, #fb7185 0%, var(--red) 48%, var(--red-d) 100%);
    box-shadow: 0 8px 28px rgba(244, 63, 94, 0.35);
  }

  .btn-primary {
    background: linear-gradient(180deg, #6ee7b7 0%, var(--green) 38%, #059669 100%);
    color: #022c22;
    box-shadow: 0 8px 28px rgba(52, 211, 153, 0.35);
  }

  /* auth pages */
  .auth-page {
    padding: 16px 0 32px;
  }

  .auth-form .btn {
    width: 100%;
  }

  /* account / deposit */
  .account-grid,
  .deposit-grid {
    grid-template-columns: 1fr !important;
  }
}

/* very small phones */
@media (max-width: 380px) {
  .cards {
    gap: 8px;
  }

  .game-card .thumb {
    height: 96px;
  }

  .mobile-bottom-nav a {
    font-size: 9px;
  }

  .mobile-bottom-nav .mob-nav-fab {
    width: 48px;
    height: 48px;
    margin-top: -20px;
  }
}
