/* friends.css — Naru2day friends page — tema pergamino */

/* ── Page title ── */
.subtitle-container {
    text-align: center;
    padding: 2.2rem 1rem 1.6rem;
}

.subtitle-container .page-subtitle {
    font-family: 'Reggae One', cursive;
    font-size: 2.2rem;
    font-weight: 400;
    color: #FF6B00;
    margin: 0 0 0.35rem;
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.55), 0 0 20px rgba(255,107,0,0.3);
}

.subtitle-container .page-subtitle::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--wn-orange);
    border-radius: 2px;
    margin: 0.5rem auto 0;
    box-shadow: 0 0 8px rgba(255,107,0,0.4);
}

/* ── Friends page ── */
.friends-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
    color: #1a0f0a;
}

/* ── Shared card base ── */
.friends-profile-card,
.friends-claim-section,
#friendsListSection,
.friends-requests-card,
.friends-rankings-section,
.friends-join-card {
    background: url('../img/Fondo_Pergamino.webp') center center / cover no-repeat;
    background-color: #CE9D66;
    border: 2px solid #C19A6B;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.6);
    margin-bottom: 2rem;
    position: relative;
    padding: 1.5rem;
}

/* ── Profile card ── */
.friends-profile-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.friends-profile-identity {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.friends-avatar {
    font-size: 2.5rem;
    line-height: 1;
    background: rgba(0,0,0,0.12);
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid rgba(139,90,43,0.5);
    box-shadow: 0 0 15px rgba(139,90,43,0.2);
    overflow: hidden;
}
.friends-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.friends-nickname {
    font-size: 2rem;
    font-family: 'Reggae One', system-ui, sans-serif;
    color: #1a0f0a;
    margin: 0;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}

.btn-show-code {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(139,90,43,0.1);
    border: 1px solid rgba(139,90,43,0.3);
    border-radius: 20px;
    color: #5c4033;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.35rem 1.1rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
    transition: all 0.2s;
}
.btn-show-code:hover {
    border-color: var(--wn-orange);
    color: var(--wn-orange);
    background: rgba(255,107,0,0.1);
}

.friends-code-row {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.08);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(139,90,43,0.2);
}

.friends-code-label {
    font-size: 0.8rem;
    color: #5c4033;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: bold;
}

.friends-code-badge {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--wn-orange);
    letter-spacing: 0.2em;
    text-shadow: 0 0 8px rgba(255,107,0,0.25);
}

.btn-copy-code, .btn-copy-invite {
    background: linear-gradient(180deg, #FF6B00, #e55a00);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(255,107,0,0.3);
}
.btn-copy-code:hover, .btn-copy-invite:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255,107,0,0.4);
    filter: brightness(1.1);
}
.btn-copy-code.copied, .btn-copy-invite.copied {
    background: linear-gradient(180deg, #4caf50, #388e3c);
    color: #fff;
}

/* ── Claim nickname ── */
.friends-claim-section {
    padding: 2.5rem 2rem;
    text-align: center;
}
.friends-claim-section h3 {
    margin: 0 0 0.8rem;
    color: var(--wn-orange);
    font-size: 1.8rem;
    font-family: 'Reggae One', system-ui, sans-serif;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}
.friends-claim-section p {
    margin: 0 0 1.5rem;
    color: #5c4033;
    font-size: 1rem;
    line-height: 1.5;
}

.friends-claim-form {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
}

.friends-claim-input {
    background: rgba(255,255,255,0.55);
    border: 2px solid #C19A6B;
    border-radius: 8px;
    color: #1a0f0a;
    font-size: 1.1rem;
    padding: 0.6rem 1.2rem;
    width: 250px;
    transition: all 0.3s;
    font-weight: bold;
}
.friends-claim-input::placeholder { color: rgba(92,64,51,0.5); font-weight: normal; }
.friends-claim-input:focus { outline: none; border-color: #8B5A2B; box-shadow: 0 0 0 3px rgba(139,90,43,0.2); }
.friends-claim-input.error { border-color: #c62828; }

.friends-claim-hint {
    font-size: 0.85rem;
    margin-top: 0.6rem;
    color: #5c4033;
    min-height: 1.2em;
    font-weight: bold;
}
.friends-claim-hint.error { color: #c62828; }
.friends-claim-hint.ok    { color: #2e7d32; margin-top: 0.9rem; }

/* ── Buttons ── */
.wn-btn-primary {
    background: linear-gradient(180deg, #FF6B00, #e55a00);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.65rem 1.8rem;
    align-self: center;
    box-shadow: 0 4px 12px rgba(255,107,0,0.35);
    transition: 0.2s;
}
.wn-btn-primary:hover { transform: translateY(-2px); filter: brightness(1.1); }
.wn-btn-primary:disabled { filter: brightness(0.6); cursor: not-allowed; transform: none; }

.wn-btn-danger {
    background: linear-gradient(180deg, #e53935, #b71c1c);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    padding: 0.7rem 2rem;
    font-size: 1rem;
    transition: 0.2s;
}
.wn-btn-secondary {
    background: rgba(139,90,43,0.1);
    border: 1px solid rgba(139,90,43,0.3);
    border-radius: 8px;
    color: #5c4033;
    font-weight: 700;
    cursor: pointer;
    padding: 0.7rem 2rem;
    font-size: 1rem;
    transition: 0.2s;
}
.wn-btn-secondary:hover { background: rgba(139,90,43,0.18); }

/* ── Section headers ── */
.friends-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(139,90,43,0.3);
}

.friends-section-title {
    font-size: 1.8rem;
    font-family: 'Reggae One', system-ui, sans-serif;
    color: var(--wn-orange);
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}

/* ── Add action box: full-width row inside the header ── */
.friends-action-box-row {
    width: 100%;
    padding-top: 0.8rem;
}

/* ── Toggle codes row ── */
.friends-toggle-row {
    margin-bottom: 1rem;
}

.eye-icon {
    width: 15px;
    height: 15px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ── Add friend dropdown ── */
.friends-add-dropdown { position: relative; }

.btn-add-friend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(180deg, #FF6B00, #e55a00);
    border: 2px solid rgba(0,0,0,0.15);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 900;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(255,107,0,0.3);
    white-space: nowrap;
}
.btn-add-friend:hover { filter: brightness(1.1); transform: translateY(-2px); box-shadow: 0 6px 12px rgba(255,107,0,0.4); }
.btn-add-friend.active { filter: brightness(0.95); transform: translateY(0); }
.dropdown-arrow { font-size: 0.75rem; transition: transform 0.2s; }
.btn-add-friend.active .dropdown-arrow { transform: rotate(180deg); }

.friends-add-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fdf3e3;
    border: 2px solid #C19A6B;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    z-index: 100;
    min-width: 200px;
    overflow: hidden;
}

.friends-add-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(139,90,43,0.2);
    color: #1a0f0a;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.85rem 1.2rem;
    text-align: left;
    transition: background 0.15s;
}
.friends-add-option:last-child { border-bottom: none; }
.friends-add-option:hover { background: rgba(255,107,0,0.1); color: var(--wn-orange); }

/* ── Action result box (invite link / code input) ── */
.add-action-inner {
    padding: 1rem 0 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.add-action-loading { color: #5c4033; font-style: italic; }

.friends-add-code-box { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ── Invite button ── */
.btn-generate-invite {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(180deg, #FF6B00, #e55a00);
    border: 2px solid rgba(0,0,0,0.15);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 900;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(255,107,0,0.3);
    white-space: nowrap;
}
.btn-generate-invite:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255,107,0,0.4);
    filter: brightness(1.1);
}
.btn-generate-invite:active { transform: translateY(0); }
.btn-generate-invite:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Invite result box ── */
.friends-invite-box {
    background: rgba(0,0,0,0.06);
    border: 1px solid rgba(139,90,43,0.3);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.08);
}
.friends-invite-link {
    flex: 1;
    font-size: 0.9rem;
    color: #5c4033;
    word-break: break-all;
    min-width: 0;
    font-family: monospace;
}

/* ── Friend requests card ── */
.friends-requests-card { padding: 1.5rem; }
.friends-requests-title {
    font-family: 'Reggae One', system-ui, sans-serif;
    font-size: 1.4rem;
    color: var(--wn-orange);
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.requests-badge {
    background: #c62828;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.requests-items-wrap { display: flex; flex-direction: column; gap: 0.6rem; }
.requests-outgoing-header {
    font-size: 0.78rem;
    color: #8B5A2B;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin: 0.8rem 0 0.4rem;
}

.request-item {
    background: rgba(255,255,255,0.35);
    border: 1px solid rgba(139,90,43,0.2);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.6rem;
}
.request-item-outgoing {
    opacity: 0.7;
    border-style: dashed;
}
.request-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.btn-accept-req {
    background: linear-gradient(180deg, #4caf50, #388e3c);
    border: 2px solid #2e7d32;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 900;
    padding: 0.35rem 0.9rem;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-accept-req:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-accept-req:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-decline-req, .btn-cancel-req {
    background: rgba(198,40,40,0.08);
    border: 1px solid rgba(198,40,40,0.4);
    border-radius: 6px;
    color: #c62828;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.35rem 0.9rem;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-decline-req:hover, .btn-cancel-req:hover { background: #c62828; color: #fff; }
.btn-decline-req:disabled, .btn-cancel-req:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Friends list ── */
.friends-list { display: flex; flex-direction: column; gap: 0.8rem; }

.friends-empty {
    color: #5c4033;
    font-size: 1.1rem;
    text-align: center;
    padding: 2.5rem;
    background: rgba(0,0,0,0.04);
    border-radius: 10px;
    border: 2px dashed rgba(139,90,43,0.35);
    font-style: italic;
}

.friends-list-item {
    background: rgba(255,255,255,0.35);
    border: 1px solid rgba(139,90,43,0.2);
    border-radius: 10px;
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    transition: all 0.2s;
}
.friends-list-item:hover {
    background: rgba(255,255,255,0.55);
    border-color: var(--wn-orange);
    transform: translateX(4px);
}

.friend-avatar {
    font-size: 1.6rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
    border: 1.5px solid rgba(139,90,43,0.35);
    overflow: hidden;
}
.friend-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

.friend-info { flex: 1; min-width: 0; }
.friend-nickname {
    font-weight: bold;
    color: #1a0f0a;
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
}
.friend-code { font-size: 0.85rem; color: #8B5A2B; font-family: monospace; }

.btn-remove-friend {
    background: rgba(198,40,40,0.08);
    border: 1px solid rgba(198,40,40,0.25);
    border-radius: 6px;
    color: #c62828;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-remove-friend:hover {
    background: #c62828;
    color: #fff;
    box-shadow: 0 2px 8px rgba(198,40,40,0.3);
}

/* ── Rankings ── */
.friends-rankings-section { padding: 1.5rem; }

.friends-game-tabs-scroll {
    overflow: visible;
}

.friends-game-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.friends-game-tab {
    background: rgba(255,255,255,0.35);
    border: 1px solid rgba(139,90,43,0.25);
    border-radius: 20px;
    color: #5c4033;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 0.5rem 1.2rem;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.friends-game-tab:hover {
    background: rgba(255,107,0,0.1);
    color: var(--wn-orange);
    transform: translateY(-2px);
}
.friends-game-tab.active {
    background: linear-gradient(180deg, #FF6B00, #e55a00);
    border-color: #FF6B00;
    color: #fff;
    box-shadow: 0 4px 8px rgba(255,107,0,0.35);
}

.friends-tab-group {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.tab-arrow {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-left: 2px;
}

.tab-sub-label {
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.85;
    margin-left: 2px;
}

.friends-tab-subdropdown {
    position: fixed;
    z-index: 1000;
    background: #fdf3e3;
    border: 1.5px solid #C19A6B;
    border-radius: 10px;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 110px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.friends-tab-subdropdown.hidden { display: none; }

.friends-tab-suboption {
    background: transparent;
    border: none;
    color: #1a0f0a;
    padding: 0.45rem 0.9rem;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.friends-tab-suboption:hover {
    background: rgba(255,107,0,0.1);
    color: var(--wn-orange);
}
.friends-tab-suboption.active {
    color: var(--wn-orange);
    font-weight: 800;
}

/* ── Saga sections ── */
.ranking-saga-section + .ranking-saga-section { margin-top: 1.25rem; }
.ranking-saga-header {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #8B5A2B;
    padding: 0 0 .4rem;
    margin-bottom: .25rem;
    border-bottom: 1px solid rgba(139,90,43,0.2);
    opacity: .75;
}

/* ── Ranking table ── */
.friends-ranking-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.4rem;
}

.friends-ranking-table th {
    color: var(--wn-orange);
    font-size: 0.85rem;
    font-weight: 800;
    padding: 0.5rem 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 2px solid rgba(139,90,43,0.3);
}

.friends-ranking-table td {
    padding: 0.8rem 1rem;
    background: rgba(255,255,255,0.3);
    color: #1a0f0a;
    font-size: 1rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.3);
    border-bottom: 1px solid rgba(139,90,43,0.1);
}

.friends-ranking-table th:first-child,
.friends-ranking-table td:first-child {
    width: 3rem;
    min-width: 3rem;
    max-width: 3rem;
}

.friends-ranking-table tr td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    border-left: 1px solid rgba(255,255,255,0.3);
}

.friends-ranking-table th:nth-child(2),
.friends-ranking-table td:nth-child(2) {
    text-align: left;
}

.friends-ranking-table tr td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-right: 1px solid rgba(139,90,43,0.1);
}

.friends-ranking-table tr:hover td {
    background: rgba(255,255,255,0.45);
}

.friends-ranking-table tr.is-self td {
    background: rgba(255,107,0,0.1);
    border-color: rgba(255,107,0,0.2);
}

.ranking-avatar-wrap {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 0.4rem;
}
.ranking-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(139,90,43,0.35);
    vertical-align: middle;
}
.ranking-verified { font-size: 0.75rem; }

.rank-medal { font-size: 1.2rem; }
.rank-pos { font-weight: 900; color: var(--wn-orange); font-size: 1.1rem; }

.ranking-table-wrap { max-height: 420px; overflow-y: auto; border-radius: 0 0 8px 8px; }

.rank-value     { font-weight: 900; color: #2e7d32; font-size: 1.1rem; text-shadow: 0 1px 0 rgba(255,255,255,0.4); }
.rank-win-good  { color: #2e7d32; }
.rank-failed    { color: #c62828; font-weight: bold; display: block; text-align: center; }
.rank-partial   { color: #e65100; font-weight: 700; }
.rank-notplayed { color: #8B5A2B; font-style: italic; }
.rank-piramide-good { color: #2e7d32; }
.rank-piramide-bad  { color: #c62828; }
.rank-extra     { display: block; font-size: 0.8rem; margin-top: 4px; font-weight: bold; }
.rank-extra-clean { color: #2e7d32; }
.rank-extra-hints { color: #e65100; }
.rank-extra-life-ok  { color: #c62828; }
.rank-extra-life-used{ color: #8B5A2B; }

.rank-timer-badge       { font-size: 0.85em; opacity: 0.75; margin-left: 2px; }
.rank-timer-badge--free { color: #8B5A2B; }

.friends-ranking-loading {
    text-align: center;
    color: var(--wn-orange);
    padding: 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%   { opacity: 0.6; }
    50%  { opacity: 1; }
    100% { opacity: 0.6; }
}

/* ── Join page ── */
.friends-join-card {
    padding: 2.5rem;
    max-width: 500px;
    margin: 3rem auto;
    text-align: center;
}
.friends-join-card h2 {
    margin: 0 0 1rem;
    color: var(--wn-orange);
    font-size: 2rem;
    font-family: 'Reggae One', system-ui, sans-serif;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}
.friends-join-card .join-sender {
    font-size: 1.2rem;
    color: #1a0f0a;
    margin: 0.5rem 0 2rem;
}
.friends-join-card .join-sender strong {
    color: var(--wn-orange);
    font-size: 1.4rem;
}
.btn-accept-invite {
    background: linear-gradient(180deg, #4caf50, #388e3c);
    border: 2px solid #1b5e20;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 900;
    padding: 0.8rem 2.5rem;
    transition: all 0.2s;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.25);
}
.btn-accept-invite:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.35);
    filter: brightness(1.1);
}
.btn-accept-invite:active { transform: translateY(0); }
.btn-accept-invite:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.friends-join-result {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    min-height: 1.5em;
}
.friends-join-result.success { color: #2e7d32; }
.friends-join-result.error   { color: #c62828; }

/* ── Remove modal ── */
.modal-static-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.modal-static-overlay.active { display: flex; }

.modal-static-content {
    background: url('../img/Fondo_Pergamino.webp') center/cover, #CE9D66;
    border: 2px solid #C19A6B;
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.modal-static-title { font-size: 1.3rem; font-weight: 900; color: #1a0f0a; margin: 0 0 0.75rem; }
.modal-static-desc  { color: #5c4033; margin: 0 0 1.5rem; font-size: 0.95rem; }

/* ── Section title (mismo estilo que perfil) ── */
.friends-section-title-decorated {
    font-size: 1.05rem;
    font-weight: 900;
    color: #1a0f0a;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
}
.friends-section-title-decorated::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(139,90,43,0.35), transparent);
}

/* ── Scroll containment for long lists ── */
#friendsList {
    max-height: 740px;
    overflow-y: auto;
    padding-right: 4px;
}

#rankingContent {
    max-height: 580px;
    overflow-y: auto;
}

.friends-ranking-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #CE9D66;
}

.requests-items-wrap {
    max-height: 680px;
    overflow-y: auto;
    padding-right: 4px;
}

#friendsList::-webkit-scrollbar,
#rankingContent::-webkit-scrollbar,
.requests-items-wrap::-webkit-scrollbar { width: 5px; }

#friendsList::-webkit-scrollbar-track,
#rankingContent::-webkit-scrollbar-track,
.requests-items-wrap::-webkit-scrollbar-track {
    background: rgba(139,90,43,0.1);
    border-radius: 3px;
}

#friendsList::-webkit-scrollbar-thumb,
#rankingContent::-webkit-scrollbar-thumb,
.requests-items-wrap::-webkit-scrollbar-thumb {
    background: rgba(139,90,43,0.4);
    border-radius: 3px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .friends-page { padding: 0 0.75rem 2.5rem; }
    .friends-profile-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    .friends-code-row { justify-content: center; }
    .friends-claim-section { padding: 1.75rem 1rem; }
    .friends-section-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .friends-toggle-row { text-align: center; }
    .friends-add-menu { right: auto; left: 0; }
    .friends-add-code-box { justify-content: flex-start; }

    /* Ocultar columna de posición en móvil */
    .friends-ranking-table th:first-child,
    .friends-ranking-table td:first-child {
        display: none;
    }
    .friends-ranking-table th:nth-child(2) {
        text-align: center;
    }

    /* Tabs scroll horizontal en móvil */
    .friends-game-tabs-scroll {
        overflow-x: auto;
        overflow-y: visible;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(139,90,43,0.4) rgba(0,0,0,0.1);
    }
    .friends-game-tabs-scroll::-webkit-scrollbar { height: 4px; }
    .friends-game-tabs-scroll::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 2px; }
    .friends-game-tabs-scroll::-webkit-scrollbar-thumb { background: rgba(139,90,43,0.4); border-radius: 2px; }
    .friends-game-tabs {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow: visible;
        margin-bottom: 0;
    }
    .friends-game-tab { flex-shrink: 0; }

    /* Request buttons icono-only */
    .request-item { gap: 0.5rem; }
    .btn-accept-req,
    .btn-decline-req,
    .btn-cancel-req {
        font-size: 0;
        padding: 0.35rem 0.7rem;
        min-width: 34px;
    }
    .btn-accept-req::after  { content: '✓'; font-size: 1rem; font-weight: 900; }
    .btn-decline-req::after,
    .btn-cancel-req::after  { content: '✗'; font-size: 1rem; font-weight: 900; }
    .friend-nickname {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ── Skeleton Loader ── */
@keyframes skel-shimmer {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}

.skel-card {
    background: url('../img/Fondo_Pergamino.webp') center/cover, #CE9D66;
    border: 2px solid #C19A6B;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
}

.skel-circle,
.skel-line {
    background: linear-gradient(90deg, rgba(139,90,43,0.15) 25%, rgba(139,90,43,0.35) 50%, rgba(139,90,43,0.15) 75%);
    background-size: 200% 100%;
    animation: skel-shimmer 1.4s infinite linear;
    border-radius: 999px;
}

.skel-rect { border-radius: 6px; }

.skel-profile-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    padding: 0.5rem 0;
}

.skel-circle        { width: 44px; height: 44px; flex-shrink: 0; }
.skel-circle--lg    { width: 72px; height: 72px; }

.skel-text-group    { flex: 1; display: flex; flex-direction: column; gap: 0.6rem; }

.skel-line          { height: 13px; width: 70%; }
.skel-line--sm      { width: 40%; height: 10px; }
.skel-line--med     { width: 55%; }
.skel-line--lg      { width: 70%; height: 16px; }
.skel-line--xl      { width: 85%; }
.skel-line--title   { width: 45%; height: 18px; margin-bottom: 1.2rem; }

.skel-friend-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(139,90,43,0.15);
}
.skel-friend-row:last-child { border-bottom: none; }
