/* FOOTYPACKS - DESIGN SYSTEM & STYLING */

:root {
    --bg-primary: #070814;
    --bg-secondary: #0d0e25;
    --bg-card: rgba(20, 22, 50, 0.6);
    --bg-input: rgba(10, 11, 28, 0.8);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 242, 254, 0.25);
    
    /* Neon Accent Colors */
    --color-cyan: #00f2fe;
    --color-blue: #4facfe;
    --color-gold: #ffbd03;
    --color-purple: #9b51e0;
    --color-red: #ff3838;
    --color-green: #2ecc71;
    --color-white: #ffffff;
    
    /* Font Families */
    --font-primary: 'Montserrat', sans-serif;
    --font-accent: 'Montserrat', sans-serif;
    
    --transition-speed: 0.3s;
    --shadow-neon-cyan: 0 0 15px rgba(0, 242, 254, 0.4);
    --shadow-neon-gold: 0 0 15px rgba(255, 189, 3, 0.4);
    --shadow-neon-purple: 0 0 15px rgba(155, 81, 224, 0.4);
}

/* Mobile & Touch Optimizations */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
        padding-top: max(0px, env(safe-area-inset-top));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}

/* Touch-friendly button sizing */
button, a[role="button"], input[type="button"], input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Disable text selection on clickable elements */
.nav-tab, .pack-card, .header-btn, .buy-btn, .action-btn-primary, .action-btn-secondary {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Better scroll performance */
.main-content, .modal-content, .selector-grid, .sim-events-log {
    -webkit-overflow-scrolling: touch;
}

/* Prevent zoom on input focus */
input, select, textarea {
    font-size: 16px;
}

/* Responsive image optimization */
img {
    max-width: 100%;
    height: auto;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: #e0e6ed;
    font-family: var(--font-primary);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #1e204a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-blue);
}

/* Ambient Background Glows */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(160px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.25;
}
.bg-glow-1 {
    background: radial-gradient(circle, var(--color-blue) 0%, transparent 70%);
    top: -200px;
    left: -200px;
}
.bg-glow-2 {
    background: radial-gradient(circle, var(--color-purple) 0%, transparent 70%);
    bottom: -200px;
    right: -200px;
}

/* APP HEADER */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(13, 14, 37, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 75px;
}

.logo-image {
    max-height: 55px;
    object-fit: contain;
    transition: transform var(--transition-speed);
}
.logo-image:hover {
    transform: scale(1.05);
}

.logo-fallback-text {
    font-family: var(--font-accent);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--color-white);
}
.logo-fallback-text span {
    color: var(--color-cyan);
    text-shadow: var(--shadow-neon-cyan);
}

/* CURRENCY PANEL */
.currency-container {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(20, 22, 50, 0.8) 0%, rgba(10, 11, 28, 0.9) 100%);
    border: 1px solid rgba(255, 189, 3, 0.3);
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-family: var(--font-accent);
    box-shadow: 0 0 10px rgba(255, 189, 3, 0.1);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.currency-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 189, 3, 0.3);
}
.coin-icon {
    color: var(--color-gold);
    font-size: 1.3rem;
    margin-right: 8px;
    animation: coinSpin 4s linear infinite;
}
@keyframes coinSpin {
    0% { transform: rotateY(0deg); }
    20% { transform: rotateY(360deg); }
    100% { transform: rotateY(360deg); }
}
#fpBalance {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-white);
    margin-right: 5px;
}
.currency-label {
    font-size: 0.9rem;
    color: var(--color-gold);
    font-weight: 700;
}

/* BUTTONS IN HEADER */
.header-btn {
    background: rgba(30, 32, 74, 0.6);
    border: 1px solid var(--border-color);
    color: var(--color-white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-speed);
}
.header-btn:hover {
    background: var(--color-blue);
    border-color: var(--color-cyan);
    box-shadow: var(--shadow-neon-cyan);
    transform: translateY(-2px);
}
.daily-btn {
    background: linear-gradient(135deg, rgba(155, 81, 224, 0.5) 0%, rgba(30, 32, 74, 0.6) 100%);
    border: 1px solid rgba(155, 81, 224, 0.4);
}
.daily-btn:hover {
    background: var(--color-purple);
    border-color: #b376f2;
    box-shadow: var(--shadow-neon-purple);
}
.daily-btn.cooldown {
    opacity: 0.75;
    cursor: not-allowed;
    background: rgba(20, 22, 50, 0.4);
    border-color: var(--border-color);
    box-shadow: none !important;
    transform: none !important;
    color: #888;
}

.sound-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
    margin-left: 10px;
}

/* NAVIGATION BAR */
.nav-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 0.8rem 1rem;
    background: rgba(9, 10, 28, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 90;
}
.nav-tab {
    background: transparent;
    border: none;
    color: #8e95b3;
    font-family: var(--font-accent);
    font-size: 1.15rem;
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-speed);
}
.nav-tab:hover {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.03);
}
.nav-tab.active {
    color: var(--color-cyan);
    background: rgba(0, 242, 254, 0.08);
    box-shadow: inset 0 0 10px rgba(0, 242, 254, 0.1);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}
.tab-panel.active {
    display: block;
}

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

.section-header {
    margin-bottom: 2rem;
}
.section-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-white);
    font-family: var(--font-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.section-header p {
    color: #8e95b3;
    font-size: 1rem;
    margin-top: 5px;
}

/* ================== STORE / PACKS VIEW ================== */
.packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    justify-content: center;
}

.pack-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-speed) cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.pack-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: transparent;
    transition: background var(--transition-speed);
}
.pack-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

/* Card specific header glows */
.starter-pack:hover { border-color: rgba(255, 255, 255, 0.3); }
.basic-pack:hover { border-color: var(--color-blue); box-shadow: 0 0 25px rgba(79, 172, 254, 0.2); }
.mid-pack:hover { border-color: var(--color-purple); box-shadow: 0 0 25px rgba(155, 81, 224, 0.2); }
.premium-pack:hover { border-color: var(--color-cyan); box-shadow: 0 0 25px rgba(0, 242, 254, 0.25); }
.elite-pack:hover { border-color: var(--color-gold); box-shadow: 0 0 30px rgba(255, 189, 3, 0.25); }

.starter-pack::before { background: #bbb; }
.basic-pack::before { background: var(--color-blue); }
.mid-pack::before { background: var(--color-purple); }
.premium-pack::before { background: var(--color-cyan); }
.elite-pack::before { background: var(--color-gold); }

/* Pack Shiny Reflector */
.pack-shine {
    position: absolute;
    top: -50%;
    left: -60%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    pointer-events: none;
    transform: rotate(-10deg);
    transition: transform 0.6s;
}
.pack-card:hover .pack-shine {
    transform: translate(30%, 30%) rotate(-10deg);
}

.pack-image-container {
    width: 100%;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
}
.pack-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5));
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.pack-card:hover .pack-img {
    transform: scale(1.08) rotate(2deg);
}

.pack-info {
    width: 100%;
    text-align: center;
}
.pack-info h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-white);
    font-family: var(--font-accent);
    text-transform: uppercase;
}
.pack-desc {
    font-size: 0.85rem;
    color: #8e95b3;
    line-height: 1.4;
    margin-bottom: 1rem;
    height: 40px;
    overflow: hidden;
}
.pack-odds {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    margin-bottom: 1.2rem;
    display: inline-block;
}
.pack-odds span {
    font-size: 0.75rem;
    color: #a5adc9;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.buy-btn {
    width: 100%;
    background: linear-gradient(135deg, #1e204a 0%, #121330 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    padding: 0.75rem;
    border-radius: 12px;
    font-family: var(--font-accent);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-speed);
}
.buy-btn i {
    color: var(--color-gold);
    font-size: 1.05rem;
}
.buy-btn:hover {
    transform: translateY(-2px);
}
.buy-btn:active {
    transform: translateY(1px);
}

/* Pack Card Purchase Buttons Glow */
.basic-pack .buy-btn:hover { background: var(--color-blue); border-color: #7abeff; box-shadow: 0 0 15px rgba(79, 172, 254, 0.4); }
.mid-pack .buy-btn:hover { background: var(--color-purple); border-color: #b580eb; box-shadow: 0 0 15px rgba(155, 81, 224, 0.4); }
.premium-pack .buy-btn:hover { background: var(--color-cyan); border-color: #6cfaff; color: #000; box-shadow: 0 0 15px rgba(0, 242, 254, 0.4); }
.premium-pack .buy-btn:hover i { color: #000; }
.elite-pack .buy-btn:hover { background: var(--color-gold); border-color: #ffd666; color: #000; box-shadow: 0 0 20px rgba(255, 189, 3, 0.5); }
.elite-pack .buy-btn:hover i { color: #000; }

.free-pack:hover {
    background: #bbb !important;
    color: #000 !important;
    border-color: #fff !important;
    box-shadow: 0 0 15px rgba(255,255,255,0.3);
}

/* ================== COLLECTION / CSAPATOM VIEW ================== */
.collection-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
}
.col-stat-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.stat-label {
    font-size: 0.85rem;
    color: #8e95b3;
    margin-bottom: 5px;
    font-weight: 500;
}
.stat-value {
    font-family: var(--font-accent);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-white);
}
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-blue) 0%, var(--color-cyan) 100%);
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.5);
    transition: width 0.5s ease-out;
}

/* FILTER CONTROLS */
.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 2rem;
}
@media (min-width: 900px) {
    .filter-controls {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 450px;
}
.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #636b8f;
}
.search-box input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem 0.75rem 2.8rem;
    border-radius: 12px;
    color: var(--color-white);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    transition: border-color var(--transition-speed);
}
.search-box input:focus {
    outline: none;
    border-color: var(--color-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

.filter-dropdowns {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.select-wrapper {
    position: relative;
}
.select-wrapper::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #636b8f;
    pointer-events: none;
}
.select-wrapper select {
    appearance: none;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.75rem 2.5rem 0.75rem 1.2rem;
    border-radius: 12px;
    color: var(--color-white);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 140px;
    transition: border-color var(--transition-speed);
}
.select-wrapper select:focus {
    outline: none;
    border-color: var(--color-cyan);
}

/* CARDS GRID */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 22px;
    min-height: 250px;
}

.empty-collection-msg {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: #636b8f;
    text-align: center;
}
.empty-collection-msg i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.empty-collection-msg p {
    font-size: 1.1rem;
}

/* ================== TOYS / CARDS RENDERING ================== */
.card-container {
    width: 100%;
    aspect-ratio: 2.5 / 3.5;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-container:hover .card-inner {
    transform: rotateY(10deg) rotateX(10deg);
}

.card-container.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
}

/* Back face of Card (Design patterns) */
.card-back {
    background: #050614;
    border: none;
    padding: 0;
    overflow: hidden;
    transform: rotateY(180deg);
}

.card-back-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    border-radius: 12px;
}

/* Front face of Card */
.card-front {
    background: #0f1026;
    border: 2px solid #272848;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.card-front-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Nationality / Rarity Holographic Glows */
.card-front::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    border-radius: 10px;
    z-index: 5;
}

/* Holographic shiny pattern for Legendary cards */
.rarity-legendary .card-front::after {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(0, 242, 254, 0.08) 25%,
        rgba(155, 81, 224, 0.08) 50%,
        rgba(255, 189, 3, 0.08) 75%,
        rgba(255, 255, 255, 0.08) 100%
    );
    mix-blend-mode: color-dodge;
}

/* Rarity classes borders and shadows */
.rarity-core { border-color: #2c2e43; }
.rarity-special { 
    border-color: var(--color-blue); 
    box-shadow: 0 0 8px rgba(79, 172, 254, 0.25);
}
.rarity-legendary { 
    border-color: var(--color-gold); 
    box-shadow: 0 0 12px rgba(255, 189, 3, 0.35);
}

/* Card Badge (Quantity) */
.card-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--color-purple);
    color: var(--color-white);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    border: 2px solid var(--bg-primary);
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Detailed components inside the card */
.card-front-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.card-header-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 8px 12px 8px;
    height: 36px;
    position: relative;
    z-index: 5;
    background: linear-gradient(180deg, rgba(15, 16, 38, 0.9) 0%, rgba(15, 16, 38, 0.4) 60%, rgba(15, 16, 38, 0) 100%);
}

.card-ovr {
    font-family: var(--font-accent);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-white);
    line-height: 1;
}

.card-position-badge {
    font-family: var(--font-accent);
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 1px 4px;
    border-radius: 3px;
    margin-top: 2px;
}

.rarity-legendary .card-ovr {
    color: var(--color-gold);
    text-shadow: 0 0 5px rgba(255, 189, 3, 0.5);
}

.card-logo-mini {
    height: 18px;
    opacity: 0.8;
}

/* Player Image styling */
.card-player-img-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}
.card-player-img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform var(--transition-speed);
}
.card-container:hover .card-player-img {
    transform: scale(1.08);
}

/* Info overlay / bottom bar */
.card-footer-info {
    background: linear-gradient(0deg, rgba(10, 11, 28, 0.98) 0%, rgba(10, 11, 28, 0.85) 60%, rgba(10, 11, 28, 0) 100%);
    padding: 15px 4px 6px 4px;
    text-align: center;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}

.card-name {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.72rem;
    color: var(--color-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
    line-height: 1.2;
}

.card-meta-line {
    font-size: 0.6rem;
    color: #8e95b3;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mini Adrenalyn Stats for card front bottom */
.card-mini-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 4px;
    margin-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.03);
}

.mini-stat-num {
    font-family: var(--font-accent);
    font-size: 0.7rem;
    font-weight: 700;
}
.stat-def { color: var(--color-red); }
.stat-con { color: var(--color-blue); }
.stat-att { color: var(--color-green); }

/* Card overlay sheen reflection on mouse move */
.card-sheen {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    z-index: 6;
    opacity: 0.5;
}

/* ================== SQUAD BUILDER / CSAPATÉPÍTŐ ================== */
.squad-layout-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}
@media (min-width: 1000px) {
    .squad-layout-container {
        grid-template-columns: 320px 1fr;
    }
}

.squad-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    height: fit-content;
}
.squad-sidebar h3 {
    font-family: var(--font-accent);
    font-size: 1.5rem;
    text-transform: uppercase;
    color: var(--color-white);
    margin-bottom: 0.5rem;
}
.squad-desc {
    font-size: 0.9rem;
    color: #8e95b3;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.squad-rating-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.02);
}
.rating-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, #191c42 0%, #07091d 100%);
    border: 4px solid var(--color-cyan);
    box-shadow: var(--shadow-neon-cyan);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
#squadRatingValue {
    font-family: var(--font-accent);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-white);
    line-height: 1;
}
.rating-label {
    font-size: 0.75rem;
    color: var(--color-cyan);
    font-weight: 700;
    letter-spacing: 1px;
}
.squad-stars {
    display: flex;
    gap: 4px;
    color: var(--color-gold);
    font-size: 0.9rem;
}

.squad-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.action-btn-primary {
    background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-cyan) 100%);
    border: none;
    color: #000;
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.8rem;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-speed);
}
.action-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-neon-cyan);
}
.action-btn-secondary {
    background: rgba(30, 32, 74, 0.6);
    border: 1px solid var(--border-color);
    color: var(--color-white);
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.8rem;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-speed);
}
.action-btn-secondary:hover {
    background: rgba(255, 59, 48, 0.1);
    border-color: rgba(255, 59, 48, 0.4);
    color: #ff5e57;
}

/* SQUAD FIELD / PITCH */
.squad-pitch-container {
    width: 100%;
    background: radial-gradient(circle at center, #0f4024 0%, #071f11 100%);
    border: 2px solid #144f2d;
    border-radius: 24px;
    padding: 20px;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.6);
    overflow: hidden;
}

.pitch {
    width: 100%;
    aspect-ratio: 4 / 3.4;
    position: relative;
    background-image: repeating-linear-gradient(90deg, 
        rgba(255,255,255,0.01) 0px, 
        rgba(255,255,255,0.01) 60px, 
        rgba(255,255,255,0) 60px, 
        rgba(255,255,255,0) 120px
    );
}

.pitch-lines {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 2px dashed rgba(255, 255, 255, 0.08);
    pointer-events: none;
}
.center-circle {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 20%;
    height: 25%;
    border: 2px dashed rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}
.halfway-line {
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    width: 2px;
    border-left: 2px dashed rgba(255, 255, 255, 0.08);
}
.penalty-box {
    position: absolute;
    width: 40%;
    height: 18%;
    border: 2px dashed rgba(255, 255, 255, 0.08);
}
.penalty-top { top: 0; left: 30%; border-top: none; }
.penalty-bottom { bottom: 0; left: 30%; border-bottom: none; }

.pitch-squad {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    position: relative;
    z-index: 10;
}

.pitch-row {
    display: flex;
    justify-content: center;
    gap: 8%;
    width: 100%;
}

/* SQUAD SLOT */
.squad-slot {
    width: 13.5%;
    aspect-ratio: 2.5 / 3.5;
    background: rgba(0, 0, 0, 0.35);
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
}
.squad-slot:hover {
    border-color: var(--color-cyan);
    background: rgba(0, 242, 254, 0.05);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.slot-plus {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.3);
    transition: color var(--transition-speed);
}
.squad-slot:hover .slot-plus {
    color: var(--color-cyan);
}

.slot-role {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    margin-top: 5px;
}

.slot-card-holder {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 15;
    pointer-events: none;
    display: none;
}
.squad-slot.filled {
    border: none;
    background: transparent;
}
.squad-slot.filled .slot-plus,
.squad-slot.filled .slot-role {
    display: none;
}
.squad-slot.filled .slot-card-holder {
    display: block;
    pointer-events: auto;
}

/* ================== MATCH SIMULATOR ================== */
.match-main-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    min-height: 450px;
    position: relative;
    overflow: hidden;
}

.match-setup {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.setup-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    align-items: center;
    margin-bottom: 2rem;
}
@media (min-width: 800px) {
    .setup-grid {
        grid-template-columns: 1fr 100px 1fr;
    }
}

.setup-team {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.setup-team h3 {
    font-family: var(--font-accent);
    font-size: 1.2rem;
    text-transform: uppercase;
    color: #8e95b3;
    margin-bottom: 1rem;
}

.setup-badge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.home-glow {
    background: rgba(0, 242, 254, 0.1);
    color: var(--color-cyan);
    border: 2px solid var(--color-cyan);
    box-shadow: var(--shadow-neon-cyan);
}
.away-glow {
    background: rgba(255, 56, 56, 0.1);
    color: var(--color-red);
    border: 2px solid var(--color-red);
    box-shadow: 0 0 15px rgba(255, 56, 56, 0.3);
}

.team-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-white);
    margin-bottom: 0.5rem;
}

.team-rating-bar {
    display: flex;
    align-items: baseline;
    gap: 5px;
    background: rgba(255,255,255,0.05);
    padding: 0.3rem 1rem;
    border-radius: 20px;
}
.rating-number {
    font-family: var(--font-accent);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-white);
}
.rating-text {
    font-size: 0.8rem;
    color: #8e95b3;
    font-weight: 700;
}

.squad-validation {
    font-size: 0.85rem;
    margin-top: 1rem;
    font-weight: 600;
}
.validation-success { color: var(--color-green); }
.validation-error { color: var(--color-red); }

.setup-vs {
    text-align: center;
    position: relative;
}
.vs-text {
    font-family: var(--font-accent);
    font-size: 2.2rem;
    font-weight: 900;
    font-style: italic;
    color: #3b3e66;
    letter-spacing: 2px;
}

#btnNextOpponent {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
}

.match-start-actions {
    text-align: center;
}
.match-start-btn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: none;
    color: #fff;
    font-family: var(--font-accent);
    font-weight: 800;
    font-size: 1.4rem;
    padding: 1rem 3rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.3);
}
.match-start-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(46, 204, 113, 0.5);
}
.match-start-btn:disabled {
    background: #3a3b4c;
    color: #6c6d7d;
    cursor: not-allowed;
    box-shadow: none;
}

/* SIMULATION SCREEN */
.sim-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 16px;
    padding: 1.2rem 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255,255,255,0.02);
}
.sim-team-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}
.sim-team-info:last-child {
    justify-content: flex-end;
}
.sim-team-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-white);
}
.sim-team-score {
    font-family: var(--font-accent);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-white);
    background: #060713;
    padding: 0.2rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.sim-time-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 20px;
}
.sim-timer {
    font-family: var(--font-accent);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-cyan);
    text-shadow: var(--shadow-neon-cyan);
}

.sim-events-log {
    background: #050611;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sim-event {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    border-left: 3px solid #636b8f;
    font-size: 0.9rem;
    animation: slideInLeft 0.3s ease-out forwards;
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-15px); }
    to { opacity: 1; transform: translateX(0); }
}

.sim-event.event-goal {
    background: rgba(46, 204, 113, 0.08);
    border-left-color: var(--color-green);
    color: #a3e9be;
    font-weight: 600;
}
.sim-event.event-card {
    background: rgba(241, 196, 15, 0.08);
    border-left-color: var(--color-gold);
    color: #fce2a6;
}
.sim-event.event-whistle {
    background: rgba(0, 242, 254, 0.05);
    border-left-color: var(--color-cyan);
    font-weight: 600;
}

.sim-status-bar {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.95rem;
    color: #8e95b3;
    font-weight: 500;
}

/* RESULTS SCREEN */
.match-result-screen {
    text-align: center;
    padding: 3rem 1rem;
    animation: scaleUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.match-result-screen h2 {
    font-family: var(--font-accent);
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}
.result-win h2 { color: var(--color-green); text-shadow: 0 0 20px rgba(46, 204, 113, 0.3); }
.result-draw h2 { color: var(--color-gold); text-shadow: 0 0 20px rgba(241, 196, 15, 0.3); }
.result-loss h2 { color: var(--color-red); text-shadow: 0 0 20px rgba(255, 56, 56, 0.3); }

.result-score {
    font-family: var(--font-accent);
    font-size: 4.5rem;
    font-weight: 900;
    color: var(--color-white);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}
.result-description {
    color: #a5adc9;
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.reward-box {
    background: rgba(255, 189, 3, 0.05);
    border: 1px solid rgba(255, 189, 3, 0.15);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 320px;
    margin: 0 auto 2.5rem auto;
}
.reward-box h3 {
    font-size: 0.95rem;
    color: #a5adc9;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.reward-coins {
    font-family: var(--font-accent);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* ================== MODAL GENERAL STYLES ================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(4, 5, 15, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: #636b8f;
    font-size: 2rem;
    cursor: pointer;
    z-index: 20;
    transition: color var(--transition-speed);
}
.close-modal-btn:hover {
    color: var(--color-white);
}

.modal-header {
    padding: 1.5rem 2rem 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
    font-family: var(--font-accent);
    font-size: 1.4rem;
    text-transform: uppercase;
    color: var(--color-white);
}

/* CARD SELECTOR MODAL */
.card-selector-content {
    max-width: 700px;
}
.selector-filters {
    padding: 1rem 2rem;
    display: flex;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
}
.selector-filters input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    color: var(--color-white);
}
.selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    padding: 1.5rem 2rem;
    max-height: 55vh;
    overflow-y: auto;
}

/* CARD DETAILS MODAL */
.card-details-content {
    max-width: 650px;
    overflow: hidden;
}
.details-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 2.5rem;
}
@media (min-width: 600px) {
    .details-layout {
        grid-template-columns: 200px 1fr;
    }
}

.details-left {
    display: flex;
    justify-content: center;
    align-items: center;
}
.details-left .card-container {
    width: 100%;
    max-width: 200px;
}

.details-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
#detailsName {
    font-family: var(--font-accent);
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-white);
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}
.details-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 1.5rem;
}
.details-meta span {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}
.tag-type { background: var(--color-purple); color: #fff; }
.tag-country { background: rgba(255,255,255,0.08); color: #ccc; }
.tag-no { background: rgba(0, 242, 254, 0.1); color: var(--color-cyan); }

.details-stats h3 {
    font-size: 0.85rem;
    color: #8e95b3;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    letter-spacing: 0.5px;
}

.stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 1.2rem;
}
.stat-box-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem;
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
}
.stat-box-detail .stat-val {
    font-family: var(--font-accent);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-white);
}
.stat-box-detail .stat-lbl {
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 2px;
}

.block-def { border-bottom: 3px solid var(--color-red); }
.block-con { border-bottom: 3px solid var(--color-blue); }
.block-att { border-bottom: 3px solid var(--color-green); }

.ovr-details-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.02);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.ovr-lbl { font-size: 0.9rem; color: #a5adc9; font-weight: 600; }
.ovr-val { font-family: var(--font-accent); font-size: 1.5rem; font-weight: 800; color: var(--color-gold); }

.details-owned-info {
    font-size: 0.9rem;
    color: #a5adc9;
    margin-bottom: 1.5rem;
}

.quick-sell-btn {
    width: 100%;
    background: rgba(255, 56, 56, 0.1);
    border: 1px solid rgba(255, 56, 56, 0.3);
    color: #ff5e57;
    padding: 0.75rem;
    border-radius: 10px;
    font-family: var(--font-accent);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-speed);
}
.quick-sell-btn:hover {
    background: var(--color-red);
    color: #fff;
    border-color: #ff5e57;
}

/* ================== PACK OPENING MODAL & ANIMATIONS ================== */
#packOpeningModal .modal-content,
#packOpeningModal .pack-opening-content {
    width: min(680px, 96vw);
    max-width: 680px;
    min-height: 420px;
    max-height: 92vh;
    height: auto;
    padding: 1rem 1rem 1.15rem;
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;
    box-sizing: border-box;
}

.pack-opening-content {
    background: radial-gradient(circle at center, #141738 0%, #050614 100%);
    max-width: 680px;
    width: min(680px, 96vw);
    min-height: 420px;
    max-height: 92vh;
    height: auto;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 1rem 1.4rem;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

/* ================== PACK OPENING PREVIEW ================== */
.pack-cut-wrapper::before {
    content: '';
    position: absolute;
    inset: -8%;
    border-radius: 24px;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.12) 0%, rgba(255, 255, 255, 0.02) 35%, transparent 70%);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

.pack-cut-wrapper.ripping::before {
    animation: glowBurst 0.9s ease-out forwards;
}

.pack-cut-wrapper.ripping .pack-main-body {
    animation: packPulse 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}


@keyframes glowBurst {
    0%   { opacity: 0; transform: scale(0.8); }
    35%  { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0; transform: scale(1.35); }
}

@keyframes packPulse {
    0%   { transform: scale(1); filter: brightness(1); }
    35%  { transform: scale(1.03) rotate(-1deg); filter: brightness(1.12); }
    70%  { transform: scale(1.06) rotate(1deg); filter: brightness(1.18); }
    100% { transform: scale(0.96) translateY(10px); opacity: 0; }
}



.pack-cut-wrapper {
    position: relative;
    width: min(240px, 72vw);
    height: min(330px, 48vh);
    max-height: 360px;
    flex: 0 0 auto;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}


.pack-main-body {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pack-main-body img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    max-width: 260px;
    max-height: 360px;
}




/* Hint text below the pack preview */
.cut-hint-label {
    position: absolute;
    bottom: -22px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--font-accent);
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(0, 242, 254, 0.75);
    letter-spacing: 0.5px;
    pointer-events: none;
    animation: pulse 1.5s infinite alternate;
}

.pack-sound-hint {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 0.8rem;
    color: #8e95b3;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.3);
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 30;
}

.pack-shine-glare {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(125deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 40%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    border-radius: 16px;
}

@keyframes pulse {
    from { opacity: 0.4; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1.02); }
}

/* REVEAL CONTAINER (FOR REVEALING DRAWN CARDS) */
.reveal-container {
    width: 100%;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: absolute;
    top: 0; left: 0;
    padding: 0.9rem 0.85rem 0.7rem;
    z-index: 20;
    overflow-y: auto;
    scrollbar-width: thin;
    background: radial-gradient(circle at center, rgba(20, 23, 56, 0.95) 0%, rgba(5, 6, 20, 0.99) 100%);
}

.opened-cards-grid {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    perspective: 1000px;
    padding: 0.2rem 0 0.4rem;
}

/* Card deal in animations */
.opened-cards-grid .card-container {
    width: 158px;
    max-width: 26%;
    flex: 0 0 auto;
    opacity: 0;
    transform: translateY(140px) scale(0.35) rotate(10deg);
    animation: dealCard 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes dealCard {
    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0);
    }
}

/* Successive delay in card dealing */
.opened-cards-grid .card-container:nth-child(1) { animation-delay: 0.1s; }
.opened-cards-grid .card-container:nth-child(2) { animation-delay: 0.25s; }
.opened-cards-grid .card-container:nth-child(3) { animation-delay: 0.4s; }
.opened-cards-grid .card-container:nth-child(4) { animation-delay: 0.55s; }
.opened-cards-grid .card-container:nth-child(5) { animation-delay: 0.7s; }
.opened-cards-grid .card-container:nth-child(6) { animation-delay: 0.85s; }
.opened-cards-grid .card-container:nth-child(7) { animation-delay: 1.0s; }

.reveal-actions {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 520px;
    margin-top: 0.75rem;
    transition: opacity 0.5s ease-in-out;
}

/* Flash overlay effect when card is flipped */
.card-flash {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #fff;
    border-radius: 12px;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
}
.card-flash.flash-active {
    animation: cardFlashAnim 0.6s ease-out forwards;
}
@keyframes cardFlashAnim {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Shake effect for epic pulls */
.pack-opening-content.screen-shake {
    animation: shake 0.5s linear;
}
@keyframes shake {
    0%, 100% { transform: translate(0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-4px, 2px); }
    20%, 40%, 60%, 80% { transform: translate(4px, -2px); }
}

/* Spark particle effects generated inside Canvas */
.particle-canvas {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 15;
}

/* ================== MINI SQUAD CARD (on Pitch) ================== */
.mini-squad-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(180deg, #0f1026 0%, #141738 100%);
    border: 2px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.2s;
}
.mini-squad-card:hover {
    transform: scale(0.96);
    border-color: rgba(255, 56, 56, 0.6);
    box-shadow: 0 0 8px rgba(255, 56, 56, 0.3);
}
.mini-squad-card:hover::before {
    content: '×';
    position: absolute;
    top: 0; right: 0; left: 0; bottom: 0;
    background: rgba(255, 56, 56, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    z-index: 20;
}

.mini-squad-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80%;
    object-fit: cover;
    object-position: top center;
}

.mini-squad-ovr {
    position: absolute;
    top: 3px;
    left: 4px;
    font-family: var(--font-accent);
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    background: rgba(0,0,0,0.5);
    border-radius: 3px;
    padding: 1px 3px;
    z-index: 10;
    line-height: 1;
}

.mini-squad-name {
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    text-align: center;
    font-size: 0.55rem;
    font-weight: 800;
    color: #fff;
    background: rgba(10, 11, 28, 0.85);
    padding: 2px 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 10;
}

.mini-squad-card.rarity-special {
    border-color: var(--color-blue);
}
.mini-squad-card.rarity-legendary {
    border-color: var(--color-gold);
    box-shadow: 0 0 6px rgba(255, 189, 3, 0.4);
}

/* ================== UNOWNED / LOCKED CARDS ================== */
.unowned-gray {
    opacity: 0.35;
    filter: grayscale(80%);
    cursor: default;
    pointer-events: none;
}
.unowned-gray:hover .card-inner {
    transform: none !important;
}

/* ================== SELECTOR CARD ITEM ================== */
.selector-card-item {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 12px;
}
.selector-card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 242, 254, 0.2);
}

/* ================== MATCH SETUP SCREEN FLEX FIX ================== */
.match-setup {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ================== RESPONSIVE ADJUSTMENTS ================== */

/* ---- LARGE DESKTOP (min 1200px) ---- */
@media (min-width: 1200px) {
    .packs-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    .bg-glow {
        width: 800px;
        height: 800px;
    }
}

/* ---- TABLET (max 900px) ---- */
@media (max-width: 900px) {
    .packs-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    .squad-layout-container {
        grid-template-columns: 1fr;
    }
    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    }
    .bg-glow {
        width: 500px;
        height: 500px;
    }
}

/* ---- MOBILE LARGE (768px - 640px) ---- */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem 0.75rem;
    }
    .section-header {
        margin-bottom: 1.5rem;
    }
    .section-header h2 {
        font-size: 1.6rem;
    }
    .section-header p {
        font-size: 0.9rem;
    }
}

/* ---- MOBILE (max 640px) ---- */
@media (max-width: 640px) {
    :root {
        --transition-speed: 0.2s;
    }

    body {
        font-size: 14px;
    }

    /* Header */
    .app-header {
        padding: 0.6rem 0.8rem;
        height: 60px;
        gap: 0.5rem;
    }
    .header-left {
        min-width: fit-content;
        flex-shrink: 0;
    }
    .header-center {
        flex: 1;
        display: flex;
        justify-content: center;
        min-width: 120px;
    }
    .header-right {
        display: flex;
        gap: 4px;
        flex-shrink: 0;
    }
    .logo-image {
        max-height: 38px;
    }
    .logo-fallback-text {
        font-size: 1.3rem;
        letter-spacing: 0.5px;
    }
    .currency-container {
        padding: 0.25rem 0.6rem;
        font-size: 0.85rem;
    }
    #fpBalance {
        font-size: 1rem;
    }
    .coin-icon {
        font-size: 1.1rem;
        margin-right: 4px;
    }
    .currency-label {
        font-size: 0.7rem;
    }
    .header-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
        gap: 4px;
        border-radius: 16px;
    }
    .header-btn i {
        font-size: 1rem;
    }
    #dailyRewardText {
        display: none;
    }
    .sound-btn {
        width: 32px;
        height: 32px;
        margin-left: 2px;
    }

    /* Navigation Bar - Horizontal Scroll for mobile */
    .nav-bar {
        gap: 0;
        padding: 0.5rem 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    .nav-bar::-webkit-scrollbar {
        height: 3px;
    }
    .nav-bar::-webkit-scrollbar-thumb {
        background: rgba(0, 242, 254, 0.3);
        border-radius: 2px;
    }
    .nav-tab {
        padding: 0.5rem 1.2rem;
        font-size: 0.75rem;
        gap: 4px;
        border-radius: 0;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .nav-tab i {
        font-size: 0.95rem;
    }

    /* Main Content */
    .main-content {
        padding: 0.8rem 0.6rem;
        max-width: 100%;
    }
    .section-header {
        margin-bottom: 1.2rem;
        padding: 0 0.2rem;
    }
    .section-header h2 {
        font-size: 1.4rem;
        margin-bottom: 0.3rem;
    }
    .section-header p {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    /* Background Glows - Reduced on mobile for better performance */
    .bg-glow {
        width: 300px;
        height: 300px;
        filter: blur(120px);
        opacity: 0.15;
    }

    /* Store / Packs Grid */
    .packs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .pack-card {
        padding: 0.8rem;
        border-radius: 12px;
    }
    .pack-image-container {
        height: 140px;
        margin-bottom: 0.6rem;
        border-radius: 8px;
    }
    .pack-info {
        padding: 0;
    }
    .pack-info h3 {
        font-size: 0.95rem;
        margin-bottom: 0.3rem;
    }
    .pack-desc {
        font-size: 0.7rem;
        line-height: 1.2;
        height: auto;
        margin-bottom: 0.5rem;
    }
    .buy-btn {
        font-size: 0.85rem;
        padding: 0.5rem;
        border-radius: 8px;
    }

    /* Collection */
    .collection-stats-bar {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 0.8rem;
        border-radius: 12px;
    }
    .stat-box {
        padding: 0.8rem;
    }
    .stat-label {
        font-size: 0.75rem;
    }
    .stat-value {
        font-size: 1.1rem;
    }
    .filter-controls {
        gap: 8px;
        flex-wrap: wrap;
        padding: 0.8rem;
    }
    .filter-label {
        font-size: 0.85rem;
    }
    .filter-dropdowns {
        gap: 6px;
        flex-wrap: wrap;
    }
    .select-wrapper {
        flex: 1;
        min-width: 90px;
    }
    .select-wrapper select {
        width: 100%;
        font-size: 0.75rem;
        padding: 0.45rem 1.8rem 0.45rem 0.6rem;
    }
    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    /* Modal General */
    .modal-content {
        max-width: 95vw;
        width: 95vw;
        border-radius: 16px;
        max-height: 95vh;
    }
    .modal-header {
        padding: 1rem 1.2rem 0.8rem;
    }
    .modal-header h3 {
        font-size: 1.2rem;
    }
    .close-modal-btn {
        top: 12px;
        right: 12px;
        font-size: 1.8rem;
    }

    /* Pack Opening Modal */
    #packOpeningModal .modal-content,
    #packOpeningModal .pack-opening-content {
        width: min(540px, 96vw);
        max-width: 540px;
        min-height: 380px;
        height: auto;
        max-height: 92vh;
        border-radius: 20px;
        padding: 0.9rem;
    }

    .pack-opening-content {
        width: min(540px, 96vw);
        min-height: 380px;
        height: auto;
        max-width: 540px;
        max-height: 92vh;
        border-radius: 20px;
        padding: 0.9rem;
    }
    .pack-cut-wrapper {
        width: min(280px, 88vw);
        height: min(380px, 78vh);
    }
    .cut-hint-label {
        font-size: 0.65rem;
        bottom: -20px;
    }
    .cut-scissors-icon {
        font-size: 1rem;
    }
    .pack-sound-hint {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
    .opened-cards-grid {
        gap: 12px;
    }
    .opened-cards-grid .card-container {
        width: 150px;
        max-width: 30%;
    }
    .reveal-actions {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        max-width: 100%;
        width: 100%;
    }
    .reveal-actions button {
        width: 100%;
        font-size: 0.9rem;
        padding: 0.6rem;
    }
    .reveal-container {
        padding: 1rem 0.5rem;
    }

    /* Card Details Modal */
    .card-details-content {
        max-width: 95vw;
    }
    .details-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.2rem;
    }
    .details-left {
        justify-content: center;
    }
    .details-left .card-container {
        max-width: 160px;
    }
    #detailsName {
        font-size: 1.2rem;
    }
    .details-meta {
        gap: 5px;
    }
    .details-meta span {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    .details-stats h3 {
        font-size: 0.8rem;
        margin-bottom: 0.6rem;
    }
    .stats-row {
        gap: 8px;
        margin-bottom: 1rem;
    }
    .stat-box-detail {
        padding: 0.5rem;
    }
    .stat-box-detail .stat-val {
        font-size: 1.2rem;
    }
    .stat-box-detail .stat-lbl {
        font-size: 0.6rem;
    }

    /* Card Selector Modal */
    .card-selector-content {
        max-width: 95vw;
    }
    .selector-filters {
        padding: 0.8rem;
        gap: 8px;
        flex-wrap: wrap;
    }
    .selector-filters input {
        flex: 1;
        min-width: 150px;
        font-size: 0.85rem;
        padding: 0.5rem 0.8rem;
    }
    .selector-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
        padding: 1rem;
        max-height: 60vh;
    }

    /* Squad Builder - Mobile Layout */
    .squad-layout-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .squad-sidebar {
        padding: 1rem;
        order: 2;
    }
    .squad-sidebar h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    .rating-circle {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    #squadRatingValue {
        font-size: 1.8rem;
    }
    .squad-pitch-container {
        padding: 8px;
        order: 1;
    }
    .pitch-row {
        gap: 3%;
    }
    .squad-slot {
        width: 16%;
        aspect-ratio: 1;
    }
    .slot-role {
        font-size: 0.55rem;
    }
    .slot-plus {
        font-size: 0.9rem;
    }
    .action-buttons {
        display: flex;
        gap: 8px;
    }
    .action-btn-primary,
    .action-btn-secondary {
        flex: 1;
        font-size: 0.85rem;
        padding: 0.6rem;
        border-radius: 8px;
    }

    /* Match Screen */
    .match-main-container {
        padding: 0.8rem;
    }
    .setup-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .setup-team {
        padding: 0.8rem;
        border-radius: 12px;
    }
    .setup-badge {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }
    .team-name {
        font-size: 1rem;
    }
    .rating-number {
        font-size: 1.2rem;
    }
    .vs-text {
        font-size: 1.6rem;
    }
    #btnNextOpponent {
        width: 28px;
        height: 28px;
        font-size: 1.4rem;
    }
    .match-start-btn {
        font-size: 1rem;
        padding: 0.7rem 1.5rem;
        width: 100%;
    }
    
    /* Match Simulation */
    .sim-header {
        padding: 0.8rem;
        gap: 8px;
        flex-wrap: wrap;
    }
    .sim-team-info {
        flex: 1;
        min-width: 120px;
    }
    .sim-team-score {
        font-size: 1.4rem;
        padding: 0.1rem 0.6rem;
    }
    .sim-team-name {
        font-size: 0.85rem;
    }
    .sim-timer {
        font-size: 1.2rem;
    }
    .sim-events-log {
        max-height: 50vh;
    }
    .sim-event {
        padding: 0.6rem;
        margin-bottom: 0.6rem;
        font-size: 0.85rem;
    }

    /* Results Screen */
    .match-result-screen {
        padding: 1.5rem 0.8rem;
    }
    .match-result-screen h2 {
        font-size: 2rem;
    }
    .result-score {
        font-size: 2.8rem;
        gap: 10px;
    }
    .result-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    .reward-box {
        max-width: 280px;
        padding: 1.2rem;
    }
    .reward-box h3 {
        font-size: 0.85rem;
    }
    .reward-coins {
        font-size: 1.8rem;
        gap: 8px;
    }
}

/* ---- SMALL MOBILE (max 480px) ---- */
@media (max-width: 480px) {
    .nav-tab {
        padding: 0.45rem 1rem;
        font-size: 0.7rem;
    }
    .packs-grid {
        gap: 8px;
    }
    .pack-card {
        padding: 0.7rem;
    }
    .pack-image-container {
        height: 120px;
        margin-bottom: 0.5rem;
    }
    .pack-info h3 {
        font-size: 0.9rem;
    }
    .pack-desc {
        font-size: 0.65rem;
    }
    .collection-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .select-wrapper {
        min-width: 80px;
    }
    .select-wrapper select {
        font-size: 0.7rem;
    }
    .squad-slot {
        width: 18%;
    }
    .setup-badge {
        width: 45px;
        height: 45px;
        font-size: 1.6rem;
    }
    .match-start-btn {
        font-size: 0.95rem;
        padding: 0.6rem 1.2rem;
    }
    .section-header h2 {
        font-size: 1.2rem;
    }
}

/* ---- EXTRA SMALL (max 380px) ---- */
@media (max-width: 380px) {
    .app-header {
        height: 55px;
    }
    .logo-fallback-text {
        font-size: 1.2rem;
        letter-spacing: 0.2px;
    }
    .currency-container {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
    }
    .header-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }
    .nav-tab {
        padding: 0.4rem 0.9rem;
        font-size: 0.65rem;
    }
    .packs-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .pack-card {
        padding: 0.6rem;
    }
    .collection-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .pack-cut-wrapper {
        width: min(240px, 90vw);
        height: min(330px, 80vh);
    }
    .setup-grid {
        gap: 10px;
    }
    .setup-team {
        padding: 0.6rem;
    }
    .section-header h2 {
        font-size: 1.1rem;
    }
    .section-header p {
        font-size: 0.8rem;
    }
    .squad-pitch-container {
        padding: 4px;
    }
    .pitch-row {
        gap: 2%;
    }
    .modal-content {
        border-radius: 12px;
    }
    .selector-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 10px;
    }
}
