/* ============================================
   封神与哪吒 - 大厅页面样式
   lobby.html 专用
   ============================================ */

/* ---------- 大厅容器 ---------- */
.lobby {
    position: relative;
    width: 100%;
    min-height: 667px;
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg);
    /* 背景图层叠 */
    background-image:
        url('../assets/images/bg_lobby.jpg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

/* 背景半透明叠加层 —— 宣纸质感 */
.lobby::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        /* 半透明白色叠加 */
        linear-gradient(
            180deg,
            rgba(245, 239, 224, 0.75) 0%,
            rgba(245, 239, 224, 0.88) 40%,
            rgba(245, 239, 224, 0.92) 100%
        );
    /* 纸张纤维纹理 */
    background-image:
        linear-gradient(
            180deg,
            rgba(245, 239, 224, 0.75) 0%,
            rgba(245, 239, 224, 0.88) 40%,
            rgba(245, 239, 224, 0.92) 100%
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(44, 44, 44, 0.008) 2px,
            rgba(44, 44, 44, 0.008) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 4px,
            rgba(44, 44, 44, 0.005) 4px,
            rgba(44, 44, 44, 0.005) 5px
        );
    pointer-events: none;
    z-index: 0;
}

/* 确保所有子元素在叠加层之上 */
.lobby > * {
    position: relative;
    z-index: 1;
}

/* ============================================
   1. 顶部资源栏
   ============================================ */
.resource-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    animation: fadeInUp 0.5s ease both;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;  /* 13px */
    font-weight: 500;
    color: var(--color-ink);
}

/* 资源图标（纯 CSS 圆形） */
.resource-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.resource-icon--gold {
    background: linear-gradient(135deg, #f0c75e 0%, #c4952e 100%);
    box-shadow: 0 1px 4px rgba(196, 149, 46, 0.4);
}

.resource-icon--gem {
    background: linear-gradient(135deg, #8eb8e0 0%, #5a8ab5 100%);
    box-shadow: 0 1px 4px rgba(90, 138, 181, 0.4);
}

.resource-icon--energy {
    background: linear-gradient(135deg, #f0a83e 0%, #d48a20 100%);
    box-shadow: 0 1px 4px rgba(212, 138, 32, 0.4);
}

/* 资源数值闪光 */
.resource-value {
    animation: shimmer 3s ease-in-out infinite;
    font-variant-numeric: tabular-nums;
}

/* 第二个数值延迟闪光 */
.resource-item:nth-child(2) .resource-value {
    animation-delay: 1s;
}
.resource-item:nth-child(3) .resource-value {
    animation-delay: 2s;
}

/* ============================================
   2. 标题区域
   ============================================ */
.title-section {
    text-align: center;
    padding: 18px 16px 14px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.game-title {
    font-family: var(--font-title);
    font-size: 2rem;  /* 32px */
    color: var(--color-gold);
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.15),
        0 0 20px rgba(212, 168, 83, 0.2);
    letter-spacing: 0.15em;
    line-height: 1.4;
    margin-bottom: 6px;
}

.game-subtitle {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: var(--color-ink-light);
    letter-spacing: 0.2em;
    font-weight: 300;
}

/* 标题装饰线 */
.title-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.title-divider::before,
.title-divider::after {
    content: '';
    width: 40px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--color-gold),
        transparent
    );
}

.title-divider-dot {
    width: 5px;
    height: 5px;
    background: var(--color-gold);
    transform: rotate(45deg);
    flex-shrink: 0;
}

/* ============================================
   3. 中央核心按钮区域
   ============================================ */
.action-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 24px 18px;
    animation: fadeInUp 0.7s ease 0.2s both;
}

/* 主按钮：开始战斗 */
.btn-battle {
    flex: 0 0 auto;
    width: 160px;
    height: 56px;
    border-radius: var(--radius-lg);
    font-family: var(--font-title);
    font-size: 1.25rem;
    letter-spacing: 0.12em;
    color: #fff;
    background: linear-gradient(
        180deg,
        #d64545 0%,
        #c03c3c 50%,
        #a83232 100%
    );
    border: 2px solid var(--color-gold);
    box-shadow:
        var(--shadow-ink),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 20px var(--color-red-glow);
    /* 水墨溅射 —— 伪元素 */
    position: relative;
}

/* 水墨溅射装饰 */
.btn-battle::before,
.btn-battle::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(192, 60, 60, 0.3),
        transparent 70%
    );
    pointer-events: none;
    z-index: -1;
}

.btn-battle::before {
    width: 180px;
    height: 30px;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    filter: blur(6px);
}

.btn-battle::after {
    width: 50px;
    height: 50px;
    top: -8px;
    right: -8px;
    filter: blur(8px);
    opacity: 0.5;
}

/* 开始战斗 hover 水墨晕染 */
.btn-battle:hover {
    box-shadow:
        var(--shadow-ink-heavy),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 30px var(--color-red-glow),
        0 0 60px rgba(192, 60, 60, 0.2);
    background: linear-gradient(
        180deg,
        #e04e4e 0%,
        #c94545 50%,
        #b03838 100%
    );
}

/* 小按钮通用 */
.btn-action-small {
    width: 80px;
    height: 44px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--color-ink);
    background:
        linear-gradient(
            180deg,
            rgba(245, 239, 224, 0.95) 0%,
            rgba(232, 224, 204, 0.9) 100%
        );
    border: 1.5px solid var(--color-gold-dark);
    box-shadow: var(--shadow-ink);
}

/* 小按钮 hover */
.btn-action-small:hover {
    border-color: var(--color-gold);
    box-shadow: var(--shadow-gold);
    background: linear-gradient(
        180deg,
        rgba(245, 239, 224, 1) 0%,
        rgba(240, 232, 212, 0.95) 100%
    );
}

/* 签到按钮特殊标记 */
.btn-action-small .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-red);
    border: 1.5px solid var(--color-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ============================================
   4. 底部导航网格（2x3）
   ============================================ */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    padding: 6px 24px 14px;
    animation: fadeInUp 0.8s ease 0.3s both;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 68px;
    border-radius: var(--radius-md);
    background:
        linear-gradient(
            180deg,
            rgba(245, 239, 224, 0.85) 0%,
            rgba(232, 224, 204, 0.75) 100%
        );
    border: 1.5px solid rgba(212, 168, 83, 0.35);
    box-shadow: var(--shadow-ink);
    cursor: pointer;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-normal),
        border-color var(--transition-normal);
    text-decoration: none;
    color: var(--color-ink);
}

/* 导航按钮图标区 */
.nav-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: linear-gradient(
        135deg,
        rgba(212, 168, 83, 0.15) 0%,
        rgba(155, 142, 196, 0.1) 100%
    );
    border: 1px solid rgba(212, 168, 83, 0.25);
}

/* 导航按钮文字 */
.nav-btn-text {
    font-size: 0.6875rem;  /* 11px */
    font-weight: 500;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* 导航 hover 水墨晕染 */
.nav-btn:hover {
    transform: translateY(-2px);
    border-color: var(--color-gold);
    box-shadow:
        var(--shadow-gold),
        0 0 15px rgba(212, 168, 83, 0.15);
}

/* 导航按钮按压 */
.nav-btn:active {
    transform: scale(0.94) translateY(0);
    box-shadow: var(--shadow-ink);
}

/* ============================================
   5. 底部玩家信息栏
   ============================================ */
.player-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px calc(12px + var(--safe-bottom));
    margin: 0 12px 8px;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(
            180deg,
            rgba(245, 239, 224, 0.9) 0%,
            rgba(232, 224, 204, 0.8) 100%
        );
    border: 1px solid rgba(212, 168, 83, 0.2);
    box-shadow: var(--shadow-ink);
    animation: fadeInUp 0.9s ease 0.4s both;
}

/* 玩家头像 */
.player-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(
        135deg,
        var(--color-purple) 0%,
        var(--color-purple-dark) 100%
    );
    border: 2px solid var(--color-gold);
    box-shadow: 0 2px 6px rgba(155, 142, 196, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

/* 玩家信息文字区 */
.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-family: var(--font-title);
    font-size: 0.9375rem;
    color: var(--color-ink);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-title {
    font-size: 0.6875rem;
    color: var(--color-ink-light);
    margin-top: 1px;
}

/* 等级/星级 */
.player-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.player-level-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--color-gold) 0%,
        var(--color-gold-dark) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-size: 0.875rem;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(212, 168, 83, 0.35);
}

.player-stars {
    font-size: 0.625rem;
    color: var(--color-gold);
    letter-spacing: 1px;
}

/* ============================================
   装饰元素
   ============================================ */

/* 顶部水墨山形装饰 */
.lobby-deco-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(
        180deg,
        rgba(245, 239, 224, 0.5) 0%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 0;
}

/* 底部水墨雾气装饰 */
.lobby-deco-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(
        0deg,
        rgba(245, 239, 224, 0.6) 0%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 0;
}

/* 仙气浮动粒子（纯 CSS） */
.fairy-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(155, 142, 196, 0.4);
    pointer-events: none;
    z-index: 0;
    animation: floatParticle 6s ease-in-out infinite;
}

.fairy-particle:nth-child(1) {
    left: 15%;
    top: 25%;
    animation-delay: 0s;
    animation-duration: 7s;
}

.fairy-particle:nth-child(2) {
    left: 75%;
    top: 35%;
    animation-delay: 2s;
    animation-duration: 5s;
    width: 3px;
    height: 3px;
}

.fairy-particle:nth-child(3) {
    left: 45%;
    top: 55%;
    animation-delay: 1s;
    animation-duration: 8s;
    width: 5px;
    height: 5px;
    background: rgba(212, 168, 83, 0.3);
}

.fairy-particle:nth-child(4) {
    left: 85%;
    top: 65%;
    animation-delay: 3s;
    animation-duration: 6s;
    width: 3px;
    height: 3px;
}

.fairy-particle:nth-child(5) {
    left: 25%;
    top: 80%;
    animation-delay: 4s;
    animation-duration: 9s;
    width: 4px;
    height: 4px;
    background: rgba(212, 168, 83, 0.25);
}

@keyframes floatParticle {
    0%, 100% {
        opacity: 0;
        transform: translate(0, 0);
    }
    25% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
        transform: translate(10px, -20px);
    }
    75% {
        opacity: 0.3;
    }
}

/* ============================================
   响应式微调
   ============================================ */
@media screen and (max-width: 320px) {
    .game-title {
        font-size: 1.625rem;
    }
    .btn-battle {
        width: 140px;
        height: 48px;
        font-size: 1.125rem;
    }
    .btn-action-small {
        width: 68px;
        height: 40px;
        font-size: 0.6875rem;
    }
    .nav-btn {
        height: 60px;
    }
}
