/* ==========================================================================
   BATTLE ROOM (LOBBY SKUAD 3v3 BATTLEGROUND) - STYLING DA VINCI MANUSCRIPT
   ========================================================================== */

.battle-room-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #120b06 url('assets/bg-battle-lobby.jpg') no-repeat center center;
    background-size: cover;
    color: #e6dfcf;
    font-family: 'Cinzel', 'Trajan Pro', 'Georgia', serif;
    overflow: hidden;
    padding: clamp(6px, 1.2vh, 12px) clamp(16px, 2vw, 24px);
    box-sizing: border-box;
    z-index: 10;
}

/* Background Atmospheric Parchment Overlay */
.battle-room-bg-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(circle at 50% 30%, rgba(14, 9, 5, 0.08) 0%, rgba(10, 6, 3, 0.45) 100%),
        linear-gradient(to bottom, rgba(10, 6, 3, 0.25) 0%, transparent 14%, transparent 86%, rgba(10, 6, 3, 0.5) 100%);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5);
}

/* Header Sala de Bello - Elevated Above Overlay, Ultra Crisp Zero Blur */
.battle-room-header {
    position: relative;
    z-index: 30;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1.5px solid rgba(212, 175, 55, 0.45);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    padding-bottom: clamp(4px, 0.8vh, 8px);
    margin-bottom: clamp(4px, 0.8vh, 8px);
    flex-shrink: 0;
}

.battle-room-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.battle-room-tag {
    display: none;
}

.battle-room-tag::before,
.battle-room-tag::after {
    content: "❖";
    color: #d97706;
    font-size: 0.85rem;
}

.battle-room-title {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 3px;
    margin: 0;
    color: #fef08a;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 14px rgba(245, 158, 11, 0.35);
}

.battle-room-subtitle {
    font-size: 0.92rem;
    color: #e2dad0;
    font-style: normal;
    font-family: 'Cinzel', 'Georgia', serif;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

.battle-room-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-room-back {
    position: relative;
    background: #140d07;
    border: 2px solid #d4af37;
    outline: 1.5px solid rgba(254, 240, 138, 0.4);
    outline-offset: -4px;
    color: #fef08a;
    width: 64px;
    height: 64px;
    padding: 0;
    cursor: pointer;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.85), inset 0 0 12px rgba(212, 175, 55, 0.3);
    transition: all 0.25s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.btn-room-back .room-home-icon-svg {
    width: 34px;
    height: 34px;
    stroke: #fef08a;
    stroke-width: 2.2;
    transition: stroke 0.2s ease, transform 0.2s ease;
}

.btn-room-back:hover {
    background: #2b1a0d;
    border-color: #fef08a;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.95), 0 0 16px rgba(254, 240, 138, 0.5);
    transform: translateY(-1px);
}

.btn-room-back:hover .room-home-icon-svg {
    stroke: #ffffff;
    transform: scale(1.1);
}

/* Skuad Grid (3 Slot Skuad Pemain) */
.battle-room-main {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: clamp(8px, 1.4vh, 14px);
    flex: 1 1 0;
    min-height: 0;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    transform: scale(1.1);
    transform-origin: center center;
}

.battle-squad-section-title {
    position: relative;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1310px;
    margin-bottom: 4px;
    padding: 0 4px;
    box-sizing: border-box;
}

.squad-title-text {
    display: none;
}

.squad-cr-badge {
    position: relative;
    z-index: 25;
    background: linear-gradient(180deg, #2b180b 0%, #190e06 100%);
    border: 2px solid #c99a49;
    outline: 1px solid rgba(246, 224, 165, 0.35);
    outline-offset: -3px;
    padding: 9px 36px;
    border-radius: 26px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8);
    display: inline-flex;
    align-items: center;
    gap: 16px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.squad-cr-badge .cr-label {
    color: #f6e2b3;
    font-size: 0.96rem;
    letter-spacing: 1.8px;
    font-weight: 800;
    text-shadow: none;
}

.squad-cr-badge .cr-divider {
    color: #d4a348;
    font-size: 1rem;
    text-shadow: none;
}

.squad-cr-badge .cr-value {
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 0.8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.battle-squad-slots-grid {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: clamp(18px, 2.5vw, 32px);
    width: 100%;
    max-width: 1310px;
}

/* Card Slot Skuad - Warm Parchment & Dark Leather Trim (+15% Scaling Preserved) */
.squad-slot-card {
    position: relative;
    flex: 1 1 0;
    width: clamp(345px, 28vw, 414px);
    height: clamp(400px, 60vh, 460px);
    max-width: 414px;
    max-height: 472px;
    background: #efe4cf url('assets/card-squad-blueprint.jpg') no-repeat center center;
    background-size: cover;
    border: 2px solid #8c5d2e;
    border-radius: 8px;
    padding: clamp(10px, 1.4vh, 14px) clamp(14px, 1.8vw, 18px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.82), inset 0 0 18px rgba(92, 58, 24, 0.22);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    box-sizing: border-box;
}

.squad-slot-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(247, 240, 224, 0.90) 0%,
            rgba(243, 234, 214, 0.78) 46%,
            rgba(246, 238, 221, 0.94) 100%);
    pointer-events: none;
    z-index: 1;
}

.squad-slot-card>* {
    position: relative;
    z-index: 2;
}

.squad-slot-card:hover {
    border-color: #c99a49;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.88), 0 0 18px rgba(201, 154, 73, 0.35);
    transform: translateY(-4px);
}

.squad-slot-card.commander-slot {
    border-color: #9a6b32;
}

/* Slot yang diisi Unit Pemain Resmi (Dok): Frame emas antik tegas */
.squad-slot-card.player-unit-slot {
    border: 3px solid #c98a2c;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.88), 0 0 16px rgba(201, 138, 44, 0.38), inset 0 0 0 1px rgba(246, 224, 165, 0.55);
}

.squad-slot-card.player-unit-slot:hover {
    border-color: #e6b450;
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.92), 0 0 22px rgba(230, 180, 80, 0.48), inset 0 0 0 1px rgba(255, 244, 214, 0.75);
    transform: translateY(-4px);
}

.slot-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, #362112 0%, #241409 100%);
    border: 1.5px solid #8c5d2e;
    border-radius: 6px;
    padding: 7px 12px;
    box-shadow: 0 2px 6px rgba(45, 24, 10, 0.22);
}

.slot-role-tag {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 1.4px;
    color: #f8ebd2;
    text-shadow: none;
    text-transform: uppercase;
}

.slot-source-pill {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.6px;
}

.slot-source-pill.dock-source {
    background: #1e3a8a;
    color: #ffffff;
    border: 1px solid #93c5fd;
    box-shadow: none;
}

.slot-source-pill.ai-source {
    background: #6b3d14;
    color: #fef3c7;
    border: 1px solid #d4a348;
    box-shadow: none;
}

.slot-source-pill.empty-source {
    background: #3f3830;
    color: #e5dfd5;
    border: 1px solid #8a7e6e;
}

/* Card Drone Identity (Title & Frame) */
.slot-drone-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    width: 100%;
    margin-top: 2px;
}

.slot-drone-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: clamp(1.12rem, 1.85vw, 1.3rem);
    font-weight: 900;
    color: #1f1207;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    letter-spacing: 0.8px;
    text-shadow: none;
}

.slot-drone-frame-type {
    font-size: 0.82rem;
    color: #5a3c20;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-shadow: none;
}

.slot-drone-cp-badge {
    display: inline-block;
    font-size: 0.84rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    color: #fff8e7;
    background: #2b180a;
    border: 1.5px solid #9a6b32;
    padding: 4px 12px;
    border-radius: 999px;
    letter-spacing: 0.5px;
    margin-top: 3px;
    box-shadow: 0 2px 5px rgba(45, 24, 10, 0.25);
    text-shadow: none;
}

/* Card Drone Insignia - Pinned Dead Center */
.slot-drone-insignia {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: auto 0;
    padding: 2px 0;
    transform: none;
}

.slot-drone-icon-box {
    width: clamp(54px, 7.2vh, 64px);
    height: clamp(54px, 7.2vh, 64px);
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #4a311c 0%, #201207 85%);
    border: 2.5px solid #b5833d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.5rem, 2.5vh, 1.9rem);
    color: #f8e5b4;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(40, 22, 8, 0.45), inset 0 0 8px rgba(212, 175, 55, 0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.squad-slot-card:hover .slot-drone-icon-box {
    transform: scale(1.06);
    box-shadow: 0 6px 18px rgba(40, 22, 8, 0.55), 0 0 12px rgba(181, 131, 61, 0.45);
}

/* Stat Container - Solid Crisp Parchment Panel with Dark Ink Readability */
.slot-stat-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    background: #fcf8ee;
    border: 1.5px solid #c6b08a;
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 4px;
    box-sizing: border-box;
    box-shadow: inset 0 1px 2px rgba(70, 45, 20, 0.08);
}

.slot-stat-trio {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    width: 100%;
}

.stat-trio-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
    padding: 3px 2px;
    border-bottom: 1.5px solid #dfd2b8;
}

.stat-trio-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    color: #63462a;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    text-shadow: none;
    white-space: nowrap;
}

.stat-trio-val {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 0.98rem;
    font-weight: 900;
    letter-spacing: 0.2px;
    text-shadow: none;
    white-space: nowrap;
}

.stat-trio-val.val-hp {
    color: #14532d;
    text-shadow: none;
}

.stat-trio-val.val-def,
.stat-trio-val.val-shield {
    color: #0c4a6e;
    text-shadow: none;
}

.stat-trio-val.val-spd {
    color: #92400e;
    text-shadow: none;
}

/* Weapons Box (Weapon A + Weapon B) */
.slot-weapons-box {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
}

.slot-weapon-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 4px 2px;
    border-bottom: 1px dashed #d6c5a5;
    box-sizing: border-box;
}

.slot-weapon-row:last-child {
    border-bottom: none;
}

.stat-weapon-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.74rem;
    font-weight: 800;
    color: #63462a;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: none;
    flex-shrink: 0;
}

.stat-weapon-val {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 68%;
    text-shadow: none;
}

.stat-weapon-val.val-wpna {
    color: #991b1b;
    text-shadow: none;
}

.stat-weapon-val.val-wpnb {
    color: #0369a1;
    text-shadow: none;
}

/* Slot Action Change Button */
.btn-slot-select {
    background: linear-gradient(180deg, #5e3b1e 0%, #3a220e 100%);
    border: 1.5px solid #9a6b32;
    color: #fff8e7;
    padding: 10px 14px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-transform: uppercase;
    box-shadow: 0 3px 8px rgba(45, 24, 10, 0.35), inset 0 1px 0 rgba(255, 244, 214, 0.2);
}

.btn-slot-select:hover {
    background: linear-gradient(180deg, #7c4f28 0%, #4d2d12 100%);
    border-color: #d4af37;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(45, 24, 10, 0.45);
    transform: translateY(-1px);
}

/* Matchmaking & Enemy Assessment Bar - Dark Leather Trim & Crisp Sans-Serif Intel (+15% Scaling Preserved) */
.battle-matchmaking-panel {
    position: relative;
    width: 100%;
    max-width: 1310px;
    margin: clamp(4px, 0.8vh, 8px) auto 0 auto;
    background: #21140b url('assets/banner-enemy-recon.jpg') no-repeat center center;
    background-size: cover;
    border: 2px solid #9a6b32;
    border-radius: 8px;
    padding: clamp(10px, 1.4vh, 15px) clamp(18px, 2.4vw, 30px);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(223, 194, 130, 0.25);
    overflow: hidden;
    box-sizing: border-box;
    flex-shrink: 0;
}

.battle-matchmaking-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(24, 14, 7, 0.90) 0%, rgba(28, 17, 9, 0.84) 60%, rgba(22, 13, 6, 0.92) 100%);
    pointer-events: none;
    z-index: 1;
}

.battle-matchmaking-panel>* {
    position: relative;
    z-index: 2;
}

.matchmaking-intel-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    backdrop-filter: none;
    box-shadow: none;
    max-width: 720px;
}

.intel-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.intel-title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.32rem;
    font-weight: 900;
    color: #f8ebd2;
    letter-spacing: 1.4px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

.intel-tier-badge {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #881337;
    border: 1.5px solid #fb7185;
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 6px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.intel-tier-badge.tier-c {
    background: #3f3830;
    border-color: #b8a68a;
    color: #f5efe4;
}

.intel-tier-badge.tier-b {
    background: #1e3a8a;
    border-color: #60a5fa;
    color: #ffffff;
}

.intel-tier-badge.tier-a {
    background: #881337;
    border-color: #fb7185;
    color: #ffffff;
}

.intel-tier-badge.tier-s {
    background: #581c87;
    border-color: #c084fc;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(88, 28, 135, 0.45);
}

.intel-desc {
    font-size: 0.98rem;
    color: #efe4d0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-style: normal;
    font-weight: 500;
    max-width: 720px;
    line-height: 1.48;
    text-shadow: none;
    margin: 0;
}

/* Renaissance War Cartouche - Tactile Gilded Command Button (+15% Scaling) */
.btn-start-battleground {
    position: relative;
    background: linear-gradient(180deg, #7c2d12 0%, #451408 50%, #260904 100%);
    border: 2px solid #c99a49;
    outline: 1.5px solid rgba(246, 224, 165, 0.45);
    outline-offset: -5px;
    color: #fff8e7;
    padding: clamp(10px, 1.6vh, 15px) clamp(22px, 2.8vw, 36px);
    font-family: 'Cinzel', Georgia, serif;
    font-size: clamp(1.02rem, 2.0vh, 1.18rem);
    font-weight: 900;
    letter-spacing: 1.8px;
    border-radius: 7px;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.9),
        0 0 18px rgba(201, 154, 73, 0.32),
        inset 0 1px 3px rgba(254, 240, 138, 0.45),
        inset 0 -3px 8px rgba(0, 0, 0, 0.8);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    animation: warStartPulse 3.5s ease-in-out infinite alternate;
}

.btn-start-battleground::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(254, 240, 138, 0.28) 0%, transparent 75%);
    pointer-events: none;
    z-index: 1;
}

.btn-start-battleground>* {
    position: relative;
    z-index: 2;
}

.btn-start-battleground span:first-child {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.btn-start-battleground span:last-child {
    font-size: 1.4rem;
    color: #f6d88c;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.85));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-start-battleground:hover {
    background: linear-gradient(180deg, #991b1b 0%, #581409 50%, #300a04 100%);
    border-color: #fef08a;
    outline-color: rgba(254, 240, 138, 0.8);
    color: #ffffff;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.95),
        0 0 34px rgba(245, 158, 11, 0.75),
        inset 0 1px 4px rgba(255, 255, 255, 0.6),
        inset 0 -2px 8px rgba(0, 0, 0, 0.9);
    transform: translateY(-2px) scale(1.02);
}

.btn-start-battleground:hover span:last-child {
    transform: rotate(20deg) scale(1.2);
}

.btn-start-battleground:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.9), inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

@keyframes warStartPulse {
    0% {
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.9), 0 0 18px rgba(212, 175, 55, 0.35), inset 0 1px 3px rgba(254, 240, 138, 0.5), inset 0 -3px 8px rgba(0, 0, 0, 0.8);
        border-color: #d4af37;
    }

    50% {
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.95), 0 0 30px rgba(245, 158, 11, 0.65), inset 0 1px 4px rgba(254, 240, 138, 0.65), inset 0 -3px 8px rgba(0, 0, 0, 0.8);
        border-color: #fef08a;
    }

    100% {
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.9), 0 0 18px rgba(212, 175, 55, 0.35), inset 0 1px 3px rgba(254, 240, 138, 0.5), inset 0 -3px 8px rgba(0, 0, 0, 0.8);
        border-color: #d4af37;
    }
}

/* ==========================================================================
   MODAL PEMILIHAN UNIT / DOK
   ========================================================================== */

.room-unit-selector-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 7, 5, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    box-sizing: border-box;
}

.unit-selector-card {
    background: #2b170a url('assets/leather-cover.jpg') repeat;
    border: 3px double #8c5d2e;
    border-radius: 12px;
    width: 100%;
    max-width: 1650px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.92),
        inset 0 1px 0 rgba(223, 194, 130, 0.35),
        inset 0 0 35px rgba(0, 0, 0, 0.65),
        0 0 25px rgba(140, 93, 46, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.unit-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 38px;
    border-bottom: 2px solid #5a3818;
    background: linear-gradient(180deg, #382313 0%, #26160b 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.unit-selector-title {
    font-family: 'Cinzel', serif;
    font-size: 1.55rem;
    font-weight: 800;
    color: #fbf5e8;
    letter-spacing: 2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.btn-close-selector {
    background: #4a2e18;
    border: 1.5px solid #8c5d2e;
    border-radius: 6px;
    color: #fbf5e8;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

.btn-close-selector:hover {
    background: #6e4420;
    border-color: #dfc282;
    color: #ffffff;
    transform: scale(1.05);
}

/* Tab Switcher: Dok Pemain vs Bot AI */
.unit-selector-tabs {
    display: flex;
    background: #1c1108;
    border-bottom: 2px solid #5a3818;
}

.tab-selector-btn {
    flex: 1;
    padding: 19px 34px;
    background: transparent;
    border: none;
    color: #a3927c;
    font-family: 'Cinzel', serif;
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: 1.4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tab-selector-btn:hover:not(.active) {
    color: #dfc282;
    background: rgba(255, 255, 255, 0.04);
}

.tab-selector-btn.active {
    color: #2b1d0c;
    border-bottom-color: #8c5d2e;
    background: #f4ecd8 url('assets/deckle-paper.jpg') repeat;
    box-shadow: inset 0 2px 0 #8c5d2e;
    font-weight: 900;
}

/* Unit Selector List (Zero Scroll - Strictly Paged per 3 Items) (+20% Enlarged Container) */
.unit-selector-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 26px 38px 14px 38px;
    height: 512px;
    max-height: 512px;
    overflow: hidden;
    box-sizing: border-box;
    background: #f4ecd8 url('assets/deckle-paper.jpg') repeat;
    box-shadow: inset 0 0 35px rgba(106, 68, 30, 0.25);
}

.unit-option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fcf9f2;
    border: 1.5px solid #c9b48c;
    border-radius: 8px;
    padding: 17px 28px;
    height: 146px;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 2px 5px rgba(70, 45, 20, 0.1);
}

.unit-option-item:hover {
    background: #ffffff;
    border-color: #8c5d2e;
    box-shadow: 0 4px 14px rgba(70, 45, 20, 0.22);
    transform: translateY(-1px);
}

.unit-option-item.unit-option-locked {
    background: #fdf5f5;
    border-color: #d88a8a;
    cursor: not-allowed;
}

.unit-option-item.unit-option-locked:hover {
    background: #fcf1f1;
    border-color: #991b1b;
    transform: none;
    box-shadow: 0 2px 5px rgba(70, 45, 20, 0.1);
}

.unit-option-item.unit-option-in-use {
    background: #fdfaf2;
    border-color: #d8b068;
    cursor: not-allowed;
}

.unit-option-item.unit-option-in-use:hover {
    background: #fdf7eb;
    border-color: #92400e;
    transform: none;
    box-shadow: 0 2px 5px rgba(70, 45, 20, 0.1);
}

.unit-option-item.unit-option-disabled {
    background: #f4ece0;
    border-color: #baa48a;
    cursor: not-allowed;
}

.unit-option-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
    margin-right: 20px;
    overflow: hidden;
}

.unit-option-badge-icon {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 21px;
    font-weight: 900;
    flex-shrink: 0;
    box-sizing: border-box;
    letter-spacing: 0.5px;
}

.unit-option-badge-icon.dock-icon {
    background: #2b1d0c;
    border: 2px solid #8c5d2e;
    color: #dfc282;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.unit-option-badge-icon.ai-icon-ready {
    background: #14532d;
    border: 2px solid #166534;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.unit-option-badge-icon.ai-icon-locked {
    background: #7f1d1d;
    border: 2px solid #5a1111;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.unit-option-badge-icon.ai-icon-in-use {
    background: #78350f;
    border: 2px solid #572608;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.unit-option-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.unit-option-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.unit-option-name {
    font-family: 'Cinzel', serif;
    font-size: 1.47rem;
    font-weight: 900;
    color: #2b1d0c;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

.unit-status-pill {
    font-family: 'Cinzel', serif;
    font-size: 0.99rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 4.5px 14px;
    border-radius: 6px;
    text-transform: uppercase;
    white-space: nowrap;
}

.unit-status-pill.pill-ready {
    background: #14532d;
    border: 1.5px solid #166534;
    color: #ffffff;
}

.unit-status-pill.pill-locked {
    background: #991b1b;
    border: 1.5px solid #7f1d1d;
    color: #ffffff;
}

.unit-status-pill.pill-in-use {
    background: #92400e;
    border: 1.5px solid #78350f;
    color: #ffffff;
}

.unit-status-pill.pill-unready {
    background: #991b1b;
    border: 1.5px solid #7f1d1d;
    color: #ffffff;
}

.unit-option-specs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.unit-role-text {
    font-family: 'Cinzel', Georgia, serif;
    font-style: italic;
    font-size: 1.10rem;
    color: #5c4328;
    white-space: nowrap;
    margin-right: 6px;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unit-stat-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 5px;
    background: #ede2c9;
    border: 1.5px solid #b8a688;
    font-size: 1.05rem;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

.unit-stat-k {
    font-family: 'Cinzel', serif;
    font-weight: 800;
    font-size: 0.94rem;
    letter-spacing: 0.5px;
}

.unit-stat-v {
    font-family: 'Consolas', 'Segoe UI', monospace;
    font-weight: 800;
    font-size: 1.12rem;
}

.unit-stat-chip.hp .unit-stat-k {
    color: #14532d;
    font-weight: 800;
}

.unit-stat-chip.hp .unit-stat-v {
    color: #166534;
    font-weight: 900;
}

.unit-stat-chip.atk .unit-stat-k {
    color: #991b1b;
    font-weight: 800;
}

.unit-stat-chip.atk .unit-stat-v {
    color: #7f1d1d;
    font-weight: 900;
}

.unit-stat-chip.def .unit-stat-k {
    color: #92400e;
    font-weight: 800;
}

.unit-stat-chip.def .unit-stat-v {
    color: #78350f;
    font-weight: 900;
}

.unit-stat-chip.spd .unit-stat-k {
    color: #075985;
    font-weight: 800;
}

.unit-stat-chip.spd .unit-stat-v {
    color: #0369a1;
    font-weight: 900;
}

.unit-stat-chip.cp .unit-stat-k {
    color: #581c87;
    font-weight: 800;
}

.unit-stat-chip.cp .unit-stat-v {
    color: #4a044e;
    font-weight: 900;
}

.unit-option-alert {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unit-option-alert.alert-tier {
    color: #991b1b;
}

.unit-option-alert.alert-in-use {
    color: #92400e;
}

.unit-option-alert.alert-missing {
    color: #991b1b;
}

.unit-tier-warning {
    font-size: 1.05rem;
    color: #991b1b;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 800;
    margin-top: 2px;
    letter-spacing: 0.2px;
}

.unit-missing-warning {
    font-size: 1.05rem;
    color: #991b1b;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 800;
    margin-top: 2px;
    letter-spacing: 0.2px;
}

.unit-in-use-warning {
    font-size: 1.05rem;
    color: #92400e;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 800;
    margin-top: 2px;
    letter-spacing: 0.2px;
}

.unit-option-right {
    flex-shrink: 0;
    min-width: 240px;
    margin-left: 20px;
    display: flex;
    justify-content: flex-end;
}

.btn-choose-unit {
    min-width: 240px;
    height: 66px;
    padding: 0 28px;
    border-radius: 9px;
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    background: linear-gradient(180deg, #8c5d2e 0%, #5a3814 100%);
    border: 1.5px solid #dfc282;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-choose-unit:hover:not(:disabled) {
    background: linear-gradient(180deg, #a66f37 0%, #6e4418 100%);
    color: #ffffff;
    border-color: #ffd060;
    box-shadow: 0 0 14px rgba(223, 194, 130, 0.5);
    transform: translateY(-1px);
}

.btn-choose-unit:disabled,
.btn-choose-unit.btn-unit-disabled {
    background: #e2d7c0;
    border: 1.5px solid #b8a68a;
    color: #786854;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.slot-unready-notice {
    display: inline-block;
    color: #ffffff;
    font-size: 0.99rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-align: center;
    background: #991b1b;
    border: 1px solid #7f1d1d;
    padding: 5px 10px;
    border-radius: 5px;
    margin-top: 4px;
}

/* Unit Selector Pagination Footer (+20% Scaling) */
.unit-selector-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 38px;
    padding: 20px 38px;
    border-top: 1.5px solid #5a3818;
    background: linear-gradient(180deg, #382313 0%, #26160b 100%);
}

.selector-page-nav-btn {
    width: 72px;
    height: 58px;
    border-radius: 9px;
    background: #4a2e18;
    border: 1.5px solid #8c5d2e;
    color: #dfc282;
    font-size: 21px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selector-page-nav-btn:hover:not(:disabled) {
    background: #6e4420;
    border-color: #dfc282;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(223, 194, 130, 0.35);
}

.selector-page-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: #5a3818;
    color: #786854;
    box-shadow: none;
}

.selector-page-info {
    font-family: 'Cinzel', serif;
    font-size: 1.32rem;
    font-weight: 800;
    color: #fbf5e8;
    letter-spacing: 1.5px;
    min-width: 200px;
    text-align: center;
}

/* ==========================================================================
   VERSUS MATCHMAKING SCREEN (3.5 DETIK TRANSISI)
   ========================================================================== */

.battle-versus-overlay {
    position: fixed;
    inset: 0;
    background: #080605 url('assets/battleground-loading.jpg') no-repeat center center / cover;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 60px;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.battle-versus-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.versus-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.versus-badge {
    font-size: 0.96rem;
    /* Scaled +20% from 0.8rem */
    letter-spacing: 4.5px;
    color: #d4af37;
    font-weight: 700;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.versus-title {
    font-size: 2.64rem;
    /* Scaled +20% from 2.2rem */
    font-weight: 900;
    letter-spacing: 3.5px;
    margin: 0;
    background: linear-gradient(135deg, #fffbeb 0%, #fbbf24 50%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.95));
}

/* Layout Split: Kiri Pemain vs Kanan Musuh (+20% Scale) */
.versus-teams-stage {
    display: grid;
    grid-template-columns: 1fr 140px 1fr;
    align-items: center;
    gap: 28px;
    width: 100%;
    max-width: 1560px;
    /* Scaled +20% from 1300px */
    margin: 0 auto;
}

.versus-team-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.versus-team-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

.versus-team-header.enemy-header {
    justify-content: flex-end;
    border-bottom-color: rgba(220, 38, 38, 0.4);
}

.versus-team-name {
    font-size: 1.38rem;
    /* Scaled +20% from 1.15rem */
    font-weight: 800;
    letter-spacing: 2.5px;
}

.versus-team-name.ally-name {
    color: #60a5fa;
}

.versus-team-name.enemy-name {
    color: #f87171;
}

.versus-card-unit {
    display: flex;
    align-items: center;
    gap: 18px;
    background: rgba(25, 20, 16, 0.85);
    border: 1px solid #634b35;
    border-radius: 8px;
    padding: 15px 22px;
    /* Scaled +20% from 12px 18px */
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.versus-card-unit.enemy-card {
    flex-direction: row-reverse;
    border-color: #7f1d1d;
    background: rgba(35, 15, 15, 0.85);
    text-align: right;
}

.versus-unit-avatar {
    width: 58px;
    /* Scaled +20% from 48px */
    height: 58px;
    border-radius: 50%;
    background: #1e1813;
    border: 2px solid #b45309;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    /* Scaled +20% from 1.4rem */
    flex-shrink: 0;
}

.versus-card-unit.enemy-card .versus-unit-avatar {
    border-color: #dc2626;
}

.versus-unit-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.versus-unit-title {
    font-size: 1.15rem;
    /* Scaled +20% from 0.95rem */
    font-weight: 800;
    color: #fef3c7;
    letter-spacing: 0.6px;
}

.versus-unit-meta {
    font-size: 0.88rem;
    /* Scaled +20% from 0.72rem */
    color: #9ca3af;
    font-family: 'Georgia', serif;
}

/* VS Center Emblazon */
.versus-center-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.versus-vs-circle {
    width: 96px;
    /* Scaled +20% from 80px */
    height: 96px;
    border-radius: 50%;
    background: radial-gradient(circle, #78350f 0%, #1c140d 75%);
    border: 3.5px solid #f59e0b;
    box-shadow: 0 0 32px rgba(245, 158, 11, 0.5), inset 0 0 16px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.16rem;
    /* Scaled +20% from 1.8rem */
    font-weight: 900;
    color: #fffbeb;
    letter-spacing: 2px;
    animation: vsPulse 1.2s infinite ease-in-out;
}

@keyframes vsPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 35px rgba(245, 158, 11, 0.8);
    }
}

.versus-footer {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.versus-countdown-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fef08a;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
}

.versus-progress-track {
    width: 320px;
    height: 6px;
    background: rgba(40, 30, 20, 0.8);
    border-radius: 3px;
    border: 1px solid #785a3c;
    overflow: hidden;
}

.versus-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #b45309, #fbbf24);
    transition: width 5.5s linear;
    /* Scaled to 5.5s for 5-second countdown */
}

/* ==========================================================================
   BATTLEGROUND HUD KHUSUS (TOP BAR LIVING SPHERES & 3V3 ROSTER)
   Single Line Elongated Horizontal Layout (+20% Scale)
   ========================================================================== */

.bg-living-sphere-hud {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%) scale(1.18);
    transform-origin: top center;
    display: flex;
    align-items: center;
    background: rgba(18, 14, 11, 0.95);
    border: 1.5px solid #85633e;
    border-radius: 20px;
    padding: 0 16px;
    height: 42px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.85), inset 0 0 14px rgba(0, 0, 0, 0.6), 0 0 16px rgba(56, 189, 248, 0.2);
    z-index: 50;
    pointer-events: auto;
    width: clamp(582px, 45vw, 784px);
    /* Scaled +12% from clamp(520px, 40vw, 700px) */
    max-width: 90vw;
    box-sizing: border-box;
}

.bg-sphere-unified-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.bg-team-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.8px;
    flex-shrink: 0;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* TIM A: Solid Royal Cobalt Navy with Antique Brass Border (Non-AI, Bold Heraldic) */
.bg-team-pill.ally {
    background: #1e3a8a;
    border: 1.5px solid #d4af37;
    color: #fef3c7;
}

/* TIM B: Solid Imperial Burgundy with Antique Brass Border (Non-AI, Bold Heraldic) */
.bg-team-pill.enemy {
    background: #7f1d1d;
    border: 1.5px solid #d4af37;
    color: #fef3c7;
}

.bg-team-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bg-team-pill-dot.ally {
    background: #fbbf24;
    border: 1px solid #78350f;
    box-shadow: none;
}

.bg-team-pill-dot.enemy {
    background: #fca5a5;
    border: 1px solid #450a0a;
    box-shadow: none;
}

.bg-team-pill-squad {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 11.5px;
    font-weight: 800;
    color: #fef3c7;
    margin-left: 2px;
    letter-spacing: 0.5px;
}

.bg-sphere-center-timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(133, 99, 62, 0.5);
    flex-shrink: 0;
}

.bg-match-clock {
    font-family: 'Cinzel', monospace;
    font-size: 14px;
    font-weight: 800;
    color: #fef08a;
    letter-spacing: 1px;
}

.bg-capture-countdown-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 4px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    flex-shrink: 0;
    min-width: auto;
    text-align: center;
    transition: all 0.25s ease;
}

.bg-capture-countdown-box.captured-blue {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.bg-capture-countdown-box.captured-red {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.bg-capture-pill {
    display: none !important;
}

.bg-capture-clock {
    font-family: 'Cinzel', monospace;
    font-size: 15px;
    /* Enlarge countdown timer */
    font-weight: 900;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.bg-capture-clock.captured-blue {
    color: #38bdf8;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.85);
}

.bg-capture-clock.captured-red {
    color: #f87171;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.85);
}

.bg-sphere-track-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
    height: 100%;
}

.bg-sphere-objective-title {
    color: #fce7b2;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.8px;
    flex-shrink: 0;
    text-shadow: 0 0 6px rgba(212, 175, 55, 0.5);
}

.bg-sphere-single-track {
    flex: 1;
    height: 20px;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 5px;
    border: 1.5px solid rgba(133, 99, 62, 0.6);
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-sphere-single-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #0284c7, #38bdf8, #06b6d4);
    border-radius: 3px;
    transition: width 0.25s ease, background 0.3s ease;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
    z-index: 1;
}

.bg-sphere-objective-hp {
    position: relative;
    z-index: 2;
    color: #ffffff;
    font-family: monospace;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 4px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    padding: 0 6px;
    pointer-events: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 600px) {
    .bg-sphere-bar-group {
        width: 100px;
    }
}

.bg-sphere-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.bg-sphere-name-ally {
    color: #60a5fa;
}

.bg-sphere-name-enemy {
    color: #f87171;
}

.bg-sphere-shield-tag {
    color: #fbbf24;
    font-size: 0.68rem;
}

.bg-sphere-track {
    width: 100%;
    height: 10px;
    background: rgba(30, 25, 20, 0.9);
    border-radius: 5px;
    border: 1px solid rgba(120, 90, 60, 0.5);
    overflow: hidden;
}

.bg-sphere-fill-ally {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    transition: width 0.3s ease;
}

.bg-sphere-fill-enemy {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #f87171);
    transition: width 0.3s ease;
}

.bg-sphere-center-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    justify-self: center;
    margin: 0;
    padding: 0 4px;
    flex-shrink: 0;
}

.bg-match-clock {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fef08a;
    font-family: monospace;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(254, 240, 138, 0.5);
    white-space: nowrap;
}

.bg-bridge-status-text {
    font-size: 0.65rem;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 3v3 Roster Avatars */
.bg-roster-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bg-roster-avatar {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #251d16;
    border: 2px solid #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    overflow: hidden;
}

.bg-roster-avatar.enemy-avatar {
    border-color: #ef4444;
}

.bg-roster-avatar.dead {
    filter: grayscale(100%);
    opacity: 0.5;
    border-color: #6b7280;
}

.bg-respawn-countdown-badge {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    color: #fbbf24;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.bg-result-modal {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #0a0806;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.bg-result-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.bg-result-card {
    background: linear-gradient(180deg, #2a2018 0%, #15110d 100%);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 26px 32px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    max-width: 720px;
    width: 92vw;
    max-height: 88vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    box-sizing: border-box;
}

.bg-result-title {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 3px;
    margin: 0;
}

.bg-result-title.victory {
    color: #fbbf24;
    text-shadow: 0 0 25px rgba(251, 191, 36, 0.7);
}

.bg-result-title.defeat {
    color: #ef4444;
    text-shadow: 0 0 25px rgba(239, 68, 68, 0.7);
}

.bg-result-title.team-a {
    color: #38bdf8;
    text-shadow: 0 0 25px rgba(56, 189, 248, 0.8), 0 0 45px rgba(2, 132, 199, 0.6);
}

.bg-result-title.team-b {
    color: #ef4444;
    text-shadow: 0 0 25px rgba(239, 68, 68, 0.8), 0 0 45px rgba(185, 28, 28, 0.6);
}

.bg-result-card.team-a {
    border-color: #38bdf8;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(56, 189, 248, 0.3);
}

.bg-result-card.team-b {
    border-color: #ef4444;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(239, 68, 68, 0.3);
}

.bg-result-desc {
    font-size: 0.92rem;
    color: #d1d5db;
    font-family: 'Georgia', serif;
    line-height: 1.5;
}

.btn-result-return {
    margin-top: 10px;
    background: linear-gradient(135deg, #b45309, #78350f);
    border: 1px solid #fbbf24;
    color: #fffbeb;
    padding: 10px 28px;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-result-return:hover {
    background: #d97706;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

/* ==========================================================================
   BATTLE ROOM LOBBY TOAST NOTIFICATION
   ========================================================================== */
.battle-room-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-24px);
    background: rgba(24, 12, 10, 0.96);
    border: 1px solid #ef4444;
    color: #fecaca;
    padding: 12px 24px;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(239, 68, 68, 0.35);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.battle-room-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.battle-room-toast.info {
    border-color: #f59e0b;
    color: #fef3c7;
    background: rgba(28, 19, 10, 0.96);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(245, 158, 11, 0.35);
}

.battle-room-toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.battle-room-toast-text {
    line-height: 1.4;
}

/* ==========================================================================
   AUTHORITATIVE MATCHMAKING POOL OVERLAY (BOLD LEATHER & ANTIQUE BRASS)
   ========================================================================== */
.battle-matchmaking-overlay {
    position: fixed;
    inset: 0;
    background: rgba(14, 9, 5, 0.90);
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mm-queue-card {
    width: 100%;
    max-width: 680px;
    background: #1c130b;
    border: 3px solid #9a6b32;
    border-radius: 10px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.92), inset 0 0 0 2px #3b2816;
    padding: 32px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.mm-queue-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.mm-queue-badge {
    display: inline-block;
    background: #3b2612;
    border: 1.5px solid #b5833d;
    color: #f3dba8;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1.8px;
    padding: 4px 14px;
    border-radius: 4px;
    text-transform: uppercase;
}

.mm-queue-title {
    font-family: 'Cinzel', serif;
    font-size: 1.85rem;
    font-weight: 900;
    color: #f8edd2;
    letter-spacing: 1.5px;
    margin: 0;
}

.mm-compass-emblem {
    position: relative;
    width: 112px;
    height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #120c07;
    border: 3px solid #8c5d2e;
    border-radius: 50%;
    box-shadow: inset 0 4px 14px rgba(0, 0, 0, 0.85);
}

.mm-compass-ring {
    position: absolute;
    inset: 6px;
    border: 3px dashed #c8963e;
    border-radius: 50%;
    animation: mmCompassRotate 8s linear infinite;
}

@keyframes mmCompassRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.mm-timer-val {
    font-family: 'Cinzel', serif;
    font-size: 1.95rem;
    font-weight: 900;
    color: #f6d88c;
    letter-spacing: 1px;
    z-index: 2;
}

.mm-metrics-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.mm-metric-box {
    background: #261a0f;
    border: 2px solid #6e4823;
    border-radius: 7px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mm-metric-label {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 800;
    color: #c5a880;
    letter-spacing: 1px;
}

.mm-metric-value {
    font-family: 'Cinzel', serif;
    font-size: 1.32rem;
    font-weight: 900;
    color: #f8edd2;
}

.mm-progress-track {
    width: 100%;
    height: 12px;
    background: #100a05;
    border: 1.5px solid #6e4823;
    border-radius: 6px;
    overflow: hidden;
}

.mm-progress-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #9a6b32 0%, #d4a048 100%);
    transition: width 0.25s linear;
}

.mm-status-note {
    font-family: 'Georgia', serif;
    font-size: 0.98rem;
    color: #dfd0b8;
    line-height: 1.5;
    margin: 0;
    max-width: 580px;
}

.mm-queue-actions {
    margin-top: 4px;
}

.btn-cancel-matchmaking {
    background: #5c1919;
    border: 2px solid #992b2b;
    color: #f8edd2;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    padding: 11px 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.btn-cancel-matchmaking:hover {
    background: #7a2020;
    transform: translateY(-1px);
}

/* Post-Match Battleground Reward Summary Box */
.bg-reward-summary-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 14px 0 8px 0;
    flex-wrap: wrap;
}

.bg-reward-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #24180c;
    border: 2px solid #a17134;
    border-radius: 6px;
    padding: 8px 18px;
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 1.12rem;
    color: #f6d88c;
    letter-spacing: 0.8px;
}

.bg-reward-pill.points-pill {
    background: #17253b;
    border-color: #3b6998;
    color: #e2eefc;
}

/* Post-Match Battleground Squad K/D Breakdown Table */
.bg-postmatch-kd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 14px;
    width: 100%;
    text-align: left;
}

.bg-postmatch-team-card {
    background: rgba(15, 11, 8, 0.88);
    border: 1px solid rgba(161, 113, 52, 0.55);
    border-radius: 8px;
    overflow: hidden;
}

.bg-postmatch-team-card.team-a {
    border-color: rgba(56, 189, 248, 0.55);
}

.bg-postmatch-team-card.team-b {
    border-color: rgba(239, 68, 68, 0.55);
}

.bg-postmatch-team-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    border-bottom: 1px solid rgba(133, 99, 62, 0.35);
}

.bg-postmatch-team-card.team-a .bg-postmatch-team-head {
    background: rgba(14, 116, 144, 0.25);
    color: #7dd3fc;
}

.bg-postmatch-team-card.team-b .bg-postmatch-team-head {
    background: rgba(153, 27, 27, 0.25);
    color: #fca5a5;
}

.bg-postmatch-kd-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.84rem;
}

.bg-postmatch-kd-table th {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.7px;
    color: #a89984;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(133, 99, 62, 0.25);
    text-transform: uppercase;
}

.bg-postmatch-kd-table td {
    padding: 7px 10px;
    color: #ede4d3;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.bg-postmatch-kd-table tr:last-child td {
    border-bottom: none;
}

.bg-postmatch-kd-table tr.is-player {
    background: rgba(251, 191, 36, 0.12);
}

.bg-postmatch-kd-table th.num,
.bg-postmatch-kd-table td.num {
    text-align: center;
    font-variant-numeric: tabular-nums;
    width: 44px;
    font-weight: 700;
}

.bg-postmatch-kd-table td.kill-num {
    color: #4ade80;
}

.bg-postmatch-kd-table td.death-num {
    color: #f87171;
}

.bg-postmatch-pilot-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.bg-postmatch-role-tag {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 2px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}

.bg-postmatch-role-tag.user {
    background: #92400e;
    border: 1px solid #fbbf24;
    color: #fef3c7;
}

.bg-postmatch-role-tag.ai {
    background: rgba(51, 65, 85, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.45);
    color: #cbd5e1;
}

.bg-postmatch-pilot-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .bg-postmatch-kd-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   BATTLEGROUND FORFEIT NOTICE MODAL & BAN BANNER (DA VINCI HERALDIC STYLE)
   ============================================================================ */
.bg-forfeit-notice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-forfeit-notice-card {
    background: #140f0c;
    border: 2px solid #b45309;
    border-radius: 14px;
    padding: 28px 36px;
    max-width: 580px;
    width: 90%;
    box-sizing: border-box;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 24px rgba(245, 158, 11, 0.35);
    color: #fef3c7;
    text-align: center;
    font-family: 'Cinzel', 'Georgia', serif;
}

.bg-forfeit-notice-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.bg-forfeit-notice-icon {
    font-size: 56px;
    /* Scaled +60% from 36px */
    color: #ef4444;
}

.bg-forfeit-notice-title {
    font-size: 28px;
    /* Scaled +60% from 18px */
    font-weight: 800;
    color: #fca5a5;
    letter-spacing: 1.5px;
    margin: 0;
}

.bg-forfeit-notice-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 22px;
    /* Scaled +60% from 14px */
    color: #cbd5e1;
    line-height: 1.5;
    margin-bottom: 24px;
}

.bg-forfeit-notice-text {
    font-size: 22px;
    /* Scaled +60% from 14px */
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.bg-forfeit-notice-subtext {
    font-size: 19px;
    /* Scaled +60% from 12px */
    color: #cbd5e1;
    line-height: 1.4;
    margin-top: 10px;
}

.bg-forfeit-btn-ack {
    background: linear-gradient(135deg, #78350f, #b45309);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    color: #ffffff;
    font-size: 22px;
    /* Scaled +60% from 14px */
    font-weight: 700;
    padding: 14px 44px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.bg-forfeit-btn-ack:hover {
    background: linear-gradient(135deg, #b45309, #d97706);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.5);
}

.bg-ban-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 6, 4, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 25000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.bg-ban-card {
    background: linear-gradient(180deg, #1b110d 0%, #120b09 100%);
    border: 2px solid #ef4444;
    border-radius: 14px;
    padding: 24px 28px;
    max-width: 460px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.92), 0 0 28px rgba(239, 68, 68, 0.28);
    color: #fef3c7;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.bg-ban-icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 999px;
    background: rgba(185, 28, 28, 0.22);
    border: 1.5px solid rgba(248, 113, 113, 0.7);
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-ban-title {
    margin: 0;
    font-family: 'Cinzel', 'Georgia', serif;
    font-size: 18px;
    font-weight: 800;
    color: #fca5a5;
    letter-spacing: 1px;
}

.bg-ban-timer-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-radius: 8px;
    padding: 10px 24px;
    min-width: 170px;
}

.bg-ban-timer-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #cbd5e1;
}

.bg-ban-timer-val {
    font-size: 28px;
    font-weight: 800;
    color: #fef2f2;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1.5px;
}

.bg-ban-reason {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: #e2e8f0;
}

.bg-ban-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    width: 100%;
    flex-wrap: wrap;
}

.bg-ban-btn-menu,
.bg-ban-btn-close {
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.bg-ban-btn-menu {
    background: linear-gradient(135deg, #7f1d1d, #b91c1c);
    border: 1px solid #f87171;
    color: #ffffff;
}

.bg-ban-btn-close {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid #64748b;
    color: #e2e8f0;
}

.bg-ban-btn-menu:hover,
.bg-ban-btn-close:hover {
    opacity: 0.92;
}