/* home.css - 主界面（电竞经理风格） */

.scene--home { overflow: hidden !important; }

/* ── 全屏背景 ── */
.home-bg {
    position: fixed; inset: 0; z-index: 0;
    background:
        url('../../resources/bg/home-bg.webp') center/cover no-repeat,
        linear-gradient(135deg, #0a0e17 0%, #162038 40%, #1a1040 70%, #0a0e17 100%);
}
.home-bg::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg,
        rgba(10,14,23,0.1) 0%,
        rgba(10,14,23,0) 30%,
        rgba(10,14,23,0.55) 100%
    );
}

.home-layout {
    position: relative; z-index: 1;
    display: flex; flex-direction: column;
    height: 100vh;
}

/* ══════════ 悬浮顶栏（叠在背景上） ══════════ */
.home-topbar {
    position: absolute; top: 0; left: 0; right: 0;
    z-index: 10;
    display: flex; align-items: center; justify-content: flex-end;
    padding: 10px 32px;
    background: linear-gradient(180deg, rgba(10,14,23,0.65) 0%, rgba(10,14,23,0) 100%);
    pointer-events: none;
}
.home-topbar__res {
    display: flex; gap: 6px; flex-wrap: wrap;
    pointer-events: auto;
}
.res-item {
    display: flex; align-items: center; gap: 4px;
    font-size: 13px; font-weight: 700; color: var(--color-gold); white-space: nowrap;
    background: rgba(10,14,23,0.55);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.06);
}
.res-item--accent { color: var(--color-accent); }
.res-icon { font-size: 14px; }
.res-val { font-variant-numeric: tabular-nums; }

/* ══════════ 左上角：战队品牌区（Logo + 官方口号艺术字） ══════════ */
.home-brand {
    position: absolute;
    top: 52px; left: 24px;
    z-index: 10;
    display: flex; align-items: center; gap: 18px;
    padding: 14px 22px 14px 16px;
    background: linear-gradient(110deg,
        rgba(10,14,23,0.72) 0%,
        rgba(16,22,40,0.5) 60%,
        rgba(26,36,64,0) 100%);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-left: 3px solid var(--team-color, var(--color-accent));
    border-radius: 4px 14px 14px 4px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.35);
    max-width: 480px;
}

.home-brand__logo {
    flex-shrink: 0;
    width: 72px; height: 72px;
    border-radius: 14px;
    overflow: hidden;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.06), rgba(0,0,0,0.2));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4),
                inset 0 0 0 1px rgba(255,255,255,0.06);
    position: relative;
}
.home-brand__logo::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: 14px;
    box-shadow: inset 0 0 20px color-mix(in srgb, var(--team-color, #4ea8de) 40%, transparent);
    pointer-events: none;
}
.home-brand__logo .img-wrapper { border-radius: 10px; }

.home-brand__text {
    display: flex; flex-direction: column; gap: 4px; min-width: 0;
}

/* 顶部赛季标签 */
.home-brand__year {
    font-size: 10px;
    color: color-mix(in srgb, var(--team-color, #4ea8de) 80%, white);
    letter-spacing: 4px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.85;
}

/* 战队名 */
.home-brand__name {
    font-size: 18px; font-weight: 900; color: #fff;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
    line-height: 1.1;
}

/*
 * 官方口号艺术字
 *
 * 采用【纯色 + 多层 text-shadow 光晕】方案，避免使用
 * background-clip:text + filter:drop-shadow 的组合（后者在 Chromium
 * 某些字体子像素渲染链路中会产生马赛克/色块 glitch）。
 */
.home-brand__slogan {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-family: 'STKaiti', 'KaiTi', 'Microsoft YaHei', 'SimHei', serif;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 3px;
    color: #ffe9a3;
    text-shadow:
        0 0 1px #fff3c4,
        0 0 6px rgba(240, 192, 64, 0.75),
        0 0 14px rgba(240, 192, 64, 0.35),
        0 2px 4px rgba(0, 0, 0, 0.55);
    animation: home-brand-shimmer 4s ease-in-out infinite;
}
.home-brand__slogan-mark {
    font-size: 20px;
    color: #ffd93d;
    opacity: 0.7;
    text-shadow: 0 0 6px rgba(240, 192, 64, 0.5);
}
.home-brand__slogan-text {
    position: relative;
    white-space: nowrap;
}

@keyframes home-brand-shimmer {
    0%, 100% {
        text-shadow:
            0 0 1px #fff3c4,
            0 0 6px rgba(240, 192, 64, 0.75),
            0 0 14px rgba(240, 192, 64, 0.35),
            0 2px 4px rgba(0, 0, 0, 0.55);
    }
    50% {
        text-shadow:
            0 0 2px #fff3c4,
            0 0 10px rgba(255, 217, 61, 0.95),
            0 0 22px rgba(255, 217, 61, 0.55),
            0 2px 4px rgba(0, 0, 0, 0.55);
    }
}

.home-brand__sub {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    letter-spacing: 3px;
    font-style: italic;
    font-weight: 500;
}

/* ══════════ 主体 ══════════
 * 采用 CSS Grid：
 *   列 1（1fr）  —— 团队形象背景 + 赛季详情面板（面板 justify-self:end 紧贴列右边）
 *   列 2（auto） —— 右侧菱形按钮网格
 * 这样面板与按钮是两个独立的 grid cells，绝不重叠。
 * 形象图本身 absolute 定位，不参与格子。
 */
.home-body {
    flex: 1; min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* ── 团队形象贴图（固定展示） ── */
.home-team-art {
    position: absolute;
    left: 0; bottom: 0;
    height: 80%;
    width: auto;
    max-width: 55%;
    object-fit: contain;
    object-position: left bottom;
    user-select: none;
    pointer-events: none;
    filter: drop-shadow(4px 0 30px rgba(0,0,0,0.5));
    z-index: 1;
}

/* ══════════ 赛季详情面板（grid 列1，右对齐，贴在按钮左侧） ══════════ */
.home-season-panel {
    grid-column: 1;
    justify-self: end;      /* 贴近第 2 列左边 */
    align-self: center;     /* 垂直居中 → 在形象图上半部分，不与照片主体重合 */
    margin-right: 16px;
    /* 上下预留 12px 呼吸空间；避免 hover 放大导致顶部被截 */
    margin-top: 12px;
    margin-bottom: 12px;

    /* 宽度随屏幕伸缩；min 280 保证内容可读，max 360 防止过宽 */
    width: clamp(280px, 26vw, 360px);
    max-width: calc(100% - 24px);
    z-index: 3;

    padding: 16px 18px 14px;
    background: linear-gradient(150deg,
        rgba(12,18,32,0.82) 0%,
        rgba(22,28,50,0.72) 60%,
        rgba(12,18,32,0.82) 100%);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(78,168,222,0.28);
    border-radius: 14px;
    box-shadow:
        0 10px 30px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.06);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.18s;
}
.home-season-panel:hover {
    transform: translateY(-3px);
    border-color: #ffd93d;
    box-shadow:
        0 18px 40px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

/* home-cards 固定在第 2 列，移除原先的 margin-left:auto */
.home-cards {
    grid-column: 2;
    margin-left: 0;
}

/* 头部 */
.hsp__header {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.hsp__title-group { min-width: 0; flex: 1; }
.hsp__title {
    font-size: 18px; font-weight: 900; color: #ffd93d;
    letter-spacing: 1px; line-height: 1.2;
    text-shadow: 0 2px 8px rgba(240,192,64,0.25);
}
.hsp__subtitle {
    margin-top: 3px;
    font-size: 12px; color: #a0b4d0;
    letter-spacing: 0.5px; font-weight: 600;
}
.hsp__badges {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.hsp__enter-hint {
    font-size: 10px; color: #6b8aad; letter-spacing: 2px;
    padding: 3px 8px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    transition: all 0.18s;
}
.home-season-panel:hover .hsp__enter-hint {
    color: #ffd93d;
    border-color: #ffd93d;
    background: rgba(240,192,64,0.08);
}

/* 阶段进度 */
.hsp__phase-progress {
    display: flex; align-items: center; gap: 4px;
    padding: 10px 2px 4px;
    position: relative;
}
.hsp__phase-dot {
    flex-shrink: 0;
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(255,255,255,0.14);
    border: 2px solid rgba(255,255,255,0.05);
    transition: all 0.2s;
}
.hsp__phase-dot--done { background: #2a9d8f; border-color: #3ecf8e; }
.hsp__phase-dot--now {
    background: #ffd93d; border-color: #ffe9a3;
    box-shadow: 0 0 10px rgba(240,192,64,0.6);
    animation: hsp-pulse 2s infinite;
}
.hsp__phase-dot--later { opacity: 0.35; }
.hsp__phase-line {
    flex: 1; height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0.12), rgba(255,255,255,0.05));
}
@keyframes hsp-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(240,192,64,0.4); }
    50%      { box-shadow: 0 0 16px rgba(240,192,64,0.85); }
}

.hsp__phase-progress-bar {
    position: absolute; left: 4px; right: 4px; bottom: -2px;
    height: 2px; background: rgba(255,255,255,0.04);
    border-radius: 2px; overflow: hidden;
}
.hsp__phase-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--team-color, #4ea8de), #ffd93d);
    transition: width 0.5s ease;
}

/* 内容网格 */
.hsp__grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-top: 14px;
}
.hsp__cell {
    padding: 10px 12px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    transition: background 0.18s;
}
.hsp__cell:hover { background: rgba(0,0,0,0.35); }

.hsp__cell-label {
    font-size: 11px; color: #8fb8e0;
    font-weight: 700; letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.hsp__cell-value {
    font-size: 16px; color: #fff;
    font-weight: 900; letter-spacing: 1px;
    line-height: 1.2;
}
.hsp__cell-value--accent { color: var(--color-accent, #4ea8de); font-size: 22px; }
.hsp__cell-value strong { color: #ffd93d; font-size: 18px; }
.hsp__cell-sub {
    margin-top: 3px;
    font-size: 10px; color: #6b8aad; letter-spacing: 0.5px;
}
.hsp__empty { color: #6b8aad; font-weight: 600; font-size: 13px; font-style: italic; }

/* 排名徽章 */
.hsp__rank {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 8px;
    font-size: 10px; font-weight: 800; letter-spacing: 1px;
}
.hsp__rank--top { background: rgba(240,192,64,0.2); color: #ffd93d; border: 1px solid #ffd93d; }
.hsp__rank--mid { background: rgba(78,168,222,0.16); color: #7dc7ff; border: 1px solid #4ea8de; }
.hsp__rank--low { background: rgba(231,111,81,0.14); color: #ffad99; border: 1px solid #e76f51; }

/* 头号选手 */
.hsp__cell-starter {
    display: flex; align-items: baseline; gap: 6px;
    flex-wrap: wrap;
}
.hsp__starter-name { font-size: 16px; font-weight: 900; color: #fff; letter-spacing: 1px; }
.hsp__starter-role { font-size: 11px; color: #8fb8e0; font-weight: 600; }
.hsp__starter-rating {
    margin-left: auto;
    font-size: 16px; font-weight: 900; color: #ffd93d;
    padding: 0 6px;
    text-shadow: 0 0 8px rgba(240,192,64,0.4);
}

/* 难度徽章紧凑 */
.hsp__badges .difficulty-badge {
    padding: 2px 8px;
    font-size: 10px;
    border-radius: 8px;
}

/* 团队疲劳摘要紧凑 */
.hsp__cell-cond {
    font-size: 13px;
    font-weight: 700;
}
.hsp__cell-cond .status-bar,
.hsp__cell-cond .fatigue-summary {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ══════════ 右侧菱形卡牌入口（grid 第 2 列） ══════════ */
.home-cards {
    position: relative;
    z-index: 2;
    /* margin-left: auto 已由 grid 列结构替代 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 48px 24px 24px;
}

.home-cards__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.hcard {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border: none;
    background: url('../../resources/ui/card-entry-bg.webp') center/100% 100% no-repeat;
    color: #fff;
    cursor: pointer;
    font-family: var(--font-main);
    text-align: left;
    transition: all 0.25s ease;
    min-height: 64px;
    min-width: 160px;
}
.hcard::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(78,168,222,0.06), transparent 60%);
    pointer-events: none;
    transition: background 0.25s;
}
.hcard:hover {
    transform: translateX(-8px) scale(1.03);
    filter: brightness(1.25);
}
.hcard:hover::before {
    background: linear-gradient(135deg, rgba(78,168,222,0.18), transparent 60%);
}
.hcard:active {
    transform: translateX(-3px) scale(0.97);
}

.hcard__icon {
    font-size: 30px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(78,168,222,0.4));
}
.hcard__title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 3px;
    text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}

.hcard--save { opacity: 0.7; }
.hcard--save:hover { opacity: 1; }

/* ══════════ 底部导航栏 ══════════ */
.home-bottombar {
    flex-shrink: 0;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    background: url('../../resources/ui/navbar-bg.webp') center/cover no-repeat,
                rgba(10,14,23,0.92);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(78,168,222,0.2);
    position: relative;
}
.home-nav-btn {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; padding: 10px 4px;
    background: transparent; border: none;
    color: var(--color-text-dim);
    cursor: pointer; font-family: var(--font-main);
    transition: all 0.2s; position: relative;
}
.home-nav-btn::after {
    content: '';
    position: absolute; top: 0; left: 20%; right: 20%;
    height: 2px; background: var(--color-accent);
    border-radius: 0 0 2px 2px;
    opacity: 0; transition: opacity 0.2s;
}
.home-nav-btn:hover { color: var(--color-text); background: rgba(78,168,222,0.06); }
.home-nav-btn:hover::after { opacity: 1; }
.home-nav-btn__icon { font-size: 22px; line-height: 1; }
.home-nav-btn__label { font-size: 11px; font-weight: 600; letter-spacing: 0.5px; }

/* ══════════ 响应式 ══════════ */
@media (max-width: 768px) {
    .home-topbar { padding: 8px 12px; }
    .home-topbar__res { gap: 4px; }
    .res-item { padding: 4px 8px; font-size: 11px; }

    .home-brand {
        top: 44px; left: 12px;
        padding: 10px 14px 10px 12px; gap: 12px;
        max-width: 78vw;
    }
    .home-brand__logo { width: 52px; height: 52px; }
    .home-brand__name { font-size: 15px; }
    .home-brand__slogan { font-size: 18px; letter-spacing: 2px; }
    .home-brand__year { font-size: 9px; letter-spacing: 2px; }
    .home-brand__sub { display: none; }

    .home-season-panel {
        width: min(240px, 38vw);
        margin-right: 8px;
        padding: 10px 12px 8px;
    }
    .hsp__grid { gap: 6px; margin-top: 10px; }
    .hsp__cell { padding: 6px 8px; }
    .hsp__cell-label { font-size: 10px; margin-bottom: 2px; }
    .hsp__cell-value { font-size: 12px; }
    .hsp__cell-value--accent { font-size: 16px; }
    .hsp__cell-sub { font-size: 9px; }
    .hsp__title { font-size: 14px; }
    .hsp__subtitle { font-size: 10px; }
    .hsp__phase-progress { padding: 6px 2px 3px; }
    .hsp__enter-hint { font-size: 9px; padding: 2px 6px; }

    .home-team-art { height: 70%; max-width: 46%; }
    .home-cards { padding: 12px 16px 12px 12px; }
    .home-cards__grid { gap: 8px; }
    .hcard { padding: 14px 16px; min-height: 50px; min-width: 120px; }
    .hcard__icon { font-size: 22px; }
    .hcard__title { font-size: 14px; letter-spacing: 1px; }
}
