/* players.css */

.players-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

/* ── Hero header ── */
.players-hero {
    text-align: center;
    margin-bottom: 2rem;
}

.players-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    color: var(--accent-gold, #ffd700);
    margin: 0 0 0.4rem;
    letter-spacing: 2px;
}

.players-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ── Mode tabs (Quickplay / Ranked) ── */
.mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255,255,255,0.06);
    padding-bottom: 0;
}

.mode-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: rgba(255,255,255,0.4);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    padding: 8px 20px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    letter-spacing: 0.5px;
}

.mode-tab.active {
    color: var(--accent-gold, #ffd700);
    border-bottom-color: var(--accent-gold, #ffd700);
}

.mode-tab.coming-soon {
    cursor: not-allowed;
    opacity: 0.45;
}

.soon-badge {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    font-size: 0.6rem;
    padding: 1px 5px;
    margin-left: 4px;
    vertical-align: middle;
    font-family: sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ── Sub tabs ── */
.sub-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 1.5rem;
}

.sub-tab {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    padding: 8px 18px;
    cursor: pointer;
    transition: all 0.15s;
}

.sub-tab:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.8);
}

.sub-tab.active {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.35);
    color: var(--accent-gold, #ffd700);
}

/* ── Tab panels ── */
.tab-panel {
    animation: tabFadeIn 0.2s ease;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Leaderboard info bar ── */
.leaderboard-info {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.3);
    margin-bottom: 1rem;
    padding: 8px 14px;
    background: rgba(255,255,255,0.03);
    border-left: 3px solid rgba(255, 215, 0, 0.3);
    border-radius: 0 6px 6px 0;
}

/* ── Table ── */
.leaderboard-table-wrap {
    background: var(--bg-panel, #1a1f35);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    overflow: hidden;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead tr {
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.leaderboard-table th {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
}

.leaderboard-table td {
    padding: 11px 16px;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.85);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.lb-row {
    transition: background 0.15s;
    animation: rowIn 0.3s ease both;
}

@keyframes rowIn {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

.lb-row:hover {
    background: rgba(255,255,255,0.03);
}

.lb-row:last-child td {
    border-bottom: none;
}

.lb-row-me {
    background: rgba(255, 215, 0, 0.05) !important;
}

.lb-row-me td {
    border-bottom-color: rgba(255, 215, 0, 0.1);
}

/* ── Column widths ── */
.col-rank  { width: 60px; text-align: center; }
.col-wins  { width: 70px; text-align: center; }
.col-games { width: 80px; text-align: center; }
.col-rate  { width: 160px; }

.table-loading,
.table-empty {
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: 0.85rem;
    padding: 3rem 1rem !important;
}

/* ── Rank badges ── */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 6px;
    padding: 3px 8px;
    gap: 3px;
}

.rank-badge.gold   { background: rgba(255,215,0,0.15); color: #ffd700; }
.rank-badge.silver { background: rgba(192,192,192,0.12); color: #c0c0c0; }
.rank-badge.bronze { background: rgba(205,127,50,0.15); color: #cd7f32; }

.rank-num {
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
}

/* ── Player link in table ── */
.lb-player-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    transition: color 0.15s;
}

.lb-player-link:hover {
    color: var(--accent-gold, #ffd700);
}

.lb-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,215,0,0.1);
    border: 1px solid rgba(255,215,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: var(--accent-gold, #ffd700);
    flex-shrink: 0;
}

.you-badge {
    background: rgba(255,215,0,0.15);
    color: var(--accent-gold, #ffd700);
    font-size: 0.6rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ── Win rate bar ── */
.rate-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rate-bar-bg {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.07);
    border-radius: 3px;
    overflow: hidden;
}

.rate-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.rate-text {
    font-size: 0.82rem;
    font-weight: 700;
    min-width: 36px;
    text-align: right;
    font-family: 'Cinzel', serif;
}

/* ── Search ── */
.search-bar-wrap {
    margin-bottom: 1.5rem;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-panel, #1a1f35);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 0 14px;
    gap: 10px;
    transition: border-color 0.2s;
}

.search-bar:focus-within {
    border-color: rgba(255, 215, 0, 0.4);
}

.search-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.95rem;
    padding: 14px 0;
}

.search-bar input::placeholder {
    color: rgba(255,255,255,0.25);
}

.search-clear {
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.search-clear:hover { color: #fff; }

/* ── Search results ── */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-prompt {
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: 0.85rem;
    padding: 2.5rem 1rem;
}

.search-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-panel, #1a1f35);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 12px 16px;
    animation: tabFadeIn 0.2s ease both;
    transition: border-color 0.15s, background 0.15s;
}

.search-result-row:hover {
    border-color: rgba(255,215,0,0.2);
    background: rgba(255,215,0,0.03);
}

.search-result-left {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.search-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,215,0,0.1);
    border: 1px solid rgba(255,215,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--accent-gold, #ffd700);
    flex-shrink: 0;
}

.search-username {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    transition: color 0.15s;
}

.search-result-left:hover .search-username {
    color: var(--accent-gold, #ffd700);
}

.search-stats {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    margin-top: 2px;
}

.search-result-actions {
    flex-shrink: 0;
}

/* ── Friend buttons in search ── */
.search-friend-btn {
    border: none;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 7px 14px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    white-space: nowrap;
}

.search-friend-btn:hover:not(:disabled) {
    opacity: 0.85;
    transform: translateY(-1px);
}

.search-friend-btn:disabled { cursor: default; opacity: 0.6; }

.btn-add      { background: var(--accent-gold, #ffd700); color: #0f1220; }
.btn-friends  { background: rgba(76,175,80,0.15); color: #4caf50; border: 1px solid rgba(76,175,80,0.3); }
.btn-pending  { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.4); border: 1px solid rgba(255,255,255,0.1); }
.btn-accept   { background: rgba(76,175,80,0.2); color: #4caf50; border: 1px solid rgba(76,175,80,0.4); }
.btn-blocked  { background: rgba(244,67,54,0.1); color: rgba(244,67,54,0.5); border: 1px solid rgba(244,67,54,0.2); }

/* ── Responsive ── */
@media (max-width: 600px) {
    .col-wins, .col-games { display: none; }
    .col-rate { width: 120px; }
    .rate-bar-bg { display: none; }
    .search-result-row { flex-wrap: wrap; }
    .search-result-actions { width: 100%; }
    .search-friend-btn { width: 100%; }
}
