/* 首页样式 - 响应式设计 */

/* 基础容器 */
.page-container {
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    background: #f5f7fa;
    position: relative;
}

@media (min-width: 768px) {
    .page-container {
        max-width: 480px;
    }
}

/* 顶部导航 */
.home-top-nav {
    background: #fff;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.home-logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-logo-icon {
    width: 36px;
    height: 36px;
    background: #3b5998;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
}

.home-logo-text {
    font-size: 18px;
    font-weight: bold;
    color: #3b5998;
}

.home-logo-sub {
    font-size: 10px;
    color: #999;
}

.home-download-btn {
    background: #3b82f6;
    color: #fff;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    text-decoration: none;
}

/* Banner样式 */
.home-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    margin: 10px;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.home-banner-main {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

@media (max-width: 375px) {
    .home-banner-main {
        flex-direction: column;
    }
}

.home-banner-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    padding: 20px 15px;
    text-align: center;
    min-width: 100px;
}

.home-banner-nav h3 {
    color: #fff;
    font-size: 22px;
    margin-bottom: 5px;
}

.home-banner-nav p {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
}

.home-banner-links {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (max-width: 375px) {
    .home-banner-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

.home-banner-link {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
}

.home-banner-link.blue {
    background: rgba(59, 130, 246, 0.3);
}

.home-banner-link-title {
    color: #60a5fa;
    font-size: 11px;
    margin-bottom: 3px;
}

.home-banner-link-url {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

.home-banner-qq {
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 8px 20px;
    text-align: center;
    margin-top: 15px;
    color: #fff;
    font-size: 13px;
}

/* 公告 */
/* 轮播图样式 */
.home-banner-carousel {
    width: calc(100% - 20px);
    height: 178px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #1a1a2e;
    margin: 10px auto;
}

.carousel-wrapper {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s;
}

.indicator.active {
    background: #fff;
    width: 20px;
    border-radius: 4px;
}

/* 公告 */
.home-notice {
    background: #fff;
    margin: 10px;
    padding: 12px 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-notice-icon {
    width: 28px;
    height: 28px;
    background: #fbbf24;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
}

.home-notice-icon-img {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.home-notice-icon-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.home-notice-text {
    flex: 1;
    font-size: 13px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 用户信息 */
.home-user-card {
    background: #fff;
    margin: 10px;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.home-user-left {
    display: flex;
    flex-direction: column;
}

.home-user-name {
    font-size: 14px;
    color: #999;
}

.home-user-balance {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.home-user-actions {
    display: flex;
    gap: 20px;
}

@media (max-width: 375px) {
    .home-user-actions {
        gap: 15px;
    }
}

.home-user-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.home-user-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

@media (min-width: 400px) {
    .home-user-action-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
}

.home-user-action-icon.blue {
    background: #dbeafe;
    color: #3b82f6;
}

.home-user-action-icon.red {
    background: #fee2e2;
    color: #ef4444;
}

.home-user-action-icon.green {
    background: #d1fae5;
    color: #10b981;
}

.home-user-action-icon.purple {
    background: #ede9fe;
    color: #8b5cf6;
}

/* 图片图标样式 */
.home-user-action-icon-img {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-user-action-icon-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (min-width: 400px) {
    .home-user-action-icon-img {
        width: 42px;
        height: 42px;
    }
}

.home-user-action-text {
    font-size: 12px;
    color: #666;
}

/* 游戏网格 */
.home-games {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px;
    padding-bottom: 80px;
}

.home-games-row {
    display: flex;
    gap: 10px;
}

.home-games-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.home-games-row-three {
    display: flex;
    gap: 10px;
}

/* 游戏区域行 - 2:1 比例 */
.home-games-row {
    display: flex;
    gap: 10px;
}

/* 加拿大PC28 大卡片 - 占 2/3 */
.home-game-card-large {
    flex: 2;
    background: linear-gradient(228deg, #b7c6f8, #fff 40%);
    box-shadow: 0 .05rem .08rem #3584d033;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
}

.home-game-card-large .game-bg-img {
    width: 100%;
    height: 66%;
    object-fit: contain;
    object-position: center;
    margin: auto;
}

.home-game-card-large .game-card-title {
    font-size: 22px;
    font-weight: 800;
    color: #333;
    padding: 8px 12px;
    text-align: center;
}

/* 右侧列 - 占 1/3 */
.home-games-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 右侧小卡片（台湾28、比特28） */
.home-game-card-small {
    flex: 1;
    background: linear-gradient(228deg, #b7c6f8, #fff 40%);
    box-shadow: 0 .05rem .08rem #3584d033;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.home-game-card-small .game-bg-img-small {
    width: 100%;
    height: 66%;
    object-fit: contain;
    object-position: center;
    padding: 5px;
}

.home-game-card-small .game-card-title-small {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    height: 34%;
}

/* 底部三个小卡片 - 与上面风格一致 */
.home-games-row-three {
    display: flex;
    gap: 10px;
}

.home-game-card-item {
    flex: 1;
    background: linear-gradient(228deg, #b7c6f8, #fff 40%);
    box-shadow: 0 .05rem .08rem #3584d033;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
}

.home-game-card-item .game-bg-img-item {
    width: 100%;
    height: 66%;
    object-fit: contain;
    object-position: center;
    padding: 5px;
}

.home-game-card-item .game-card-title-item {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    height: 34%;
}

.game-dot {
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 50%;
    flex-shrink: 0;
}

@media (min-width: 400px) {
    .home-game-card-large .game-card-title {
        font-size: 24px;
    }
    .home-game-card-small .game-card-title-small,
    .home-game-card-item .game-card-title-item {
        font-size: 18px;
    }
}

.home-game-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

@media (min-width: 400px) {
    .home-game-title {
        font-size: 15px;
    }
}

.home-game-dot {
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 50%;
}

.home-game-image {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 70px;
    height: 70px;
}

@media (min-width: 400px) {
    .home-game-image {
        width: 90px;
        height: 90px;
    }
}

.home-game-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.home-game-overlay {
    position: absolute;
    bottom: 15px;
    left: 15px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

@media (min-width: 400px) {
    .home-game-overlay {
        font-size: 18px;
    }
}

.home-game-crown {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 18px;
}

@media (min-width: 400px) {
    .home-game-crown {
        font-size: 20px;
    }
}

/* 游戏选择弹窗 */
.game-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.game-modal-overlay.active {
    display: flex;
}

.game-modal {
    background: #fff;
    width: 100%;
    max-width: 480px;
    border-radius: 20px 20px 0 0;
    max-height: 80vh;
    overflow-y: auto;
}

.game-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.game-modal-title {
    font-size: 16px;
    color: #333;
}

.game-modal-close {
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.game-room-list {
    padding: 10px 0;
}

.game-room-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
}

.game-room-item:hover {
    background: #f9f9f9;
}

.game-room-flag {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff0000 0%, #fff 50%, #ff0000 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 15px;
    flex-shrink: 0;
}

.game-room-info {
    flex: 1;
}

.game-room-name {
    font-size: 15px;
    color: #333;
    font-weight: bold;
}

.game-room-players {
    font-size: 13px;
    color: #999;
}

/* PWA添加到主屏幕提示弹窗 */
.pwa-prompt {
    position: fixed;
    bottom: 70px;
    left: 10px;
    right: 10px;
    background: rgba(30, 41, 59, 0.98);
    border-radius: 12px;
    padding: 12px 15px;
    z-index: 1500;
    display: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.pwa-prompt.active {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.pwa-prompt-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
}

.pwa-prompt-icon-box {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-share-icon {
    font-size: 20px;
}

.pwa-prompt-info {
    flex: 1;
}

.pwa-prompt-title {
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 6px;
}

.pwa-prompt-close {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    cursor: pointer;
    padding: 2px;
}

.pwa-prompt-close:hover {
    color: #fff;
}

.pwa-prompt-body {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
}

/* 公告弹窗 */
.announcement-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.announcement-modal.active {
    display: flex;
}

.announcement-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 340px;
    overflow: hidden;
}

.announcement-header {
    background: #4a6fa5;
    padding: 15px 20px;
    text-align: center;
    position: relative;
}

.announcement-title {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.announcement-time {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
}

.announcement-close {
    position: absolute;
    right: 10px;
    top: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcement-body {
    padding: 20px;
    font-size: 14px;
    color: #333;
    line-height: 1.8;
    min-height: 120px;
}

.announcement-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.announcement-btn {
    padding: 8px 20px;
    border: none;
    background: #e8f0fe;
    color: #3b82f6;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
}

.announcement-btn:disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

.announcement-page {
    font-size: 13px;
    color: #666;
}

/* 响应式适配 */
@media (max-width: 375px) {
    .pwa-prompt {
        bottom: 70px;
        padding: 12px;
    }

    .pwa-prompt-title {
        font-size: 14px;
    }

    .pwa-prompt-body {
        font-size: 12px;
        padding-left: 24px;
    }

    .announcement-content {
        max-width: 300px;
    }

    .announcement-header {
        padding: 12px 15px;
    }

    .announcement-title {
        font-size: 15px;
    }

    .announcement-body {
        padding: 15px;
        font-size: 13px;
    }

    .announcement-btn {
        padding: 6px 15px;
        font-size: 12px;
    }
}
