/* GREENTAKE mobile UX — loaded last */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .container-fluid {
    padding: 0 14px 120px !important;
    max-width: 100% !important;
  }

  body.fear-chat-open .container-fluid,
  body.fear-chat-open .footer_global {
    margin-right: 0 !important;
  }

  /* Header */
  .navbar.row {
    margin: 8px 0 6px !important;
    gap: 8px !important;
  }

  .navbar_menu_left {
    gap: 8px !important;
    min-width: 0;
  }

  .navbar_menu_left .fear-header-meta {
    display: flex !important;
    flex-direction: column;
    gap: 2px;
    font-size: 11px !important;
    line-height: 1.2;
    min-width: 0;
  }

  .navbar_menu_left .social_buttons {
    display: flex !important;
    gap: 14px;
    margin-left: 2px;
  }

  .navbar_menu_left .social_button svg {
    width: 20px !important;
    height: 20px !important;
  }

  .navbar_menu_left .site_logo_neo {
    display: none !important;
  }

  .navbar > .navbar-memu.drpdwn_menu,
  .navbar-memu.drpdwn_menu {
    display: flex !important;
    gap: 6px !important;
    padding: 6px !important;
    border-radius: 16px !important;
    background: rgba(27, 26, 37, 0.92) !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .navbar-memu.drpdwn_menu::-webkit-scrollbar {
    display: none;
  }

  .navbar-memu.drpdwn_menu .dropdown > a,
  .navbar-memu.drpdwn_menu a {
    min-height: 40px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    border-radius: 12px !important;
  }

  .navbar_usermenu {
    gap: 6px !important;
    flex-wrap: nowrap !important;
    max-width: 100%;
  }

  .navbar_usermenu .fear-promo-btn span {
    display: none !important;
  }

  .navbar_usermenu .fear-promo-btn {
    width: 42px !important;
    min-width: 42px !important;
    padding: 0 !important;
    justify-content: center !important;
  }

  .navbar_usermenu .fear-balance {
    padding: 0 6px 0 8px !important;
    max-width: 46vw;
  }

  .navbar_usermenu .fear-balance__value {
    font-size: 12px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 28vw;
  }

  .navbar_usermenu .fear-balance__coin,
  .navbar_usermenu .fear-balance__coin img {
    width: 28px !important;
    height: 28px !important;
  }

  .navbar_usermenu .fear-balance__plus {
    width: 24px !important;
    height: 24px !important;
    font-size: 14px !important;
  }

  .navbar_usermenu .button,
  .navbar_usermenu .btn_login,
  .navbar_usermenu a.button {
    min-height: 42px !important;
    padding: 0 12px !important;
    font-size: 13px !important;
  }

  .navbar_usermenu .user__menu,
  .user__menu {
    width: 178px !important;
    min-width: 178px !important;
    max-width: 178px !important;
    right: 0 !important;
    left: auto !important;
  }

  /* Heroes */
  #rowModsServers .fp-heroes.mods__wrapper,
  #rowModsServers .mods__wrapper {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  #rowModsServers .mods__card,
  #rowModsServers .fp-hero {
    width: 100% !important;
    max-width: 100% !important;
    height: clamp(300px, 72vw, 440px) !important;
    min-height: 300px !important;
    border-radius: 18px !important;
  }

  #rowModsServers .mods__first-image {
    height: 100% !important;
  }

  #rowModsServers .mods__card h2,
  #rowModsServers .fp-hero__title,
  #rowModsServers .mod__name {
    font-size: clamp(36px, 11vw, 52px) !important;
  }

  /* Promo banner */
  .image-slider.swiper,
  .image-slider__image {
    height: auto !important;
    min-height: 180px !important;
  }

  .image-slider.fear-promo .image-slider__image {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    padding: 18px 16px 18px !important;
    padding-right: 16px !important;
    gap: 12px;
  }

  .image-slider.fear-promo .image-slider__image h3 {
    font-size: 22px !important;
    line-height: 1.2 !important;
    max-width: 100% !important;
  }

  .image-slider.fear-promo .image-slider__image img {
    position: absolute !important;
    right: -8% !important;
    bottom: 0 !important;
    height: 92% !important;
    width: auto !important;
    max-width: 58% !important;
    opacity: 0.85;
    pointer-events: none;
  }

  .image-slider.fear-promo .swiper_btn {
    position: relative !important;
    z-index: 2;
    min-height: 44px !important;
  }

  /* Stats */
  .row:has(.statistics_container) {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .row:has(.statistics_container) > .col-md-2 {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }

  .statistics_container {
    min-height: 72px !important;
    padding: 14px 16px !important;
  }

  /* Footer */
  .footer_global,
  .footer-top {
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .footer_links ul {
    flex-wrap: wrap !important;
    gap: 10px 14px !important;
    justify-content: center !important;
  }

  .footer_links ul a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }

  /* Floating chat + help */
  .fear-chat {
    width: 100vw !important;
    max-width: 100vw !important;
    border-left: 0 !important;
  }

  .fear-chat-fab {
    right: max(12px, env(safe-area-inset-right)) !important;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
    width: 50px !important;
    height: 50px !important;
  }

  .gt-help {
    right: max(12px, env(safe-area-inset-right)) !important;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    left: auto !important;
    max-width: calc(100vw - 78px);
  }

  body.fear-chat-open .gt-help {
    right: max(12px, env(safe-area-inset-right)) !important;
  }

  .gt-help__open {
    min-height: 46px !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    max-width: 100%;
  }

  .gt-help__open span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 42vw;
  }

  .gt-help__web {
    display: none !important;
  }

  .gt-help__card {
    width: min(100%, 420px) !important;
    max-height: calc(100dvh - 40px);
    overflow: auto;
    padding: 22px 18px 18px !important;
  }

  .gt-help__actions {
    grid-template-columns: 1fr !important;
  }

  /* Shop */
  .fear-shop {
    width: 100% !important;
    gap: 20px !important;
  }

  .fear-shop-top {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .fear-shop .shop-header p {
    font-size: 20px !important;
  }

  .fear-shop .button_to_buy {
    width: 100% !important;
  }

  .fear-shop .shop-tier-picker,
  .fear-shop .fear-shop-cats {
    display: flex !important;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .fear-shop .shop-tier-picker::-webkit-scrollbar,
  .fear-shop .fear-shop-cats::-webkit-scrollbar {
    display: none;
  }

  .fear-shop .shop-tier,
  .fear-shop .shop_button_servers {
    flex: 0 0 auto !important;
    min-height: 42px !important;
  }

  .fear-shop .shop-container,
  .fear-shop .shop_wrapper_product {
    justify-content: center;
  }

  /* Pay modal */
  #popupPay .popup_modal_content,
  #popupPay .gt-pay-modal {
    width: min(100vw - 20px, 520px) !important;
    max-height: calc(100dvh - 24px);
    overflow: auto;
    margin: 10px auto !important;
  }

  .gt-pay-method {
    flex: 0 0 auto !important;
    min-height: 64px !important;
  }

  .gt-pay-card {
    min-height: 64px !important;
  }

  /* Tickets */
  .tickets__wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 10px !important;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tickets__wrapper::-webkit-scrollbar {
    display: none;
  }

  .tickets__wrapper .ticket__radio-label {
    flex: 0 0 min(78vw, 260px) !important;
    min-width: min(78vw, 260px) !important;
    max-width: min(78vw, 260px) !important;
  }

  .tickets__nav-list {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .tickets__selects-wrapper {
    flex-direction: column !important;
  }

  .tickets__chat-wrapper {
    flex-direction: column !important;
  }

  /* Forms / tables */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  input,
  select,
  textarea,
  button,
  .button {
    font-size: 16px;
  }

  .popup_modal_content {
    max-width: calc(100vw - 20px) !important;
  }
}

@media (max-width: 560px) {
  .navbar_menu_left .fear-header-meta span {
    white-space: nowrap;
  }

  .gt-help__open span {
    max-width: 34vw;
  }

  #rowModsServers .mods__card,
  #rowModsServers .fp-hero {
    height: clamp(280px, 86vw, 400px) !important;
  }

  .image-slider.fear-promo .image-slider__image h3 {
    font-size: 19px !important;
    max-width: 70% !important;
  }
}

/* Touch-friendly hit targets */
@media (hover: none) and (pointer: coarse) {
  .navbar-memu.drpdwn_menu a,
  .fear-chat-fab,
  .gt-help__open,
  .gt-pay-card,
  .gt-pay-submit,
  .fear-shop .shop_product_button,
  .fear-shop .shop-item-btn {
    min-height: 44px;
  }
}
