/* === 4v4 COMPACT LAYOUT (V42.0 Final) === */
.team4v4-container {
    display: none;
    position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
    width: auto; 
    align-items: flex-end; justify-content: center;
    /* Padding bottom = Bar Height (4px) + Gap (10px) = 14px */
    padding-bottom: 14px;
}
body[data-mode="team4v4"] .team4v4-container { display: flex; }

/* Match Grid */
.match-grid {
    display: flex;
    align-items: flex-end;
    gap: 18px;
}

/* --- RED SIDE (Now Right) --- */
.col-red {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 8px; padding-bottom: 5px;
}

.red-content {
    display: flex; flex-direction: column; align-items: flex-start;
}

.red-team-name {
    font-size: 36px; font-weight: 900; font-style: italic;
    color: var(--red-500); letter-spacing: 0.05em; text-transform: uppercase;
    line-height: 1; margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    display: block !important;
    text-align: left;
}

/* Player Grid */
.red-players {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    /* direction: rtl; Removed for Right side */
}

.p-card-red {
    background: rgba(15, 18, 25, 0.98);
    padding: 7px 10px;
    border-right: 3px solid var(--red-500);
    width: 132px;
    min-height: 46px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border-radius: 2px;
    direction: ltr;
    display: flex; justify-content: flex-start; align-items: center;
}
.p-text-red {
    font-size: 29px; font-weight: 700; color: #fff;
    text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-align: left;
}

/* Pips */
.pips-red { display: flex; gap: 6px; justify-content: flex-start; width: 100%; margin-top: 8px; margin-bottom: 0; }


/* --- BLUE SIDE (Now Left) --- */
.col-blue {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 8px; padding-bottom: 5px;
}

.blue-content {
    display: flex; flex-direction: column; align-items: flex-end;
}

.blue-team-name {
    font-size: 36px; font-weight: 900; font-style: italic;
    color: var(--blue-500); letter-spacing: 0.05em; text-align: right; text-transform: uppercase;
    line-height: 1; margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    display: block !important;
}

.blue-players {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    direction: rtl; /* Mirror grid for Left side */
}

.p-card-blue {
    background: rgba(15, 18, 25, 0.98);
    padding: 7px 10px;
    border-left: 3px solid var(--blue-500);
    width: 132px;
    min-height: 46px;
    text-align: right;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border-radius: 2px;
    display: flex; justify-content: flex-end; align-items: center;
    direction: ltr;
}
.p-text-blue {
    font-size: 29px; font-weight: 700; color: #fff;
    text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-align: right;
}

/* Pips */
.pips-blue { display: flex; gap: 6px; flex-direction: row-reverse; justify-content: flex-start; width: 100%; margin-top: 8px; margin-bottom: 0; }


/* Pips Common - Blade Style (Option A) - High Contrast Fix - Divergent Skew */
.pip {
    width: 40px;
    height: 14px;
    /* Dark background + Light Border = Visible on both White and Black */
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* Add a slight shadow for depth */
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
    transition: 0.3s;
    border-radius: 1px;
    /* Default skew removed, handled by parent selector below */
}

/* Blue Pips (Left): Skew to the left (top leans left, diverging) */
.pips-blue .pip {
    transform: skewX(20deg);
}

/* Red Pips (Right): Skew to the right (top leans right, diverging) */
.pips-red .pip {
    transform: skewX(-20deg);
}

.pip-r-on {
    background: var(--red-500);
    border-color: #f87171;
    box-shadow: 0 1px 3px rgba(0,0,0,0.45);
}
.pip-b-on {
    background: var(--blue-500);
    border-color: #60a5fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.45);
}


/* --- CENTER --- */
.col-center { 
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end; 
    padding-bottom: 15px; margin: 0 10px; 
}

.score-huge {
    display: grid;
    grid-template-columns: 1fr 100px 1fr; 
    align-items: baseline; 
    width: 320px;
    font-family: var(--font-display); 
    font-weight: 900; font-style: italic;
    line-height: 0.8;
}

.sc-val-red {
    font-size: 130px; color: var(--red-500);
    text-align: left; justify-self: start;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.8));
    font-variant-numeric: tabular-nums;
}
.sc-val-blue {
    font-size: 130px; color: var(--blue-500);
    text-align: right; justify-self: end;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.8));
    font-variant-numeric: tabular-nums;
}

.sc-vs { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; height: 100%; }

/* Designed VS */
.vs-txt {
    font-size: 48px; font-weight: 900; font-style: italic; letter-spacing: 0.1em;
    color: #fff; opacity: 1; z-index: 2;
    /* Stronger Dual Glow */
    text-shadow:
        -4px 0 15px var(--blue-500), /* Strong Blue Left */
        4px 0 15px var(--red-500),   /* Strong Red Right */
        0 4px 8px rgba(0,0,0,0.9);   /* Deep Black Shadow */
    position: relative;
    text-align: center;
}

.sc-vs::before {
    content: ''; position: absolute; width: 4px; height: 100px; /* Thicker and longer */
    /* Direct Blue to Red Gradient */
    background: linear-gradient(to bottom, transparent 0%, var(--blue-500) 20%, var(--red-500) 80%, transparent 100%);
    transform: rotate(25deg);
    z-index: 1; /* Behind text (z-index 2) */
    opacity: 0.8;
    box-shadow: 0 0 10px rgba(255,255,255,0.2);
}
.sc-vs::after {
    content: ''; position: absolute; width: 60px; height: 60px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    z-index: 0;
}

/* Global Bottom Line (V42.0 Final) */
.global-bot-line {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 4px; display: flex; 
    z-index: 10; 
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    overflow: hidden;
}

.gbl-red {
    width: 50%;
    background: var(--red-500);
    border-radius: 0 2px 2px 0;
    position: relative;
    transition: none;
}

.gbl-blue {
    width: 50%;
    background: var(--blue-500);
    border-radius: 2px 0 0 2px;
    position: relative;
    transition: none;
}

/* === MOBILE PROFILE (Douyin readability) === */
body[data-profile="mobile"][data-mode="team4v4"] .team4v4-container {
    width: 96%;
    bottom: 20px;
    justify-content: center;
}

body[data-profile="mobile"][data-mode="team4v4"] .match-grid {
    width: 100%;
    gap: 16px;
    justify-content: space-between;
}

body[data-profile="mobile"][data-mode="team4v4"] .col-blue,
body[data-profile="mobile"][data-mode="team4v4"] .col-red {
    flex: 1;
}

body[data-profile="mobile"][data-mode="team4v4"] .blue-team-name,
body[data-profile="mobile"][data-mode="team4v4"] .red-team-name {
    font-size: 42px;
}

body[data-profile="mobile"][data-mode="team4v4"] .p-card-blue,
body[data-profile="mobile"][data-mode="team4v4"] .p-card-red {
    width: 160px;
    min-height: 50px;
    padding: 8px 10px;
}

body[data-profile="mobile"][data-mode="team4v4"] .p-text-blue,
body[data-profile="mobile"][data-mode="team4v4"] .p-text-red {
    font-size: 27px;
}

body[data-profile="mobile"][data-mode="team4v4"] .score-huge {
    width: 350px;
    grid-template-columns: 1fr 90px 1fr;
}

body[data-profile="mobile"][data-mode="team4v4"] .sc-val-blue,
body[data-profile="mobile"][data-mode="team4v4"] .sc-val-red {
    font-size: 152px;
    animation: none;
}

body[data-profile="mobile"][data-mode="team4v4"] .vs-txt {
    font-size: 44px;
    animation: none;
}

body[data-profile="mobile"][data-mode="team4v4"] .sc-vs::before,
body[data-profile="mobile"][data-mode="team4v4"] .sc-vs::after {
    animation: none;
}
