/* ============================================================
   index.css - 首页样式（与 result.html 统一配色）
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(180deg, #fff4e0 0%, #ffeef5 45%, #e8f4ff 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
    color: #3a2e2a;
    overflow-x: hidden;
}

/* ========== 顶部 Banner ========== */
.banner {
    width: 100%;
    display: block;
    background: linear-gradient(90deg, #ff8a3d 0%, #ffb380 50%, #66b3ff 100%);
    box-shadow: 0 4px 20px rgba(255, 138, 61, 0.25);
    position: relative;
    z-index: 2;
}

.banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* ========== 主舞台 ========== */
.stage {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ========== 角色展示 ========== */
.characters {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
    perspective: 600px;
}

.char-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: float 3.2s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(255, 138, 61, 0.35));
}

.char-dog {
    animation-delay: 0.4s;
    filter: drop-shadow(0 8px 16px rgba(33, 150, 243, 0.3));
}

/* 精灵图容器：home.png 单图 (1024×384) */
.char {
    width: 256px;
    height: 256px;
    background-image: url('../assets/npc/home.png');
    background-repeat: no-repeat;
    background-size: 2048px 768px;
    image-rendering: pixelated;
    image-rendering: -webkit-optimize-contrast;
}

.char-cat .char {
    animation: spinCat 1.6s steps(8) infinite;
}

.char-dog .char {
    animation: spinDog 1.6s steps(8) infinite 0.2s;
}

.char-label {
    font-size: 16px;
    font-weight: bold;
    color: #5d3a1a;
    background: rgba(255, 255, 255, 0.85);
    padding: 4px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 200, 150, 0.5);
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(255, 170, 120, 0.25);
}

/* VS 徽章 */
.vs-badge {
    font-size: 36px;
    font-weight: 900;
    font-style: italic;
    color: #fff;
    background: linear-gradient(135deg, #ff6b35 0%, #ff2975 50%, #5856d6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 24px rgba(255, 107, 53, 0.4);
    margin: 0 8px;
    align-self: center;
    padding-bottom: 28px;
    animation: pulse-vs 1.4s ease-in-out infinite;
}

/* ========== 文案 ========== */
.title {
    font-size: 38px;
    font-weight: 900;
    background: linear-gradient(90deg, #ff8a3d 0%, #ff2975 50%, #66b3ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    font-size: 16px;
    color: #a08770;
    margin-bottom: 36px;
    text-align: center;
    letter-spacing: 1px;
}

/* ========== 三个入口按钮 ========== */
.buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 800px;
}

.btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 26px 16px;
    border-radius: 18px;
    text-decoration: none;
    color: #3a2e2a;
    background: rgba(255, 255, 255, 0.78);
    border: 2px solid rgba(255, 200, 150, 0.35);
    box-shadow:
        0 8px 20px rgba(255, 170, 120, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-4px);
    box-shadow:
        0 12px 28px rgba(255, 138, 61, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 138, 61, 0.55);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 40px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(255, 138, 61, 0.3));
}

.btn-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #3a2e2a;
}

.btn-hint {
    font-size: 12px;
    color: #a08770;
    letter-spacing: 1px;
}

/* 主按钮强调（进入游戏） */
.btn-game {
    background: linear-gradient(135deg, #ff8a3d 0%, #ffb380 100%);
    border-color: #ffb380;
    color: #fff;
    box-shadow: 0 8px 20px rgba(255, 138, 61, 0.35);
}
.btn-game .btn-text { color: #fff; }
.btn-game .btn-hint { color: rgba(255, 255, 255, 0.9); }

/* 主播后台 */
.btn-console {
    background: linear-gradient(135deg, #4facfe 0%, #66b3ff 100%);
    border-color: #66b3ff;
    color: #fff;
    box-shadow: 0 8px 20px rgba(33, 150, 243, 0.3);
}
.btn-console .btn-text { color: #fff; }
.btn-console .btn-hint { color: rgba(255, 255, 255, 0.9); }

/* 主播对战 */
.btn-battle {
    background: linear-gradient(135deg, #f5576c 0%, #ff8a3d 50%, #ffb380 100%);
    border-color: #f5576c;
    color: #fff;
    box-shadow: 0 8px 20px rgba(245, 87, 108, 0.3);
}
.btn-battle .btn-text { color: #fff; }
.btn-battle .btn-hint { color: rgba(255, 255, 255, 0.9); }

/* ========== 底部 ========== */
.foot {
    text-align: center;
    padding: 20px 0 24px;
    color: #a08770;
    font-size: 12px;
    letter-spacing: 1px;
}

/* ========== 动画 ========== */
@keyframes spinDog {
    from { background-position: 0 0; }
    to   { background-position: -2048px 0; }
}

@keyframes spinCat {
    from { background-position: 0 -512px; }
    to   { background-position: -2048px -512px; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-14px); }
}

@keyframes pulse-vs {
    0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 12px rgba(255, 107, 53, 0.4)); }
    50%      { transform: scale(1.12); filter: drop-shadow(0 0 24px rgba(255, 107, 53, 0.7)); }
}

/* ========== 响应式：手机端紧凑布局 ========== */
@media (max-width: 640px) {
    .stage {
        padding: 16px 16px 12px;
    }

    .characters {
        gap: 12px;
        margin-bottom: 14px;
    }
    .char-wrap { gap: 6px; }
    .char {
        width: 128px;
        height: 128px;
        background-size: 1024px 384px;
    }
    .char-label {
        font-size: 12px;
        padding: 3px 10px;
        letter-spacing: 1px;
    }

    .vs-badge {
        font-size: 26px;
        padding-bottom: 18px;
        margin: 0 4px;
    }

    .title {
        font-size: 24px;
        letter-spacing: 1px;
        margin-bottom: 6px;
    }

    .subtitle {
        font-size: 12px;
        margin-bottom: 18px;
        letter-spacing: 1px;
    }

    .buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        max-width: 100%;
    }
    .btn {
        padding: 14px 6px;
        border-radius: 14px;
        gap: 4px;
    }
    .btn-icon { font-size: 26px; }
    .btn-text { font-size: 14px; letter-spacing: 1px; }
    .btn-hint { font-size: 10px; }

    .foot {
        padding: 12px 0 14px;
        font-size: 11px;
    }

    @keyframes spinDog {
        from { background-position: 0 0; }
        to   { background-position: -1024px 0; }
    }
    @keyframes spinCat {
        from { background-position: 0 -256px; }
        to   { background-position: -1024px -256px; }
    }
}

@media (max-width: 360px) {
    .char { width: 96px; height: 96px; background-size: 768px 288px; }
    .vs-badge { font-size: 22px; padding-bottom: 14px; }
    .title { font-size: 20px; }
    .btn { padding: 10px 4px; }
    .btn-icon { font-size: 22px; }
    .btn-text { font-size: 12px; }
    @keyframes spinDog {
        from { background-position: 0 0; }
        to   { background-position: -768px 0; }
    }
    @keyframes spinCat {
        from { background-position: 0 -192px; }
        to   { background-position: -768px -192px; }
    }
}
