/* ProfilePanel —— 「我的档案」面板 + 函数头像通用样式 */

/* 头像（AvatarFunctions 生成的 SVG）通用容器 */
.fn-avatar { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.fn-avatar-svg { display: block; }

.profile-panel-content {
    position: relative;
    max-width: 460px;
    width: 94%;
    max-height: 88vh;
    overflow-y: auto;
    padding: 24px 26px 20px;
    text-align: left;
}

.profile-panel-content h2 { margin: 0 0 4px; font-size: 20px; }

/* 顶部：大头像 + 昵称 + IP 属地 */
.pf-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 14px 0 6px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(139, 123, 216, 0.10);
    border: 1px solid rgba(139, 123, 216, 0.22);
}
.pf-preview {
    flex: 0 0 auto;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.18);
    overflow: hidden;
}
.pf-head-info { min-width: 0; }
.pf-nick-line {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pf-ip-line { font-size: 13px; opacity: 0.85; }
.pf-ip-line b { color: var(--accent, #4f8cff); font-weight: 600; }
.pf-ip-note { font-size: 11px; opacity: 0.55; margin-top: 3px; }

/* 头像九宫格 */
.pf-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 8px;
    max-height: 268px;
    overflow-y: auto;
    padding: 2px;
}
.pf-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 7px 3px 6px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: border-color 0.16s, background 0.16s, transform 0.12s;
}
.pf-tile:hover { background: rgba(255, 255, 255, 0.09); }
.pf-tile:active { transform: scale(0.96); }
.pf-tile.selected {
    border-color: var(--accent, #4f8cff);
    background: rgba(79, 140, 255, 0.16);
    box-shadow: 0 0 0 1px var(--accent, #4f8cff) inset;
}
.pf-tile-svg { line-height: 0; }
.pf-tile-name {
    font-size: 10px;
    opacity: 0.75;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pf-picked {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.7;
    min-height: 16px;
}
.pf-foot-hint { font-size: 12px; opacity: 0.6; }

/* 排行榜 / 联机列表里的头像与 IP 属地 */
.leaderboard-avatar {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 7px;
    background: rgba(0, 0, 0, 0.16);
    vertical-align: middle;
}
.leaderboard-avatar svg { width: 26px; height: 26px; display: block; }
.leaderboard-loc {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 10px;
    line-height: 1.6;
    border-radius: 999px;
    opacity: 0.72;
    background: rgba(255, 255, 255, 0.09);
    white-space: nowrap;
    vertical-align: middle;
}
.leaderboard-name { display: inline-flex; align-items: center; min-width: 0; }

/* 房间列表 / 联机界面里的房主头像 */
.lobby-host-avatar,
.p2p-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    overflow: hidden;
    margin-right: 6px;
    background: rgba(0, 0, 0, 0.16);
    vertical-align: middle;
}
.lobby-host-avatar svg, .p2p-avatar svg { width: 22px; height: 22px; display: block; }

/* 窄屏：九宫格改 3 列，头像缩小 */
@media (max-width: 420px) {
    .pf-grid { grid-template-columns: repeat(3, 1fr); }
    .pf-preview { width: 68px; height: 68px; }
    .pf-preview svg { width: 68px; height: 68px; }
}

/* 左上角「档案」按钮：选好头像后整颗按钮就是你的函数头像 */
#profile-btn.has-avatar { padding: 0; overflow: hidden; }
#profile-btn.has-avatar .fn-avatar-svg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
}

/* 「关于本服 / 游戏规则」富文本内容 */
#start-info-modal .modal-content { max-width: 560px; }
.fn-info-rich {
    text-align: left;
    font-size: 14px;
    line-height: 1.9;
    max-height: 62vh;
    overflow-y: auto;
    padding-right: 4px;
}
.fn-info-rich ul { margin: 0; padding-left: 20px; }
.fn-info-rich li { margin: 3px 0; }
.fn-info-rich b { color: #f5c27b; }
.fn-info-rich code {
    padding: 1px 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.12);
    font-family: 'Courier New', monospace;
}
