/* Torcida V CSS - EA FC 26 Mobile Edition UI/UX */

:root {
    --bg-dark: #070911;
    --panel-bg: rgba(14, 18, 30, 0.85);
    --panel-border: rgba(255, 255, 255, 0.08);
    --accent-neon: #fcb017; /* FC Gold / Orange highlight */
    --accent-gold: #ffcc00; /* EA Gold */
    --text-white: #ffffff;
    --text-muted: #8e9bb0;
    --card-bg: rgba(16, 22, 38, 0.95);
    --font-outfit: 'Outfit', sans-serif;
    --font-pixel: 'Press Start 2P', cursive;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-outfit);
    background: radial-gradient(circle, rgba(7, 9, 17, 0.7) 0%, rgba(2, 3, 6, 0.98) 100%), 
                url('stadium_bg.jpg') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-white);
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Stars overlay for deep night sky background effect */
.stars-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(white, rgba(255,255,255,.12) 1.5px, transparent 30px);
    background-size: 300px 300px;
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
}

/* Ambient glow moving dynamically */
.ambient-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(252, 176, 23, 0.08) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    transition: background 0.8s ease;
}

/* Main Container (Mobile First Layout - Locked to 100vh / No Scroll) */
.fc-container {
    width: 100%;
    max-width: 440px; /* Slimmer mobile layout */
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 16px;
    position: relative;
    z-index: 2;
    overflow: hidden; /* Lock viewport scrolling */
    justify-content: space-between;
}

@media (min-width: 441px) {
    .fc-container {
        height: 780px; /* Shorter desktop preview to fit laptop screens easily */
        background: rgba(6, 9, 16, 0.65);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--panel-border);
        border-radius: 28px;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
    }
}

/* HEADER STYLE */
.fc-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--panel-border);
}

.logo-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.logo-image {
    height: 180px; /* 4x larger size */
    max-width: 90%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

/* LEAGUE SELECTOR WITH ARROWS */
.league-wrapper {
    margin-bottom: 16px;
}

.league-selector-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.league-selector {
    flex: 1;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
    height: 48px;
}

.league-selector:hover {
    background: rgba(20, 26, 42, 0.85);
    border-color: rgba(255, 255, 255, 0.12);
}

.league-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.selector-sub {
    font-size: 8px;
    font-weight: 800;
    color: var(--accent-neon);
    letter-spacing: 1.2px;
}

.league-name {
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.league-gold-badge {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #ffe066 0%, #cc9900 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(204, 153, 0, 0.25);
}

.league-badge-icon {
    font-size: 16px;
}

.league-arrow {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--panel-border);
    color: var(--text-white);
    font-size: 22px;
    font-weight: 300;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.league-arrow:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.league-arrow:active {
    transform: scale(0.92);
}

/* WHITE CIRCULAR BADGE WRAPPER FOR LEAGUE LOGOS */
.league-logo-badge {
    width: 24px;
    height: 24px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    padding: 2.5px;
}

.league-logo-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* CARD PRINCIPAL DO TIME (EA FC Style - Auto scaled to prevent scroll) */
.card-outer-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    min-height: 0; /* Important for flex-shrink nested layout */
}

.team-card {
    width: 100%;
    height: 100%;
    max-height: 380px; /* Lock height limit to prevent scroll */
    background: var(--card-bg);
    border: 1px dashed rgba(252, 176, 23, 0.3);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* EA FC Triangular grid background mesh */
.team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(30deg, rgba(252, 176, 23, 0.02) 12%, transparent 12.5%, transparent 87%, rgba(252, 176, 23, 0.02) 87.5%, rgba(252, 176, 23, 0.02)),
        linear-gradient(150deg, rgba(252, 176, 23, 0.02) 12%, transparent 12.5%, transparent 87%, rgba(252, 176, 23, 0.02) 87.5%, rgba(252, 176, 23, 0.02)),
        linear-gradient(30deg, rgba(252, 176, 23, 0.015) 12%, transparent 12.5%, transparent 87%, rgba(252, 176, 23, 0.015) 87.5%, rgba(252, 176, 23, 0.015)),
        linear-gradient(150deg, rgba(252, 176, 23, 0.015) 12%, transparent 12.5%, transparent 87%, rgba(252, 176, 23, 0.015) 87.5%, rgba(252, 176, 23, 0.015));
    background-size: 18px 31px;
    background-position: 0 0, 0 0, 9px 15.5px, 9px 15.5px;
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
}

/* Active Highlight Border with Smooth Sweep Animation */
.team-card.active-state {
    border: 1px solid var(--accent-neon);
    animation: borderSweep 2.5s infinite alternate;
}

@keyframes borderSweep {
    0% {
        border-color: rgba(252, 176, 23, 0.35);
        box-shadow: 0 0 15px rgba(252, 176, 23, 0.15);
    }
    100% {
        border-color: rgba(252, 176, 23, 0.95);
        box-shadow: 0 0 25px rgba(252, 176, 23, 0.35);
    }
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(252, 176, 23, 0.06) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 2;
    position: relative;
    justify-content: space-between;
}

.team-name-header {
    text-align: center;
}

.active-team-name {
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.badge-carousel-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex: 1;
}

.badge-view-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 100%;
    max-height: 190px;
}

.shield-aura {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(252, 176, 23, 0.2) 0%, transparent 70%);
    filter: blur(10px);
    z-index: 0;
    transition: background 0.8s ease;
}

.team-large-badge {
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.team-large-badge img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

/* CAROUSEL ARROWS */
.carousel-arrow {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--panel-border);
    color: var(--text-white);
    font-size: 26px;
    font-weight: 300;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.04);
}

.carousel-arrow:active {
    transform: scale(0.92);
}

/* EA FC BRAND TEAM SELECTION TRANSITIONS (Scale + Fade + Blur / No Twirl) */
.badge-scale-out {
    animation: fcBadgeOut 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.badge-scale-in {
    animation: fcBadgeIn 0.3s cubic-bezier(0, 0, 0.2, 1) forwards;
}

.name-fade-out {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.15s ease-out;
}

.name-fade-in {
    opacity: 1;
    transform: scale(1);
    transition: all 0.25s ease-in;
}

@keyframes fcBadgeOut {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: blur(0);
    }
    100% {
        transform: scale(0.55);
        opacity: 0;
        filter: blur(6px);
    }
}

@keyframes fcBadgeIn {
    0% {
        transform: scale(0.55);
        opacity: 0;
        filter: blur(6px);
    }
    100% {
        transform: scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

/* ACTION BUTTON STYLE */
.action-wrapper {
    margin-top: 4px;
}

.btn-action-premium {
    width: 100%;
    background: linear-gradient(90deg, #ffcc00 0%, #fcb017 100%);
    border: none;
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 800;
    color: #000;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(252, 176, 23, 0.3);
    transition: all 0.25s ease;
    height: 52px;
}

.btn-action-premium:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 12px 24px rgba(252, 176, 23, 0.45);
}

.btn-action-premium:active {
    transform: translateY(0.5px);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
    transition: all 0.5s ease;
}

.btn-action-premium:hover .btn-shine {
    left: 100%;
    transition: all 0.6s ease;
}

.btn-text {
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* MODAL / POPUP STYLE */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

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

.modal-container {
    width: 100%;
    max-width: 360px;
    background: #0f1322;
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.active .modal-container {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--panel-border);
}

.modal-title-area {
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-neon);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-neon);
}

.modal-title {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

.modal-body {
    padding: 24px 20px;
    text-align: center;
}

.modal-icon-box {
    font-size: 36px;
    margin-bottom: 12px;
    filter: drop-shadow(0 3px 8px rgba(252, 176, 23, 0.25));
}

.modal-body-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.modal-body-text {
    font-size: 14px;
    color: var(--text-white);
    margin-bottom: 10px;
}

.modal-body-subtext {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.modal-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    justify-content: center;
}

.btn-modal-action {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--panel-border);
    color: var(--text-white);
    padding: 10px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-modal-action:hover {
    background: var(--text-white);
    color: #000;
}

/* DRAWER / OVERLAY STYLE */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 90;
    display: flex;
    align-items: flex-end; /* Bottom sheet layout */
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.drawer-container {
    width: 100%;
    max-width: 440px;
    background: #0d101d;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    border-top: 1px solid var(--panel-border);
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.5);
    max-height: 65vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.drawer-backdrop.active .drawer-container {
    transform: translateY(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--panel-border);
}

.drawer-title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--accent-neon);
}

.drawer-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.drawer-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px 24px 16px;
}

.drawer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drawer-item:hover {
    background: rgba(252, 176, 23, 0.05);
    border-color: var(--accent-neon);
}

.drawer-item.active {
    background: rgba(252, 176, 23, 0.08);
    border-color: var(--accent-neon);
}

.drawer-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-item-badge-fallback {
    font-size: 18px;
}

.drawer-item-name {
    font-size: 14px;
    font-weight: 700;
}

.drawer-item-check {
    color: var(--accent-neon);
    font-weight: 900;
    font-size: 14px;
}

/* Grid layout for team selection in team drawer */
#teamDrawerList {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

#teamDrawerList .drawer-item {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 12px;
    margin-bottom: 0;
}

.drawer-team-badge {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-team-badge img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* DYNAMIC JERSEYS GRID IN MODAL */
.jerseys-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    padding: 4px;
    margin-top: 12px;
}

.jersey-item-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    cursor: pointer;
}

.jersey-item-card:hover {
    border-color: var(--accent-neon);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 10px rgba(252, 176, 23, 0.15);
}

.jersey-card-img-wrap {
    width: 100%;
    aspect-ratio: 1.05;
    background: #090c15;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.jersey-card-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.jersey-card-info {
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.jersey-card-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-white);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-bottom: 6px;
    text-align: left;
}

.btn-jersey-view {
    width: 100%;
    background: rgba(252, 176, 23, 0.1);
    border: 1px solid var(--accent-neon);
    color: var(--accent-neon);
    padding: 4px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-jersey-view:hover {
    background: var(--accent-neon);
    color: #000;
}
