/* HLTV-like Team Detail */
.team-detail-layout{display:grid;grid-template-columns:minmax(0,1fr) 285px;gap:14px;align-items:start}
.team-detail-main,.team-detail-sidebar{min-width:0}

.team-top-roster{height:155px;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));overflow:hidden;background:#2b3036;border:1px solid #20242a;border-bottom:3px solid #d62531}
.top-roster-player{position:relative;overflow:hidden;border-right:1px solid rgba(255,255,255,.08);color:#fff}
.top-roster-player>img{position:absolute;left:50%;bottom:24px;width:92%;height:130px;transform:translateX(-50%);object-fit:contain;object-position:center bottom}
.top-roster-player strong{position:absolute;z-index:3;left:8px;right:8px;bottom:8px;color:#fff;font-size:11px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top-roster-player span{display:none}
.top-roster-placeholder{position:absolute;left:50%;bottom:25px;width:72px;height:95px;transform:translateX(-50%)}
.top-roster-placeholder i{position:absolute;left:50%;top:0;width:34px;height:34px;transform:translateX(-50%);border-radius:50%;background:#80878f}
.top-roster-placeholder b{position:absolute;left:50%;bottom:0;width:68px;height:60px;transform:translateX(-50%);border-radius:36px 36px 6px 6px;background:#777e86}

.team-profile-card{display:grid;grid-template-columns:115px minmax(0,1fr);min-height:170px;background:#fff;border:1px solid #d4d7da;border-top:0}
.team-profile-logo{display:flex;align-items:center;justify-content:center;padding:12px;background:#f4f5f6}
.team-profile-logo img{max-width:82px;max-height:82px;object-fit:contain}
.team-logo-placeholder{font-size:30px;font-weight:900;color:#aaa}
.team-profile-info{padding:13px 15px}
.team-name-line{display:flex;align-items:center;gap:6px;color:#70757b;font-size:8px}
.team-flag{width:18px;height:11px;object-fit:cover;border:1px solid rgba(0,0,0,.1)}
.team-profile-info h1{margin:3px 0 8px;font-size:24px;line-height:1;font-weight:900}
.team-profile-lines>div{min-height:28px;display:grid;grid-template-columns:120px minmax(0,1fr);align-items:center;border-top:1px solid #e0e2e4}
.team-profile-lines span{font-size:8px;font-weight:800}
.team-profile-lines strong{font-size:9px;text-align:right}
.team-coach-inline a{color:#3976aa;font-weight:900}

.team-trophy-strip{height:45px;display:flex;align-items:center;gap:1px;padding:0 7px;background:#fff;border:1px solid #d4d7da;border-top:0;overflow-x:auto}
.team-trophy-strip a{width:38px;height:34px;flex:0 0 38px;display:flex;align-items:center;justify-content:center;border-right:1px solid #eee}
.team-trophy-strip img{max-width:27px;max-height:28px}.team-trophy-strip span{font-size:21px}

.team-tabs{display:flex;margin:12px 0;background:#fff;border:1px solid #d4d7da;overflow-x:auto}
.team-tabs a{min-height:38px;padding:0 13px;display:flex;align-items:center;white-space:nowrap;border-right:1px solid #ddd;color:#555;font-size:8px;font-weight:900}
.team-tabs a:hover{background:#f1f2f4;color:#d62531}
.team-section{scroll-margin-top:15px}

.team-roster-rows{background:#fff}
.team-member-row{min-height:58px;display:grid;grid-template-columns:56px minmax(0,1fr) 150px 22px;gap:9px;align-items:center;padding:5px 10px;border-bottom:1px solid #eee}
.team-member-row:hover{background:#fafafb}
.team-member-photo{width:48px;height:48px;position:relative;overflow:hidden;background:#f0f2f3}
.team-member-photo img{width:100%;height:100%;object-fit:contain;object-position:center bottom}
.member-silhouette{position:absolute;left:50%;bottom:2px;width:38px;height:44px;transform:translateX(-50%);background:#ccd1d5;border-radius:20px 20px 4px 4px}
.team-member-name strong,.team-member-name span{display:block}
.team-member-name strong{font-size:10px}
.team-member-name span{margin-top:2px;color:#888;font-size:7px}
.team-member-role{text-align:right;color:#686d73;font-size:8px;font-weight:700}
.team-member-arrow{text-align:right;color:#999;font-size:18px}
.coach-row{background:#fbfbfc}

.team-match-row{padding:9px 11px;border-bottom:1px solid #eee}
.team-match-event{display:inline-block;margin-bottom:6px;color:#3976aa;font-size:8px;font-weight:700}
.team-match-teams{display:grid;grid-template-columns:minmax(0,1fr) 48px minmax(0,1fr);gap:7px;align-items:center}
.team-match-teams a{display:flex;align-items:center;gap:6px;min-width:0;font-size:9px;font-weight:800;color:#25282d}
.team-match-teams a.right{justify-content:flex-end}
.team-match-teams img{width:22px;height:22px;object-fit:contain}
.team-match-teams span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.team-match-teams>strong{text-align:center;color:#d62531;font-size:11px}
.team-match-meta{text-align:right;margin-top:3px;color:#888;font-size:7px}

.team-achievement-row{display:grid;grid-template-columns:80px minmax(0,1fr) 115px;gap:8px;padding:9px 11px;border-bottom:1px solid #eee;font-size:8px}
.team-achievement-row>strong{color:#b77700}.team-achievement-row>span{text-align:right;color:#888}

.team-trophy-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
.team-trophy-card{text-align:center;padding:11px 7px;border-right:1px solid #eee;border-bottom:1px solid #eee}
.team-trophy-icon{font-size:25px}.team-trophy-card strong,.team-trophy-card span{display:block}
.team-trophy-card strong{font-size:8px;margin-top:4px}.team-trophy-card span{font-size:7px;color:#888;margin-top:3px}
.team-empty{padding:22px;text-align:center;color:#888;font-size:8px}

@media(max-width:850px){.team-detail-layout{display:block}.team-detail-sidebar{margin-top:12px}}
@media(max-width:650px){
 .team-top-roster{height:125px;grid-template-columns:repeat(5,120px);overflow-x:auto}
 .top-roster-player{min-width:120px}
 .team-profile-card{grid-template-columns:90px minmax(0,1fr)}
 .team-profile-info{padding:10px}
 .team-profile-info h1{font-size:20px}
 .team-profile-lines>div{grid-template-columns:95px minmax(0,1fr)}
 .team-member-row{grid-template-columns:48px minmax(0,1fr) 80px 18px}
 .team-member-photo{width:42px;height:42px}
 .team-trophy-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}/* Final alignment fixes */
.top-player-flag{
    position:absolute!important;
    z-index:6!important;
    left:8px!important;
    top:8px!important;
    width:20px!important;
    height:13px!important;
    object-fit:cover!important;
    transform:none!important;
    border:1px solid rgba(255,255,255,.35);
}
.team-top-roster{
    margin-top:0;
}
.team-profile-card{
    margin-top:0;
}
.team-profile-logo{
    align-self:stretch;
}

/* =========================================================
   TOP ROSTER FIX - HLTV STYLE
   - show full head
   - lower player slightly
   - dark silhouette/gradient around torso
========================================================= */

.team-top-roster {
    height: 165px;
    overflow: hidden;
}

.top-roster-player {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.02) 0%,
            rgba(255,255,255,.00) 48%,
            rgba(0,0,0,.20) 72%,
            rgba(0,0,0,.45) 100%
        );
}

/* Dark torso panel like HLTV */
.top-roster-player::after {
    content: "";
    position: absolute;
    z-index: 2;
    left: 8%;
    right: 8%;
    bottom: 0;
    height: 45%;
    border-radius: 55% 55% 0 0 / 35% 35% 0 0;
    background:
        radial-gradient(
            ellipse at center bottom,
            rgba(0,0,0,.42) 0%,
            rgba(0,0,0,.30) 45%,
            rgba(0,0,0,.10) 72%,
            rgba(0,0,0,0) 100%
        );
    pointer-events: none;
}

/* Player image: lower it so the head never gets cut */
.top-roster-player > img:not(.top-player-flag) {
    position: absolute;
    z-index: 1;
    left: 50%;
    bottom: 10px;
    width: 88%;
    height: 142px;
    transform: translateX(-50%);
    object-fit: contain;
    object-position: center bottom;
    pointer-events: none;
}

/* Flag must stay in upper-left and never inherit player image sizing */
.top-player-flag {
    position: absolute !important;
    z-index: 8 !important;
    left: 8px !important;
    top: 8px !important;
    bottom: auto !important;
    width: 20px !important;
    height: 13px !important;
    max-width: 20px !important;
    max-height: 13px !important;
    object-fit: cover !important;
    object-position: center !important;
    transform: none !important;
    border: 1px solid rgba(255,255,255,.35);
    box-shadow: 0 1px 2px rgba(0,0,0,.25);
}

/* Nickname sits over a dark transparent strip */
.top-roster-player strong {
    position: absolute;
    z-index: 7;
    left: 7px;
    right: 7px;
    bottom: 6px;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 5px;
    background: rgba(10,12,15,.72);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Placeholder should follow the same lower placement */
.top-roster-placeholder {
    position: absolute;
    z-index: 1;
    left: 50%;
    bottom: 24px;
    width: 72px;
    height: 98px;
    transform: translateX(-50%);
}

.top-roster-placeholder i {
    position: absolute;
    left: 50%;
    top: 0;
    width: 34px;
    height: 34px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #8b9299;
}

.top-roster-placeholder b {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 68px;
    height: 62px;
    transform: translateX(-50%);
    border-radius: 36px 36px 6px 6px;
    background: #7f868d;
}

@media (max-width: 650px) {
    .team-top-roster {
        height: 145px;
    }

    .top-roster-player > img:not(.top-player-flag) {
        bottom: 9px;
        height: 123px;
        width: 90%;
    }
}
