﻿/* VOID GACHA 通訊錄 */
.friends-view {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#friends-panel {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    border-radius: 16px;
    border: 1px solid rgba(255, 120, 180, 0.35);
    background: linear-gradient(165deg, rgba(28, 8, 32, 0.95), rgba(8, 10, 24, 0.98));
    padding: 24px 20px 28px;
    min-height: min(72vh, 560px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), inset 0 0 40px rgba(255, 110, 199, 0.06);
}

.friends-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    width: 100%;
}

/* 置中諮詢區 */
.friends-center {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    text-align: center;
    padding: 8px 12px 4px;
}

.friends-hero-icon {
    font-size: 42px;
    line-height: 1;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 16px rgba(255, 110, 199, 0.5));
    animation: friendsPulse 3s ease-in-out infinite;
}

@keyframes friendsPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.06); opacity: 0.9; }
}

.friends-hero-title {
    margin: 0 0 10px;
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 900;
    letter-spacing: 0.08em;
    background: linear-gradient(90deg, #ff6ec7, #ffd700, #88ccff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: friendsTitleGlow 5s linear infinite;
}

@keyframes friendsTitleGlow {
    to { background-position: 200% center; }
}

.friends-hero-desc {
    margin: 0 0 6px;
    font-size: 14px;
    color: rgba(230, 220, 255, 0.9);
    line-height: 1.5;
}

.friends-hero-reset {
    margin: 0 0 14px;
    font-size: 12px;
    color: var(--muted);
}

.friends-hero-reset strong {
    color: #00ffff;
}

.friends-hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.friends-stat {
    font-size: 13px;
    color: rgba(200, 190, 230, 0.9);
}

.friends-stat em {
    font-style: normal;
    font-weight: 900;
    font-size: 16px;
    color: #fff;
    margin-right: 2px;
}

.friends-stat--gift em {
    color: #6dffb0;
}

.friends-stat-div {
    color: rgba(255, 255, 255, 0.25);
}

.friends-hero-date {
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--muted);
}

.friends-hero-date strong {
    color: #c8b0ff;
    font-weight: 800;
}

.friends-hero-reward {
    margin: 0 0 18px;
    font-size: 12px;
    color: rgba(200, 200, 220, 0.8);
}

.friends-hero-reward strong {
    color: #ffe566;
}

.friends-add-form {
    margin: 0 auto;
    width: 100%;
}

.friends-add-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.friends-add-row input {
    flex: 1 1 200px;
    min-width: 0;
    max-width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 14px;
    text-align: center;
}

.friends-add-row input:focus {
    outline: none;
    border-color: rgba(255, 110, 199, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 110, 199, 0.2);
}

.btn-friends-add {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #7f00ff, #ff0055);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(255, 0, 128, 0.35);
}

.btn-friends-add:hover {
    filter: brightness(1.1);
}

.friends-suggest {
    margin-top: 16px;
}

.friends-suggest-label {
    margin: 0 0 8px;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.1em;
}

.friends-suggest-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.friends-suggest-chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(192, 132, 252, 0.4);
    background: rgba(127, 0, 255, 0.2);
    color: #e8d4ff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.friends-suggest-chip:hover {
    background: rgba(127, 0, 255, 0.45);
}

/* 好友推薦區（全寬嵌入通訊錄主體） */
.friends-recommend-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 18px;
    border-radius: 14px;
    border: 1px solid rgba(136, 204, 255, 0.28);
    background: rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 0 32px rgba(136, 204, 255, 0.04);
    text-align: center;
}

.friends-rec-meta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.friends-rec-header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    text-align: center;
}

.friends-rec-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.friends-rec-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 16px;
    color: #88ccff;
    background: rgba(136, 204, 255, 0.12);
    border: 1px solid rgba(136, 204, 255, 0.3);
    box-shadow: 0 0 14px rgba(136, 204, 255, 0.25);
}

.friends-rec-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.06em;
    color: #e8f4ff;
}

.friends-rec-sub {
    margin: 0;
    font-size: 11px;
    line-height: 1.45;
    color: rgba(180, 200, 230, 0.75);
}

.btn-friends-rec-refresh {
    position: absolute;
    top: 0;
    right: 0;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(136, 204, 255, 0.35);
    background: rgba(136, 204, 255, 0.1);
    color: #88ccff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.25s, background 0.2s;
}

.btn-friends-rec-refresh:hover {
    background: rgba(136, 204, 255, 0.22);
    transform: rotate(90deg);
}

.friends-rec-daily {
    margin: 0;
    font-size: 10px;
    color: rgba(160, 180, 210, 0.65);
    line-height: 1.4;
}

.friends-rec-daily strong {
    color: #88ccff;
}

.friends-rec-stats {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(136, 204, 255, 0.1);
    border: 1px solid rgba(136, 204, 255, 0.22);
    font-size: 11px;
    color: rgba(200, 220, 255, 0.85);
    white-space: nowrap;
}

.friends-rec-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    width: 100%;
}

.friends-rec-tab {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.25);
    color: rgba(200, 210, 240, 0.85);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.friends-rec-tab.is-active {
    border-color: rgba(136, 204, 255, 0.55);
    background: rgba(136, 204, 255, 0.14);
    color: #fff;
    box-shadow: 0 0 12px rgba(136, 204, 255, 0.2);
}

.friends-rec-tab-count {
    min-width: 16px;
    padding: 1px 5px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(230, 240, 255, 0.95);
}

.friends-rec-tab.is-active .friends-rec-tab-count {
    background: rgba(136, 204, 255, 0.35);
}

.friends-rec-panels {
    min-height: 0;
    width: 100%;
}

.friends-rec-panel {
    display: none;
}

.friends-rec-panel.is-active {
    display: block;
}

.friends-rec-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

.friends-rec-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.32);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.friends-rec-card:hover {
    border-color: rgba(136, 204, 255, 0.35);
    box-shadow: 0 4px 16px rgba(136, 204, 255, 0.1);
}

.friends-rec-player-hit {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
    gap: 8px;
}

.friends-avatar--rec {
    width: 44px;
    height: 44px;
}

.friends-rec-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    text-align: center;
}

.friends-rec-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.friends-rec-name-row .friends-name {
    font-size: 14px;
}

.friends-rec-active {
    font-size: 10px;
    font-weight: 700;
    color: #6dffb0;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(109, 255, 176, 0.12);
    border: 1px solid rgba(109, 255, 176, 0.25);
}

.friends-rec-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
    justify-content: center;
}

.friends-rec-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    color: #c8e4ff;
    background: rgba(136, 204, 255, 0.12);
    border: 1px solid rgba(136, 204, 255, 0.22);
    white-space: nowrap;
}

.friends-rec-tag--muted {
    color: rgba(180, 190, 220, 0.7);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.friends-rec-meta-sub {
    font-size: 10px;
    color: rgba(160, 170, 200, 0.7);
}

.friends-rec-side {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.friends-rec-match {
    font-size: 13px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    line-height: 1;
}

.btn-friend-rec-add {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 110, 199, 0.5);
    background: linear-gradient(135deg, rgba(255, 0, 128, 0.35), rgba(127, 0, 255, 0.45));
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.2s;
}

.btn-friend-rec-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255, 110, 199, 0.35);
}

.friends-rec-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 28px 16px;
    border-radius: 12px;
    border: 1px dashed rgba(136, 204, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

.friends-rec-empty-icon {
    display: block;
    font-size: 28px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.friends-rec-empty p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(180, 190, 220, 0.8);
}

/* 好友列表 */
.friends-list-wrap {
    width: 100%;
}

.friends-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.friends-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.35);
    transition: border-color 0.2s;
}

.friends-row:hover {
    border-color: rgba(255, 110, 199, 0.35);
}

.friends-player-hit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 0;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: center;
    cursor: pointer;
    border-radius: 10px;
}

.friends-player-hit:hover .friends-name {
    color: #ffb8e8;
}

.friends-player-hit:focus-visible {
    outline: 2px solid rgba(255, 110, 199, 0.75);
    outline-offset: 2px;
}

.friends-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255, 110, 199, 0.5), rgba(127, 0, 255, 0.6));
    border: 2px solid rgba(255, 200, 255, 0.35);
    box-shadow: 0 0 16px rgba(255, 110, 199, 0.35);
}

.friends-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friends-avatar-emoji {
    font-size: 22px;
    line-height: 1;
}

.friends-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    text-align: center;
}

.friends-name {
    font-size: 16px;
    color: #fff;
}

.friends-meta {
    font-size: 12px;
    color: var(--muted);
}

.friends-hearts {
    font-size: 13px;
    font-weight: 700;
    color: #ff8ec8;
}

.friends-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.friends-reward-hint {
    font-size: 12px;
    font-weight: 700;
    color: #6dffb0;
}

.btn-friend-gift {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 110, 199, 0.55);
    background: linear-gradient(135deg, rgba(255, 0, 128, 0.35), rgba(127, 0, 255, 0.4));
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-friend-gift:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 110, 199, 0.4);
}

.btn-friend-gift.is-done,
.btn-friend-gift:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: rgba(60, 60, 80, 0.6);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(200, 200, 220, 0.75);
}

.friends-empty {
    text-align: center;
    padding: 32px 20px;
    border-radius: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.25);
    color: var(--muted);
}

.friends-empty-icon {
    display: block;
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.85;
}

.friends-empty p {
    margin: 0 0 8px;
    font-size: 15px;
    color: rgba(220, 210, 240, 0.9);
}

.friends-empty-sub {
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
}

.btn-friend-remove {
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 150, 150, 0.75);
    font-size: 11px;
    cursor: pointer;
    text-decoration: underline;
}

.btn-friend-remove:hover {
    color: #ff8888;
}

.friends-stat--pending em {
    color: #ffb8e8;
}

.friends-subhead {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 800;
    color: rgba(230, 220, 255, 0.95);
    text-align: center;
}

.friends-subhead--out {
    margin-top: 16px;
    text-align: center;
}

.friends-subhead-count {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: rgba(255, 110, 199, 0.45);
}

.friends-requests {
    width: 100%;
    padding: 14px 14px 6px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(255, 110, 199, 0.28);
}

.friends-request-list,
.friends-outgoing-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.friends-request-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(127, 0, 255, 0.12);
    border: 1px solid rgba(200, 150, 255, 0.25);
    text-align: center;
}

.friends-avatar--sm {
    width: 48px;
    height: 48px;
}

.friends-request-info {
    min-width: 0;
    text-align: center;
}

.friends-request-hint {
    font-size: 11px;
    color: #ffb8e8;
    font-weight: 700;
}

.friends-request-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.btn-friend-accept,
.btn-friend-decline,
.btn-friend-cancel {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
}

.btn-friend-accept {
    color: #0a1a10;
    background: linear-gradient(135deg, #6dffb0, #3dd68c);
    border-color: rgba(109, 255, 176, 0.5);
}

.btn-friend-decline {
    color: #ffd0d0;
    background: rgba(80, 20, 30, 0.65);
    border-color: rgba(255, 120, 120, 0.35);
}

.friends-outgoing-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.friends-outgoing-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.friends-outgoing-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.friends-outgoing-status {
    font-size: 11px;
    color: var(--muted);
}

.btn-friend-cancel {
    color: rgba(220, 210, 255, 0.9);
    background: rgba(40, 30, 60, 0.8);
    border-color: rgba(180, 150, 255, 0.3);
}

.nav-btn[data-view='friends'] {
    position: relative;
}

.nav-friends-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    line-height: 16px;
    text-align: center;
    color: #fff;
    background: #ff3d7a;
    box-shadow: 0 0 10px rgba(255, 61, 122, 0.65);
    pointer-events: none;
}

@media (max-width: 640px) {
    #friends-panel {
        padding: 18px 14px 22px;
    }

    .friends-rec-meta-row {
        flex-direction: column;
        align-items: center;
    }

    .friends-rec-tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .friends-rec-list {
        grid-template-columns: 1fr;
    }

    .friends-row {
        gap: 10px;
    }

    .friends-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .friends-add-row {
        flex-direction: column;
    }

    .btn-friends-add {
        width: 100%;
    }

    .friends-request-row {
        padding: 12px;
    }

    .friends-request-actions {
        flex-direction: row;
        justify-content: center;
    }

    .friends-outgoing-row {
        padding: 12px;
    }
}
