/* large screen
======================= */
@media (min-width: 1920px) {
  .footer-area {
    background-position: center top;
  }
}

/* Small screen
======================= */

@media (max-width: 991.98px) {
  .hero-content h1 {
    font-size: 48px;
  }

  h2 {
    font-size: 40px;
  }

  .g-inner-section {
    padding: 40px 0px;
  }

  .flow-section img {
    margin-top: -150px;
  }

  .team-grid.advisor-team {
    grid-template-columns: repeat(2, 1fr);
  }
  .single-team {
    width: auto;
  }

  .supported-images .s-image {
    flex: 0 0 33.33%;
  }

  .supported-images {
    flex-wrap: wrap;
    justify-content: space-around;
  }

  ul.faq-accordian li h4 {
    font-size: 24px;
  }

  .m-margin {
    margin-top: 30px;
  }

  /* Enhanced touch targets for tablets */
  .walletProfile .dropdown-toggle {
    height: 48px;
    font-size: 15px;
    padding: 8px 16px;
    min-width: 140px;
  }
  
  /* Desktop/Tablet - Keep normal button */
  .connWallet {
    position: relative;
    height: 50px;
    font-size: 14px;
    padding: 12px 20px;
    min-width: 150px;
    border-radius: 12px;
    width: auto;
    top: auto;
    right: auto;
    z-index: auto;
  }
  
  .connWallet .wallet-text {
    display: inline;
  }
  
  .connWallet .wallet-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
  }
  
  .connectBtns {
    display: flex;
  }
  
  .walletTopBtns .container {
    position: static;
  }
  
  .walletProfile .dropdown-menu {
    min-width: 180px;
  }
  
  .walletProfile .dropdown-menu li a {
    padding: 10px 16px;
    font-size: 15px;
  }
}

@media (max-width: 767.98px) {
  .flow-img-mobile {
    display: block;
  }

  .flow-img-desktop {
    display: none;
  }

  .flow-section img.flow-img-mobile {
    margin: 0px;
  }

  .hero-content h1 {
    font-size: 33px;
  }

  .hero-content p {
    font-size: 24px;
  }

  /* Ensure hero area has proper spacing with fixed button */
  .hero-area {
    padding-top: 80px; /* Extra padding for hero section */
  }

  .reg-to-play {
    padding: 40px;
  }

  .ai-wars-content {
    padding: 50px 0;
    background-size: 100%;
  }

  p {
    font-size: 16px;
  }

  .ai-wars-content p {
    font-size: 18px;
  }

  h2 {
    font-size: 32px;
  }

  .g-inner-section {
    grid-template-columns: 1fr;
  }

  .single-image-box {
    border: none !important;
    border-bottom: 1px solid #05a3b4 !important;
    padding: 20px;
  }
  .single-image-box:last-child {
    border: none !important;
  }

  .single-image-box img {
    width: 70px;
    margin-bottom: 20px;
  }

  .single-image-box h4 {
    font-size: 20px;
  }

  .single-image-box p {
    font-size: 16px;
  }

  section.cage-section {
    padding: 0 0 80px;
  }
  .cage-content {
    padding: 60px 20px;
    margin-top: -80px;
  }

  section.cage-section .row {
    flex-direction: column-reverse;
  }

  section.token-section .row {
    flex-direction: column-reverse;
  }

  section.token-section {
    padding-top: 80px;
    margin-top: 0;
  }

  .flow-section img {
    margin: -80px;
  }

  .flow-section p {
    font-size: 16px;
  }

  .token-text {
    margin: 0;
  }

  .token-text p {
    font-size: 16px;
  }
  .team-section::before {
    width: 100%;
    top: 0;
  }

  .utility-section {
    padding: 0 0 100px 0;
    margin-top: 0;
  }

  .utility-content li {
    font-size: 16px;
  }

  section.utility-section h4.mt-md-5 {
    margin-top: 30px;
  }

  .utility-section .girl-image {
    display: none;
  }

  section.tokenomics-section img {
    max-width: 50%;
  }

  section.tokenomics-section h2 {
    text-align: center;
  }

  .team-section .team-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  h3 {
    font-size: 20px;
  }

  section.team-section {
    padding-bottom: 50px;
    padding-top: 80px;
  }
  .single-team h5 {
    font-size: 18px;
  }
  h3.mb-4.mt-md-5 {
    margin-top: 40px;
  }

  .supported-content {
    padding: 40px 20px 60px;
  }
  .supported-images {
    margin-top: 40px;
    gap: 30px;
  }

  .supported-images .s-image {
    flex: 0 0 50%;
    max-width: calc(50% - 30px);
  }

  section.roadmap-section {
    padding: 100px 0;
  }
  section.roadmap-section::before {
    width: 370px;
  }

  ul.faq-accordian li {
    padding: 10px 15px;
  }

  ul.faq-accordian li h4 {
    font-size: 18px;
    font-weight: 500;
  }
  .faq-accordian li h4::after {
    width: 22px;
    height: 22px;
  }

  ul.faq-accordian p {
    font-size: 16px;
    max-width: 90%;
  }

  footer.footer-area {
    padding: 100px 0 150px;
  }

  .footer-content .social-links {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .s-social-link img {
    width: 50px;
  }

  .roadmap-text {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 20px;
  }
  .roadmap-text::before {
    transform: translate(-22%, -31%);
  }
  .roadmap-text::after {
    width: calc(100% - 40px);
    left: 20px;
  }
  .roadmap-text .single-roadmap:nth-child(3),
  .roadmap-text .single-roadmap:nth-child(4) {
    margin-top: 55px;
  }

  .single-roadmap li {
    font-size: 14px;
  }
  .single-roadmap li::before {
    top: 9px;
  }
  .mobile-line {
    position: absolute;
    width: calc(100% + 25px);
    height: 1px;
    right: -15px;
    background: linear-gradient(-45deg, #07e8ff 70%, transparent);
    top: 59%;
  }

  section.roadmap-section::before {
    display: none;
  }

  .footer-content .social-links .s-social-link a {
    font-size: 18px;
  }

  .site-btn {
    font-size: 16px;
    line-height: 80px;
  }

  .cage-section img {
    margin: 0 0 0 -20px;
    max-width: 100%;
  }

  .token-section img {
    transform: translateX(10%) scale(1.5);
  }
  .team-image {
    text-align: center;
  }

  /* Mobile-first approach for phones */
  .walletTopBtns {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 15px;
  }
  
  /* Enhanced dropdown for mobile */
  .walletProfile .dropdown-toggle {
    height: 50px; /* Larger for easier touch */
    font-size: 14px;
    padding: 8px 14px;
    min-width: 160px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  }

  /* Clean dropdown arrow for mobile */
  .walletProfile .dropdown-toggle::after {
    content: "▼";
    font-size: 10px;
    color: #a7bac2;
    margin-left: 8px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
  }

  .walletProfile .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
  }
  
  .walletProfile .dropdown-menu {
    min-width: 200px;
    right: 0;
    left: auto;
    margin-top: 8px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    border: 1px solid #326283;
    z-index: 10001;
    position: absolute;
  }
  
  .walletProfile .dropdown-menu li a {
    padding: 12px 16px;
    font-size: 14px;
    min-height: 44px; /* Ensure touch-friendly height */
    display: flex;
    align-items: center;
  }
  
  .walletProfile .dropdown-menu li a img {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }
  
    /* Mobile Connect Wallet - Text Only */
  .connWallet {
    position: relative;
    width: auto;
    height: 40px;
    min-width: 100px;
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    background: #326283;
    border: 1px solid rgba(7, 232, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s ease;
  }

  .connWallet .wallet-text {
    display: block !important;
  }

  .connWallet .wallet-icon {
    display: none !important;
  }

  .connWallet:hover {
    background: #528eb7;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: translateY(-1px);
  }
  
  .connectBtns {
    display: none;
  }
  
  .walletTopBtns .container {
    position: relative;
  }
  
  /* Profile modal mobile enhancements */
  .profile-modal-content {
    margin: 15px;
    border-radius: 15px;
  }
  
  .profileLink {
    padding: 12px 10px;
    min-height: 50px; /* Touch-friendly */
    border-radius: 8px;
  }
  
  .profileLink img {
    width: 24px;
    height: 24px;
  }
  
  /* Claim modal mobile improvements */
  .claim-modal-content {
    margin: 15px;
    border-radius: 15px;
  }
  
  .claim-btn-styled {
    height: 50px;
    font-size: 14px;
    border-radius: 10px;
    min-height: 50px; /* Ensure touch-friendly */
  }
  
  /* Alert modal mobile optimization */
  .alert-modal {
    margin: 20px;
    border-radius: 15px;
    max-width: none;
    width: calc(100% - 40px);
  }
  
  .alert-btn-primary,
  .alert-btn-secondary {
    height: 48px;
    font-size: 14px;
    padding: 12px 20px;
    border-radius: 10px;
  }
  
  /* Success modal mobile optimization */
  .success-modal {
    margin: 20px;
    border-radius: 15px;
    max-width: none;
    width: calc(100% - 40px);
  }
  
  .success-btn-primary,
  .success-btn-secondary {
    height: 48px;
    font-size: 14px;
    padding: 12px 20px;
    border-radius: 10px;
  }
}

@media (max-width: 767px) {
  section.team-section h2.mb-5.mb-sm-4 {
    text-align: center;
  }

  section.team-section h3 {
    text-align: center;
  }
  section.team-section .team-grid.advisor-team,
  section.team-section .team-grid.core-team {
    text-align: center;
  }
  section.team-section .single-team {
    max-width: 85%;
    margin: 0 auto;
  }
}

@media (max-width: 432px) {
  .mobile-line {
    top: 254px;
  }
}
@media (max-width: 328px) {
  .mobile-line {
    top: 240px;
  }
  .single-roadmap li {
    font-size: 12px;
  }
}

/* ================================
   MODAL RESPONSIVE IMPROVEMENTS
   ================================ */

@media (max-width: 767.98px) {
  /* Claim Modal Mobile */
  .claim-modal-content {
    margin: 10px;
  }
  
  .claim-modal-header {
    padding: 15px;
  }
  
  .claim-header-content .claim-icon img {
    width: 40px;
    height: 40px;
  }
  
  .claim-header-content h3 {
    font-size: 18px;
  }
  
  .claim-modal-body {
    padding: 15px;
  }
  
  .claim-user-profile {
    padding: 12px;
    gap: 10px;
  }
  
  .claim-avatar {
    width: 40px;
    height: 40px;
  }
  
  .claim-user-info h5 {
    font-size: 14px;
  }
  
  .claim-balance-card {
    padding: 15px 12px;
  }
  
  .balance-icon {
    width: 28px;
    height: 28px;
  }
  
  .balance-amount {
    font-size: 16px;
  }
  
  .claim-btn-styled {
    height: 45px;
    font-size: 13px;
  }
  
  /* Profile Modal Mobile */
  .profile-modal-content {
    margin: 10px;
  }
  
  .profile-modal-header {
    padding: 15px;
  }
  
  .profile-modal-header h3 {
    font-size: 18px;
  }
  
  .profile-modal-body {
    padding: 15px;
  }
  
  .profile-picture-section {
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
  }
  
  .userPic {
    width: 60px;
  }
  
  /* Wallet Balances Modal Mobile */
  .wallet-balances-dialog {
    max-width: 95% !important;
    margin: 1rem auto !important;
  }

  .wallet-balances-dialog .profile-modal-content {
    max-height: 85vh !important;
    border-radius: 12px !important;
    margin: 10px !important;
  }

  .wallet-balances-dialog .profileLink {
    padding: 10px !important;
    gap: 10px !important;
  }

  .wallet-balances-dialog .profile-link-content p {
    font-size: 13px !important;
  }
  
  .wallet-balances-dialog .profile-modal-header {
    padding: 15px !important;
  }
  
  .wallet-balances-dialog .profile-modal-body {
    padding: 15px !important;
  }
  
  .profileLink {
    padding: 10px;
    gap: 10px;
  }
  
  .profileLink img {
    width: 20px;
    height: 20px;
  }
  
  .profile-link-content p {
    font-size: 13px;
  }
  
  /* CAGE Claim Button Mobile */
  .cage-claim-button .profile-link-content p:first-child {
    font-size: 15px;
  }
  
  .cage-claim-button .profile-link-content p:last-child {
    font-size: 12px;
  }
  
  .claim-arrow img {
    width: 14px;
  }
  
  .telegram-disconnect-section a {
    padding: 5px 10px;
    font-size: 11px;
  }
  
  .telegram-disconnect-section a img {
    width: 10px;
    margin-right: 4px;
  }
  
  /* Telegram Modal Mobile */
  .telegram-modal {
    margin: 15px;
    max-width: none;
    width: calc(100% - 30px);
  }
  
  .telegram-modal-header {
    padding: 20px 15px;
  }
  
  .telegram-modal-header h3 {
    font-size: 18px;
  }
  
  .telegram-modal-body {
    padding: 20px 15px;
  }
  
  .telegram-modal-footer {
    padding: 12px 15px 15px;
  }
  
  /* Dropdown Mobile */
  .walletProfile .dropdown-menu {
    min-width: 200px;
    right: 0;
    left: auto;
  }
  
  .walletProfile .dropdown-toggle {
    font-size: 14px;
    padding: 6px 12px;
    height: 42px;
  }
  
  .connWallet {
    width: 48px;
    height: 48px;
    right: 15px;
    top: 15px;
  }
  
  .connWallet .wallet-icon {
    width: 22px;
    height: 22px;
  }
  
  /* Alert Messages Mobile */
  .aleartText,
  .successText {
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    width: calc(100% - 40px);
    max-width: 350px;
  }
  
  .aleartInner,
  .successTextInner {
    font-size: 14px;
    padding: 10px 15px;
    gap: 12px;
    width: 100%;
  }
  
  .aleartInner img,
  .successTextInner img {
    width: 35px;
  }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 575.98px) {
  .walletTopBtns {
    padding: 0 10px;
  }
  
  .walletProfile .dropdown-toggle,
  .connWallet {
    min-width: 140px;
    font-size: 13px;
    height: 48px;
  }
  
  .walletProfile .dropdown-menu {
    min-width: 180px;
    font-size: 13px;
  }
  
  .walletProfile .dropdown-menu li a {
    padding: 10px 14px;
    font-size: 13px;
    min-height: 42px;
  }
  
  /* Adjust modal sizes for very small screens */
  .alert-modal,
  .success-modal,
  .profile-modal-content,
  .claim-modal-content {
    margin: 10px;
    width: calc(100% - 20px);
  }
}

/* Landscape orientation optimizations */
@media (max-width: 767.98px) and (orientation: landscape) {
  .walletProfile .dropdown-toggle,
  .connWallet {
    height: 44px;
    font-size: 13px;
  }
  
  .walletProfile .dropdown-menu li a {
    padding: 8px 14px;
    min-height: 40px;
  }
  
  /* Reduce modal padding in landscape */
  .alert-modal,
  .success-modal {
    margin: 10px;
  }
  
  .alert-modal-body,
  .success-modal-body {
    padding: 15px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .walletProfile .dropdown-toggle,
  .connWallet,
  .claim-btn-styled,
  .alert-btn-primary,
  .alert-btn-secondary,
  .success-btn-primary,
  .success-btn-secondary {
    min-height: 50px; /* iOS recommended touch target */
  }
  
  .connWallet {
    width: 46px;
    height: 46px;
    right: 12px;
    top: 12px;
  }
  
  .connWallet .wallet-icon {
    width: 20px;
    height: 20px;
  }
  
  .walletProfile .dropdown-menu li a {
    min-height: 44px;
  }
  
  /* Disable hover effects for wallet options in popup */
  .wallet-option-item {
    transition: none !important;
  }

  .wallet-option-item:hover {
    background: rgba(255,255,255,0.1) !important;
    border-color: #28485a !important;
    transform: none !important;
  }

  /* Override mobile dropdown arrow styling */
  .walletProfile .dropdown-toggle::after {
    padding: 0 !important;
    content: "▼" !important;
    font-size: 10px !important;
    color: #a7bac2 !important;
    margin-left: 8px !important;
    flex-shrink: 0 !important;
    transition: transform 0.2s ease !important;
  }

  .walletProfile .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg) !important;
  }
}

/* Additional Mobile Layout Optimizations */
@media (max-width: 767.98px) {
  /* Ensure container has proper padding on mobile */
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Add extra right margin to content to avoid button overlap */
  .hero-content,
  .ai-wars-content,
  .cage-content,
  .token-text,
  .utility-content {
    padding-right: 20px;
  }
  
  /* Keep wallet container visible but position it properly */
  .walletTopBtns {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9999;
    background: transparent;
    padding: 15px;
    width: auto;
  }
  
  /* Position the buttons container */
  .connectBtns {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
  
  /* Prevent text selection on touch devices for better UX */
  .walletProfile .dropdown-toggle,
  .connWallet,
  .claim-btn-styled {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  /* Clean mobile dropdown arrow across all mobile sizes */
  .walletProfile .dropdown-toggle::after {
    content: "▼" !important;
    font-size: 10px !important;
    color: #a7bac2 !important;
    margin-left: 8px !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    transition: transform 0.2s ease !important;
    width: auto !important;
    height: auto !important;
    border: none !important;
    background: none !important;
    display: inline-block !important;
    vertical-align: middle !important;
  }

  .walletProfile .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg) !important;
  }

  /* Override Bootstrap dropdown toggle defaults */
  .walletProfile .dropdown-toggle::before {
    display: none !important;
  }
  
    /* Connect wallet styles are handled above in main mobile section */
  
  /* Improve scroll behavior on mobile and add padding for fixed button */
  body {
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
    padding-top: 60px; /* Space for fixed connect button */
  }
  
  /* Better button active states for mobile */
  .walletProfile .dropdown-toggle:active,
  .connWallet:active,
  .claim-btn-styled:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
}
