/* 
 * GamePlus 響應式設計樣式 - 簡潔版
 * 以電腦版效果為主，手機版專注於排版美化
 */

/* 基礎響應式修復 */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    font-size: 16px;
}

/* 全域響應式優化 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

img {
    max-width: 100%;
    height: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Tablet and below */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 2.75rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .mahjong-games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Navigation */
    .nav-menu {
        display: none;
    }
    
    .nav-buttons {
        display: none;
    }
    
    .nav-mobile-top-buttons {
        display: flex;
    }
    
    .nav-mobile-toggle {
        display: block;
    }
    
    /* Hero Section 手機版美化排版 */
    .hero-section {
        padding: 5rem 0 4rem;
        min-height: 90vh;
    }
    
    .hero-content {
        text-align: center;
        padding: 0 1.25rem;
        max-width: 100%;
        margin: 0 auto;
    }
    
    /* Hero Badge 手機版美化 */
    .hero-trial-badge {
        margin: 0 auto 2rem;
        padding: 1.25rem 2.5rem;
        font-size: 1.3rem;
        font-weight: 700;
        border-radius: 50px;
        max-width: 350px;
        min-height: 65px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    }
    
    /* 標題美化 */
    .hero-title {
        font-size: 2.25rem !important; /* 進一步縮小字體 */
        margin-bottom: 1.75rem;
        line-height: 1.15;
        font-weight: 900;
        text-align: center;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2.25rem;
        line-height: 1.3;
        font-weight: 600;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        padding: 0 0.5rem; /* 減少左右內邊距 */
    }
    
    /* 描述區塊美化 - 手機版隱藏 */
    .hero-description-enhanced {
        margin: 1.5rem 0 2rem;
        padding: 1rem;
        background: linear-gradient(135deg, rgba(45, 55, 72, 0.8), rgba(74, 85, 104, 0.8));
        border-radius: 12px;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 193, 7, 0.2);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    
    .hero-description-enhanced .description-line {
        font-size: 1rem !important;
        margin: 0.5rem 0 !important;
        padding: 0.75rem !important;
        border-radius: 8px !important;
        min-height: auto !important;
        line-height: 1.4 !important;
    }
    
    .description-line.primary {
        font-size: 1.125rem !important;
        font-weight: 600 !important;
    }
    
    .description-line.highlight {
        color: #fbbf24 !important;
        font-weight: 600 !important;
        border-left: 3px solid #fbbf24 !important;
    }
    
    .description-line.accent {
        color: #10b981 !important;
        font-weight: 500 !important;
    }
    
    .description-line.action {
        color: #8b5cf6 !important;
        font-weight: 500 !important;
    }
    
    /* 按鈕美化 */
    .hero-buttons {
        flex-direction: column;
        gap: 1.25rem;
        margin: 2.5rem auto;
        max-width: 320px;
    }
    
    .hero-buttons .btn {
        width: 100%;
        padding: 1.125rem 2rem;
        font-size: 1.2rem;
        min-height: 55px;
    }
    
    /* 統計數據美化 - 手機版隱藏 */
    .hero-stats {
        display: none !important;
    }
    
    
    /* 遊戲區塊美化 */
    .mahjong-games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    
    .mahjong-game-content {
        padding: 1rem;
    }
    
    .mahjong-game-title {
        font-size: 1.3rem;
        font-weight: 700;
        margin-bottom: 0.75rem;
    }
    
    .mahjong-game-description {
        font-size: 1rem;
        line-height: 1.4;
        margin-bottom: 1rem;
    }
    
    .mahjong-game-play-button {
        font-size: 1.1rem;
        padding: 0.75rem 1.25rem;
        min-height: 45px;
    }
    
    /* Section Headers */
    .section-title {
        font-size: 2rem;
    }
    
    .section-description {
        font-size: 1.1rem;
    }
    
    /* Features */
    /* 最新消息 1.5格橫移顯示 */
    .news-viewport {
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        position: relative !important;
        padding: 0 1rem !important;
    }
    
    .news-track { 
        display: flex !important;
        grid-template-columns: none !important;
        flex-wrap: nowrap !important;
        gap: 1rem !important;
        padding-bottom: 1rem !important;
        scroll-snap-type: x mandatory !important;
    }
    
    .news-card { 
        flex: 0 0 calc(66.666% - 0.5rem) !important;
        scroll-snap-align: start !important;
        min-width: 280px !important;
        max-width: 320px !important;
    }
    
    /* 手機版 CTA 按鈕優化 */
    .news-more .btn-small {
        padding: 0.65rem 1.25rem !important;
        font-size: 0.8rem !important;
        border-radius: 20px !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .news-more .btn-small:hover {
        padding-right: 1.25rem !important;
        transform: translateY(-2px) scale(1.02) !important;
    }
    
    .news-more .btn-small::after {
        display: none !important;
    }
    
    .news-nav { 
        position: absolute !important;
        top: 50% !important;
        left: -1.5rem !important;
        right: -1.5rem !important;
        transform: translateY(-50%) !important;
        pointer-events: none !important;
        z-index: 1000 !important;
        display: flex !important; 
        justify-content: space-between !important;
        height: 0 !important;
        margin-top: 0 !important;
    }
    
    .news-nav button {
        pointer-events: all !important;
        position: static !important;
        width: 3rem !important;
        height: 3rem !important;
        font-size: 1.2rem !important;
        font-weight: bold !important;
        border-radius: 50% !important;
        background: linear-gradient(135deg, rgba(56, 178, 172, 0.9), rgba(147, 51, 234, 0.9)) !important;
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
        color: white !important;
        backdrop-filter: blur(10px) !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
        z-index: 1001 !important;
    }
    
    .news-nav button:hover:not(:disabled):not([style*="pointer-events: none"]) {
        background: linear-gradient(135deg, rgba(56, 178, 172, 1), rgba(147, 51, 234, 1)) !important;
        transform: scale(1.1) !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
    }
    
    .news-nav button:disabled,
    .news-nav button[style*="pointer-events: none"],
    .news-nav button[style*="opacity: 0.3"] {
        opacity: 0.3 !important;
        cursor: not-allowed !important;
        pointer-events: none !important;
        transform: none !important;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .feature-title {
        font-size: 1.3rem;
    }
    
    .feature-description {
        font-size: 1rem;
    }
    
    /* 手機版新聞詳情iframe：上圖下文排版 */
    .news-dialog {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto 1fr auto !important;
        height: auto !important;
        max-height: 95vh !important;
    }
    
    .news-dialog-content {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
    }
    
    .news-detail-content {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
    }
    
    .news-detail-header {
        height: auto !important;
        max-height: 50vh !important;
    }
    
    .news-detail-image {
        aspect-ratio: 16/9 !important;
        height: auto !important;
    }
    
    .news-detail-info {
        position: relative !important;
        background: var(--card) !important;
        color: var(--foreground) !important;
        padding: 1rem 1.25rem !important;
        border-bottom: 1px solid var(--border) !important;
    }
    
    .news-detail-date {
        color: var(--muted-foreground) !important;
    }
    
    .news-detail-title {
        color: var(--foreground) !important;
        font-size: 1.5rem !important;
        text-shadow: none !important;
    }
    
    .news-detail-body {
        border-left: none !important;
        padding: 1.25rem !important;
        margin: 0 !important;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    /* Hero Section 小螢幕美化 */
    .hero-section {
        padding: 4rem 0 3rem;
        min-height: 85vh;
    }
    
    .hero-content {
        padding: 0 1rem;
    }
    
    /* Hero Badge 小螢幕 */
    .hero-trial-badge {
        max-width: 320px;
        padding: 1.125rem 2.25rem;
        font-size: 1.2rem;
        min-height: 60px;
    }
    
    /* 標題小螢幕 */
    .hero-title {
        font-size: 2rem !important; /* 進一步縮小字體 */
        margin-bottom: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
        white-space: nowrap; /* 確保不換行 */
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        padding: 0 0.25rem; /* 進一步減少左右內邊距 */
    }
    
    /* 描述區塊小螢幕美化 */
    .hero-description-enhanced {
        margin: 1.25rem 0 1.75rem;
        padding: 0.875rem;
        background: linear-gradient(135deg, rgba(45, 55, 72, 0.8), rgba(74, 85, 104, 0.8));
        border-radius: 10px;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 193, 7, 0.2);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    
    .hero-description-enhanced .description-line {
        font-size: 0.9rem !important;
        margin: 0.375rem 0 !important;
        padding: 0.625rem !important;
        border-radius: 6px !important;
        min-height: auto !important;
        line-height: 1.3 !important;
    }
    
    .description-line.primary {
        font-size: 1rem !important;
        font-weight: 600 !important;
    }
    
    .description-line.highlight {
        color: #fbbf24 !important;
        font-weight: 600 !important;
        border-left: 3px solid #fbbf24 !important;
    }
    
    .description-line.accent {
        color: #10b981 !important;
        font-weight: 500 !important;
    }
    
    .description-line.action {
        color: #8b5cf6 !important;
        font-weight: 500 !important;
    }
    
    /* 按鈕小螢幕 */
    .hero-buttons {
        max-width: 300px;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        font-size: 1.1rem;
        padding: 1rem 1.75rem;
        min-height: 50px;
    }
    
    /* 統計數據小螢幕 - 隱藏 */
    .hero-stats {
        display: none !important;
    }
    
    /* 最新消息小螢幕優化 */
    .news-card {
        flex: 0 0 calc(70% - 0.5rem) !important;
        min-width: 260px !important;
        max-width: 300px !important;
    }
    
    /* 小螢幕 CTA 按鈕調整 */
    .news-more .btn-small {
        padding: 0.6rem 1.1rem !important;
        font-size: 0.75rem !important;
        border-radius: 18px !important;
    }
    
    .news-nav {
        left: -1rem !important;
        right: -1rem !important;
    }
    
    .news-nav button {
        width: 2.75rem !important;
        height: 2.75rem !important;
        font-size: 1.1rem !important;
    }
    
    .news-nav button:hover:not(:disabled):not([style*="pointer-events: none"]) {
        background: linear-gradient(135deg, rgba(56, 178, 172, 1), rgba(147, 51, 234, 1)) !important;
        transform: scale(1.1) !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
    }
    
    .news-nav button:disabled,
    .news-nav button[style*="pointer-events: none"],
    .news-nav button[style*="opacity: 0.3"] {
        opacity: 0.3 !important;
        cursor: not-allowed !important;
        pointer-events: none !important;
        transform: none !important;
    }
    
    
    /* 遊戲區塊小螢幕 */
    .mahjong-games-grid {
        gap: 0.75rem;
    }
    
    .mahjong-game-title {
        font-size: 1.1rem;
    }
    
    .mahjong-game-description {
        font-size: 0.9rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .section-title {
        font-size: 1.85rem;
    }
    
    /* 小螢幕新聞詳情優化 */
    .news-dialog {
        width: 98% !important;
        max-height: 98vh !important;
    }
    
    .news-detail-info {
        padding: 0.875rem 1rem !important;
    }
    
    .news-detail-title {
        font-size: 1.25rem !important;
    }
    
    .news-detail-body {
        padding: 1rem !important;
    }
    
    .news-detail-body h3 {
        font-size: 1.1rem !important;
        margin: 1.5rem 0 1rem !important;
    }
    
    .activity-details,
    .game-features,
    .live-features {
        padding: 1.25rem !important;
        margin: 1.25rem 0 !important;
    }
    
    /* 限時優惠小螢幕優化 */
    .promotions-nav-btn {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
    
    .promotions-nav-btn svg {
        width: 1rem !important;
        height: 1rem !important;
    }
    
    .promotions-prev {
        margin-left: 0.5rem !important;
    }
    
    .promotions-next {
        margin-right: 0.5rem !important;
    }
    
    .promotion-card {
        flex: 0 0 calc(100% - 1rem) !important;
        max-width: calc(100% - 1rem) !important;
        margin: 0 0.5rem !important;
    }
    
    /* 限時優惠 CTA 按鈕小螢幕 */
    .btn-promotion-cta {
        padding: 0.875rem 1.25rem !important;
        font-size: 1rem !important;
        border-radius: 20px !important;
        gap: 0.5rem !important;
    }
    
    .promotion-cta-icon,
    .promotion-cta-arrow {
        width: 1.1rem !important;
        height: 1.1rem !important;
    }
}

/* Very Small Screens */
@media (max-width: 360px) {
    .container {
        padding: 0 0.5rem;
    }
    
    /* Hero 超小螢幕美化 */
    .hero-section {
        padding: 3.5rem 0 2.5rem;
    }
    
    .hero-content {
        padding: 0 0.75rem;
    }
    
    .hero-trial-badge {
        max-width: 280px;
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
    
    .hero-title {
        font-size: 1.8rem !important; /* 進一步縮小字體 */
        margin-bottom: 1.25rem;
    }
    
    .hero-subtitle {
        font-size: 0.8rem; /* 進一步縮小字體 */
        margin-bottom: 1.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        padding: 0 0.1rem; /* 再次減少左右內邊距 */
    }
    
    .hero-description-enhanced {
        margin: 1.5rem 0 2rem;
        padding: 1rem;
        background: linear-gradient(135deg, rgba(45, 55, 72, 0.8), rgba(74, 85, 104, 0.8));
        border-radius: 12px;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 193, 7, 0.2);
    }
    
    .hero-buttons {
        max-width: 280px;
    }
    
    .hero-buttons .btn {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
        min-height: 48px;
    }
    
    /* 統計數據超小螢幕 - 隱藏 */
    .hero-stats {
        display: none !important;
    }
    
    /* 最新消息超小螢幕 */
    .news-viewport {
        padding: 0 0.75rem !important;
    }
    
    .news-card { 
        flex: 0 0 calc(75% - 0.5rem) !important;
        min-width: 240px !important;
        max-width: 280px !important;
    }
    
    /* 超小螢幕 CTA 按鈕調整 */
    .news-more .btn-small {
        padding: 0.55rem 1rem !important;
        font-size: 0.7rem !important;
        border-radius: 16px !important;
        letter-spacing: 0.3px !important;
    }
    
    .news-nav { 
        left: -0.75rem !important;
        right: -0.75rem !important;
    }
    
    .news-nav button {
        width: 2.5rem !important;
        height: 2.5rem !important;
        font-size: 1rem !important;
    }
    
    /* 超小螢幕新聞詳情優化 */
    .news-dialog {
        width: 99% !important;
        max-height: 99vh !important;
    }
    
    .news-detail-info {
        padding: 0.75rem !important;
    }
    
    .news-detail-title {
        font-size: 1.125rem !important;
    }
    
    .news-detail-body {
        padding: 0.875rem !important;
        font-size: 0.9rem !important;
    }
    
    .news-detail-body li::before {
        width: 6px !important;
        height: 6px !important;
        top: 0.4rem !important;
        left: 0 !important;
    }
    
    .news-detail-body h3 {
        font-size: 1rem !important;
        margin: 1.25rem 0 0.875rem !important;
    }
    
    .activity-details,
    .game-features,
    .live-features {
        padding: 1rem !important;
        margin: 1rem 0 !important;
    }
    
    .news-dialog-footer {
        padding: 1rem !important;
    }
    
    
    .news-nav button:hover:not(:disabled):not([style*="pointer-events: none"]) {
        background: linear-gradient(135deg, rgba(56, 178, 172, 1), rgba(147, 51, 234, 1)) !important;
        transform: scale(1.1) !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
    }
    
    .news-nav button:disabled,
    .news-nav button[style*="pointer-events: none"],
    .news-nav button[style*="opacity: 0.3"] {
        opacity: 0.3 !important;
        cursor: not-allowed !important;
        pointer-events: none !important;
        transform: none !important;
    }
}

/* Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .btn:active,
    .hero-trial-badge:active {
        transform: scale(0.95);
    }
    
    /* 觸控設備 CTA 按鈕增強反饋 */
    .news-more .btn-small:active {
        transform: scale(0.96) translateY(-1px) !important;
        background: linear-gradient(135deg, rgba(56, 178, 172, 1), rgba(147, 51, 234, 1)) !important;
        box-shadow: 0 6px 20px rgba(56, 178, 172, 0.6) !important;
    }
    
    /* 觸控設備漢堡選單按鈕增強反饋 */
    .nav-mobile-toggle:active {
        transform: scale(0.9) !important;
        background: linear-gradient(135deg, rgba(56, 178, 172, 1), rgba(147, 51, 234, 1)) !important;
        box-shadow: 0 4px 15px rgba(56, 178, 172, 0.7) !important;
    }
    
    /* 限時優惠手機版滑動 */
    .promotions-nav {
        display: flex !important;
    }
    
    .promotions-viewport {
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        scroll-behavior: smooth !important;
    }
    
    .promotions-container {
        display: flex !important;
        gap: 1rem !important;
        grid-template-columns: none !important;
    }
    
    .promotion-card {
        flex: 0 0 calc(100% - 2rem) !important;
        max-width: calc(100% - 2rem) !important;
        scroll-snap-align: start !important;
        margin: 0 1rem !important;
    }
    
    /* 限時優惠 CTA 按鈕手機版 */
    .btn-promotion-cta {
        width: 100% !important;
        padding: 1rem 1.5rem !important;
        font-size: 1.1rem !important;
        border-radius: 25px !important;
        gap: 0.75rem !important;
    }
    
    .promotion-cta-icon,
    .promotion-cta-arrow {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }
    
    .promotions-nav-btn {
        width: 2.75rem !important;
        height: 2.75rem !important;
    }
    
    .promotions-nav-btn svg {
        width: 1.1rem !important;
        height: 1.1rem !important;
    }
    
    .promotions-prev {
        margin-left: 0.75rem !important;
    }
    
    .promotions-next {
        margin-right: 0.75rem !important;
    }
    
    /* 限時優惠按鈕禁用狀態 */
    .promotions-nav-btn:disabled,
    .promotions-nav-btn[style*="pointer-events: none"],
    .promotions-nav-btn[style*="opacity: 0.3"] {
        opacity: 0.3 !important;
        pointer-events: none !important;
        transform: none !important;
        box-shadow: 0 4px 15px rgba(56, 178, 172, 0.2) !important;
    }
    
    /* 限時優惠觸控反饋 */
    .promotions-nav-btn:active {
        transform: scale(0.9) !important;
        background: linear-gradient(135deg, rgba(56, 178, 172, 1), rgba(147, 51, 234, 1)) !important;
        box-shadow: 0 4px 15px rgba(56, 178, 172, 0.7) !important;
    }
    
    a, button {
        min-height: 44px;
    }
    
    .news-more .btn-small {
        min-height: 44px !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    /* 為偏好減少動畫的用戶提供靜態樣式 */
    .news-more .btn-small {
        animation: none !important;
        box-shadow: 0 4px 15px rgba(56, 178, 172, 0.4) !important;
    }
    
    .news-more .btn-small:hover {
        animation: none !important;
    }
    
    /* 漢堡選單按鈕靜態樣式 */
    .nav-mobile-toggle {
        animation: none !important;
        box-shadow: 0 6px 20px rgba(56, 178, 172, 0.5) !important;
    }
    
    .nav-mobile-toggle:hover {
        transform: scale(1.05) !important;
    }
    
    /* 限時優惠 CTA 按鈕靜態樣式 */
    .btn-promotion-cta {
        animation: none !important;
        box-shadow: 0 6px 20px rgba(56, 178, 172, 0.5) !important;
    }
    
    .btn-promotion-cta:hover {
        transform: translateY(-1px) !important;
    }
    
    .btn-promotion-cta:hover .promotion-cta-icon {
        transform: scale(1.05) !important;
    }
}
