/* Checkout Frenzy - Responsive Styles */

/* Prevent scrolling when mobile menu is open */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Touch Optimization */
@media (hover: none) {
  /* Increase touch target sizes for better mobile usability */
  nav ul li a,
  .blog-card .read-more-container a,
  .menu-toggle,
  .footer-nav ul li a {
    padding: 12px 20px;
    min-height: 48px; /* Increase touch target height */
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Game button touch optimization - maintain original display property */
  .game-button {
    padding: 12px 20px;
    min-height: 48px; /* Increase touch target height */
    line-height: 1.2; /* Ensure text is vertically centered */
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  /* Separate touch styles for FAQ questions */
  .faq-question {
    padding: 12px 20px;
    min-height: 48px; /* Increase touch target height */
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Left align */
    position: relative;
    width: 100%;
  }

  /* Add touch feedback effects */
  .game-button:active,
  nav ul li a:active,
  .footer-nav ul li a:active,
  .blog-card:active,
  .feature-card:active,
  .game-card:active,
  .faq-question:active {
    opacity: 0.8;
    transform: scale(0.98);
    transition: transform 0.1s ease, opacity 0.1s ease;
  }

  /* Remove hover effects that don't work well on touch devices */
  .feature-card:hover,
  .blog-card:hover,
  .game-card:hover {
    transform: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  }

  /* Adjust spacing for touch */
  .blog-grid,
  .features-grid,
  .games-grid {
    gap: 16px;
  }

  /* Optimize scrolling experience */
  .reviews-grid,
  .comments-scroll,
  .faq-container {
    -webkit-overflow-scrolling: touch; /* Smooth scrolling */
    scroll-behavior: smooth;
  }

  /* Increase touch-friendliness of form elements */
  input,
  textarea,
  select,
  button {
    font-size: 16px; /* 防止iOS自动缩放 */
    padding: 12px;
    border-radius: 8px;
  }
}

/*
 * Breakpoints:
 * - Extra Small: 0-575px (phones)
 * - Small: 576px-767px (large phones, small tablets)
 * - Medium Small: 768px-879px (small tablets)
 * - Medium: 880px-991px (tablets)
 * - Large: 992px-1199px (desktops)
 * - Extra Large: 1200px+ (large desktops)
 */

/* Base styles for all devices */
html {
  font-size: 16px;
}

/* XX-Large Devices (ultra-wide monitors, 1600px and up) */
@media (min-width: 1600px) {
  html {
    font-size: 18px; /* Reduced base font size */
  }

  .container {
    max-width: 1200px; /* Reduced container width for more compact content */
  }

  .hero-container {
    min-height: 65vh; /* Reduced height */
    max-width: 1200px;
    margin: 0 auto;
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px; /* Reduced spacing */
  }

  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px; /* Reduced spacing */
  }

  .reviews-grid {
    max-width: 1200px;
    margin: 0 auto;
    height: 600px; /* Reduced height */
  }

  .reviews-column {
    width: 32%;
  }

  .faq-container {
    max-width: 1200px;
  }
}

/* X-Large Devices (large desktops, 1400px to 1599px) */
@media (min-width: 1400px) and (max-width: 1599px) {
  html {
    font-size: 17px; /* Reduced base font size */
  }

  .container {
    max-width: 1100px; /* Reduced container width */
  }

  .hero-container {
    min-height: 60vh; /* Reduced height */
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px; /* Reduced spacing */
  }

  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px; /* Reduced spacing */
  }

  .reviews-grid {
    height: 550px; /* Reduced height */
  }

  .reviews-column {
    width: 32%;
  }

  .faq-container {
    max-width: 1100px; /* Reduced container width */
  }
}

/* Extra Large Devices (large desktops, 1200px to 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
  html {
    font-size: 16px; /* Reduced base font size */
  }

  .container {
    max-width: 1000px; /* Reduced container width */
  }

  .hero-container {
    min-height: 55vh; /* Reduced height */
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px; /* Reduced spacing */
  }

  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px; /* Reduced spacing */
  }

  .reviews-grid {
    height: 500px; /* Reduced height */
  }

  .reviews-column {
    width: 32%;
  }

  .faq-container {
    max-width: 1000px; /* Reduced container width */
  }
}

/* Large Devices (desktops, 992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  html {
    font-size: 17px;
  }

  .container {
    max-width: 960px;
  }

  .hero-container {
    min-height: 65vh;
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
  }

  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
  }

  .reviews-column {
    width: 32%;
  }
}

/* Medium Small Devices (small tablets, 768px to 879px) */
@media (min-width: 768px) and (max-width: 879px) {
  html {
    font-size: 15.5px;
  }

  .container {
    max-width: 720px;
    padding: 0 var(--spacing-md);
  }

  .hero-container {
    min-height: 55vh;
    gap: var(--spacing-md);
  }

  .hero-content {
    flex: 6;
  }

  .hero-image {
    flex: 5;
  }

  .hero h1 {
    font-size: 1.9rem;
    margin-bottom: var(--spacing-sm);
  }

  .hero-description {
    font-size: 0.95rem;
    margin-bottom: var(--spacing-md);
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .feature-card {
    height: auto;
    min-height: 240px;
    padding: var(--spacing-md);
  }

  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .blog-card {
    height: 100%;
  }

  .blog-image {
    height: 160px;
  }

  .blog-content {
    height: calc(100% - 160px);
    padding: var(--spacing-sm);
  }

  .blog-card h3 {
    font-size: 1rem;
    line-height: 1.3;
  }

  .reviews-grid {
    height: 450px;
  }

  .reviews-column {
    width: 32%;
  }

  .review-card {
    padding: 1.2rem;
  }

  .section-title h2 {
    font-size: 1.9rem;
    margin-bottom: var(--spacing-sm);
  }

  .section-title p {
    font-size: 0.95rem;
  }

  .game-button {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.95rem;
  }

  /* FAQ section optimization */
  .faq-container {
    max-width: 720px;
  }

  .faq-question {
    font-size: 1rem;
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .faq-answer {
    font-size: 0.95rem;
    padding: var(--spacing-sm) var(--spacing-md);
  }
}

/* Medium Devices (tablets, 880px to 991px) */
@media (min-width: 880px) and (max-width: 991px) {
  html {
    font-size: 16px;
  }

  .container {
    max-width: 840px;
  }

  .hero-container {
    min-height: 60vh;
    gap: var(--spacing-lg);
  }

  .hero-content {
    flex: 1;
  }

  .hero-image {
    flex: 1;
  }

  .hero h1 {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
  }

  .hero-description {
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .feature-card {
    height: auto;
    min-height: 250px;
  }

  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .blog-image {
    height: 170px;
  }

  .blog-content {
    height: calc(100% - 170px);
  }

  .reviews-grid {
    height: 500px;
  }

  .reviews-column {
    width: 32%;
  }

  .section-title h2 {
    font-size: 2rem;
  }

  .section-title p {
    font-size: 1rem;
  }

  /* FAQ部分优化 */
  .faq-container {
    max-width: 840px;
  }
}

/* Small Devices (large phones, small tablets, 576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  html {
    font-size: 15px;
  }

  .container {
    max-width: 540px;
    padding: 0 var(--spacing-md);
  }

  /* At this breakpoint, we start transitioning from horizontal to vertical layout */
  .hero-container {
    flex-direction: column;
    min-height: auto;
    padding: var(--spacing-md) 0;
  }

  .hero-content {
    text-align: center;
    order: 1;
    padding: 0 var(--spacing-sm);
  }

  .hero-image {
    order: 2;
    margin-top: var(--spacing-md);
    width: 80%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-img {
    max-width: 85%;
  }

  .hero h1 {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-sm);
  }

  .hero-description {
    font-size: 0.95rem;
    margin-bottom: var(--spacing-md);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }

  /* At this breakpoint, feature cards change from 2 columns to 1 column, but maintain larger size */
  .features-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    max-width: 500px;
    margin: 0 auto;
  }

  .feature-card {
    height: auto;
    min-height: 220px;
    padding: var(--spacing-md);
  }

  /* Blog cards also change from 2 columns to 1 column, but maintain larger size */
  .blog-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    max-width: 500px;
    margin: 0 auto;
  }

  .blog-card {
    margin-bottom: var(--spacing-xs);
  }

  .blog-image {
    height: 180px;
  }

  .blog-content {
    height: calc(100% - 180px);
    padding: var(--spacing-sm);
  }

  .blog-card h3 {
    font-size: 1.1rem;
    line-height: 1.3;
  }

  /* Review section maintains 3 columns, but height is reduced */
  .reviews-grid {
    height: 400px;
  }

  .reviews-column {
    width: 32%;
  }

  .review-card {
    padding: 1rem;
    margin-bottom: 12px;
  }

  .review-quote {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  .review-text {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
  }

  .section-title {
    margin-bottom: var(--spacing-lg);
  }

  .section-title h2 {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-sm);
  }

  .section-title p {
    font-size: 0.95rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }

  .polytrack-button {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
  }

  /* FAQ section optimization */
  .faq-container {
    max-width: 540px;
  }

  .faq-question {
    font-size: 0.95rem;
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .faq-answer {
    font-size: 0.9rem;
    padding: var(--spacing-sm) var(--spacing-md);
  }
}

/* This breakpoint has been split into two more precise breakpoints:
 * 1. Medium-small screen devices (400px-575px)
 * 2. Extra-small screen devices (less than 400px)
 *
 * This general breakpoint now only contains styles common to both sub-breakpoints to avoid code duplication
 */
@media (max-width: 575px) {
  /* General mobile styles */
  body {
    padding-top: 60px;
  }

  .container {
    max-width: 100%;
  }

  section {
    padding: var(--spacing-lg) 0;
  }

  .hero-container {
    flex-direction: column;
    min-height: auto;
  }

  .hero-content {
    text-align: center;
    order: 1;
  }

  .hero-image {
    order: 2;
    margin-left: auto;
    margin-right: auto;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    height: auto;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .reviews-column {
    width: 32%;
  }

  .polytrack-button {
    width: 100%;
    margin: 0 auto;
    display: inline-block;
    text-align: center;
  }

  /* 优化按钮容器样式 - 减少!important */
  .center-button-container {
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* 优化移动端按钮样式 - 减少!important使用 */
  .game-button.full-width-mobile,
  .game-button.small.full-width-mobile {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 90%;
    min-width: 280px;
    min-height: 48px;
    line-height: 1.2;
    box-sizing: border-box;
    padding: 12px 20px;
    margin: 0 auto;
  }

  /* 表单元素优化 */
  input,
  textarea,
  select {
    margin-bottom: var(--spacing-sm);
    width: 100%;
  }
}

/* Medium-small screen device optimization (400px-575px) */
@media (min-width: 400px) and (max-width: 575px) {
  html {
    font-size: 14px;
  }

  body {
    padding-top: 60px;
  }

  .container {
    padding: 0 var(--spacing-md);
    max-width: 100%;
  }

  .hero-container {
    flex-direction: column;
    min-height: auto;
    padding: var(--spacing-md) 0;
  }

  .hero-content {
    text-align: center;
    order: 1;
    padding: 0 var(--spacing-sm);
  }

  .hero-image {
    order: 2;
    width: 85%;
    margin: var(--spacing-md) auto 0;
  }

  .hero-img {
    max-width: 85%;
  }

  .hero h1 {
    font-size: 1.7rem;
    margin-bottom: var(--spacing-sm);
  }

  .hero-description {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    max-width: 450px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
  }

  .feature-card {
    height: auto;
    min-height: 210px;
    padding: var(--spacing-md);
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    max-width: 450px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
  }

  .blog-card {
    margin-bottom: var(--spacing-xs);
  }

  .blog-image {
    height: 170px;
  }

  .blog-content {
    height: calc(100% - 170px);
    padding: var(--spacing-sm);
  }

  .blog-card h3 {
    font-size: var(--font-base);
    line-height: 1.3;
  }

  .reviews-grid {
    height: 350px;
  }

  .reviews-column {
    width: 32%;
  }

  .review-card {
    padding: 0.9rem;
    margin-bottom: 12px;
  }

  .review-quote {
    font-size: var(--font-sm);
    margin-bottom: var(--spacing-sm);
  }

  .review-text {
    font-size: var(--font-xs);
    line-height: 1.4;
    margin-bottom: var(--spacing-sm);
  }

  .section-title {
    margin-bottom: var(--spacing-lg);
  }

  .section-title h2 {
    font-size: 1.6rem;
    margin-bottom: var(--spacing-sm);
  }

  .section-title p {
    font-size: 0.9rem;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
  }

  .polytrack-button {
    padding: 10px 20px;
    font-size: 0.85rem;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: inline-block;
    text-align: center;
  }

  /* FAQ section optimization */
  .faq-container {
    max-width: 450px;
    padding: 0 var(--spacing-sm);
  }

  .faq-question {
    font-size: 0.9rem;
    padding: 12px;
  }

  .faq-answer {
    font-size: 0.85rem;
    padding: 12px;
  }
}

/* Extra-small screen device optimization (less than 400px) */
@media (max-width: 399px) {
  html {
    font-size: 13px;
  }

  body {
    padding-top: 55px;
  }

  .container {
    padding: 0 var(--spacing-sm);
    max-width: 100%;
  }

  .logo img {
    height: 45px;
  }

  .menu-toggle {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }

  .hero-container {
    flex-direction: column;
    min-height: auto;
    padding: var(--spacing-sm) 0;
  }

  .hero-content {
    text-align: center;
    order: 1;
    padding: 0 var(--spacing-xs);
  }

  .hero-image {
    order: 2;
    width: 90%;
    margin: var(--spacing-md) auto 0;
  }

  .hero-img {
    max-width: 90%;
  }

  .hero h1 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
  }

  .hero-description {
    font-size: 0.85rem;
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
  }

  .section-title {
    margin-bottom: var(--spacing-md);
  }

  .section-title h2 {
    font-size: 1.4rem;
    margin-bottom: var(--spacing-xs);
  }

  .section-title p {
    font-size: 0.85rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-xs);
  }

  .feature-card {
    padding: var(--spacing-sm);
    min-height: 200px;
  }

  .feature-icon-container {
    margin-bottom: var(--spacing-sm);
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-xs);
  }

  .blog-card {
    margin-bottom: var(--spacing-xs);
  }

  .blog-image {
    height: 160px;
  }

  .blog-content {
    height: calc(100% - 160px);
    padding: var(--spacing-xs);
  }

  .blog-card h3 {
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: var(--spacing-xs);
  }

  .reviews-grid {
    height: 300px;
  }

  .review-card {
    padding: 0.7rem;
    margin-bottom: 10px;
  }

  .review-quote {
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
  }

  .review-text {
    font-size: 0.7rem;
    line-height: 1.3;
    margin-bottom: 0.4rem;
  }

  .polytrack-button {
    font-size: 0.8rem;
    padding: 8px 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    display: inline-block;
    text-align: center;
  }

  /* 优化超小屏幕按钮样式 - 减少!important使用 */
  .polytrack-button.full-width-mobile {
    width: 100%;
    max-width: 95%;
    min-width: 250px;
    background-color: var(--secondary-color);
    color: white;
    border: 2px solid var(--secondary-color);
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    display: inline-block;
    box-sizing: border-box;
    font-size: var(--font-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    font-weight: normal;
    transition: all var(--transition-base);
    transform: var(--gpu-acceleration);
  }

  .footer-logo-section img {
    height: 45px;
  }

  /* 确保在超小屏幕上也隐藏页脚导航 */
  .footer-nav {
    display: none;
  }

  /* FAQ部分在超小屏幕上的优化 */
  .faq-container {
    padding: 0 var(--spacing-xs);
  }

  .faq-item {
    margin-bottom: var(--spacing-xs);
    width: 100%;
  }

  .faq-question {
    padding: 10px;
    font-size: 0.9rem;
    text-align: left;
    justify-content: flex-start;
    position: relative;
    width: 100%;
  }

  .faq-question:after {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
  }

  .faq-item.active .faq-question:after {
    content: '-';
    transform: translateY(-50%) rotate(180deg);
  }

  .faq-answer {
    padding: 0;
    font-size: 0.85rem;
    max-height: 0;
    visibility: hidden;
    opacity: 0;
  }

  .faq-item.active .faq-answer {
    padding: 10px;
    max-height: 1000px;
    visibility: visible;
    opacity: 1;
  }

  .copyright {
    font-size: 0.75rem;
    margin-top: var(--spacing-xs);
    padding-top: var(--spacing-xs);
  }
}
