/* ===========================================================
   1. VARIAVEIS E RESET (IDENTIDADE VISUAL GAMER)
   =========================================================== */
:root {
    /* --- CORES PRINCIPAIS --- */
    --primary-neon: #FFD700; /* Amarelo Ouro */
    --primary-neon-dim: rgba(255, 215, 0, 0.5); 
    
    /* Gradientes Especiais */
    --gradient-pink-blue: linear-gradient(to right, #d500f9, #00f3ff);
    --neon-pink: #d500f9;
    --neon-blue: #00f3ff;

    /* Base e Vidro */
    --bg-dark: #050505;
    --glass-bg: rgba(20, 20, 20, 0.85);
    --glass-bg-nav: rgba(10, 10, 10, 0.95);
    --glass-border: rgba(255, 215, 0, 0.3); 
    
    /* Texto e Feedback */
    --text-light: #ffffff;
    --text-gray: #b0b0b0;
    --success-color: #00ff88;
    --error-color: #ff4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Montserrat', sans-serif; }

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    padding-top: 80px;
    padding-bottom: 100px;
    overflow-x: hidden;
    
    /* APP FEEL */
    cursor: default; 
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Elementos Interativos com Mãozinha */
a, button, .nav-item, .modal-btn, .close-btn-header, .edit-photo-wrapper, 
.input-wrapper i, .star-rating, .position-toggle label, 
.option-btn, .photo-upload-wrapper, .fut-card, .roster-item, .select-player-item {
    cursor: pointer;
}

/* ===========================================================
   2. BACKGROUND DINÂMICO (IMERSIVO)
   =========================================================== */
.bg-carousel-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    z-index: -1; background-color: var(--bg-dark);
}

.bg-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.95) 100%);
    z-index: 2; pointer-events: none;
}

.bg-image {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center; background-repeat: no-repeat;
    transition: background-image 0.8s ease-in-out, transform 20s ease;
    filter: blur(2px) brightness(0.8);
    transform: scale(1.05); z-index: 1;
}

/* Classes de Fundo (Integração com JS) */
.bg-image.bg-stadium { background-image: var(--img-stadium); }
.bg-image.bg-studio { background-image: var(--img-studio); background-position: center; filter: blur(1px) brightness(0.9); }
.bg-image.bg-press { background-image: var(--img-press); filter: blur(3px) brightness(0.4) contrast(1.2); }
.bg-image.bg-tactics { background-image: var(--img-tactics); }

/* CLASSE DE FUNDO PARA A TELA DE TIMES */
.bg-image.bg-bus {
    background-image: var(--img-bus); /* Puxa do JS */
    
    /* Fallback (Garantia caso o JS falhe): Imagem de gramado/estádio */
    background-image: url('https://images.unsplash.com/photo-1522778119026-d647f0565c6d?q=80&w=1920&auto=format&fit=crop');
    
    filter: blur(2px) brightness(0.6); /* Ajuste para leitura dos cards */
    background-position: center;
    background-size: cover;
}

/* ===========================================================
   3. TOPBAR (CABEÇALHO)
   =========================================================== */
.app-topbar {
    position: fixed; top: 0; left: 0; width: 100%; height: 70px;
    background: var(--glass-bg-nav); backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px; z-index: 1000; box-shadow: 0 4px 25px rgba(0,0,0,0.7);
}

.brand-area { display: flex; align-items: center; gap: 12px; }
.brand-area .logo-icon { font-size: 1.8rem; color: var(--primary-neon); filter: drop-shadow(0 0 10px var(--primary-neon-dim)); }
.brand-area .logo-text h2 { font-size: 1.1rem; line-height: 1; font-weight: 700; text-transform: uppercase; margin: 0; color: #fff;}
.brand-area .logo-text span { font-size: 0.75rem; color: var(--primary-neon); letter-spacing: 2px; text-transform: uppercase; }

.user-profile-widget {
    display: flex; align-items: center; gap: 15px; padding: 5px 10px;
    background: rgba(255, 255, 255, 0.03); border-radius: 30px; border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}
.user-profile-widget:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--primary-neon); box-shadow: 0 0 15px var(--primary-neon-dim); }
.user-info { text-align: right; display: flex; flex-direction: column; }
.user-name { font-size: 0.9rem; font-weight: 600; }
.user-role { font-size: 0.7rem; color: var(--text-gray); }
.user-avatar { position: relative; width: 40px; height: 40px; }
.user-avatar img { width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--primary-neon); object-fit: cover; box-shadow: 0 0 10px var(--primary-neon-dim); }
.settings-btn { background: none; border: none; color: var(--text-gray); font-size: 1.1rem; cursor: pointer; padding-left: 10px; border-left: 1px solid rgba(255,255,255,0.1); margin-left: 5px; }
.settings-btn:hover { color: var(--primary-neon); transform: rotate(90deg); text-shadow: 0 0 10px var(--primary-neon); }

/* ===========================================================
   4. LAYOUT GERAL E CARDS
   =========================================================== */
.main-content {
    width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px;
    animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

.glass-card {
    background: var(--glass-bg); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 15px; padding: 1.5rem; box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); position: relative; overflow: hidden;
}
.glass-card:hover { 
    transform: translateY(-5px) scale(1.02); border-color: var(--primary-neon); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 20px var(--primary-neon-dim);
}
.glass-card::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
    transform: skewX(-25deg); transition: 0.5s;
}
.glass-card:hover::before { left: 150%; }

.stat-card { position: relative; display: flex; flex-direction: column; justify-content: space-between; }
.stat-card .card-icon { position: absolute; top: 1rem; right: 1rem; font-size: 2.5rem; color: rgba(255,255,255,0.03); transition: 0.3s; }
.glass-card:hover .card-icon { color: rgba(255, 215, 0, 0.1); transform: scale(1.1) rotate(-10deg); }
.stat-card h3 { font-size: 2.2rem; margin-bottom: 5px; color: var(--text-light); text-shadow: 0 0 10px rgba(0,0,0,0.5); }
.stat-card p { color: var(--text-gray); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }

.wide-panel { grid-column: span 3; }
.panel-header { display: flex; justify-content: space-between; margin-bottom: 1rem; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.match-item { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.03); padding: 1rem; border-radius: 12px; margin-bottom: 10px; border: 1px solid transparent; transition: 0.3s; }
.match-item:hover { border-color: var(--neon-blue); background: rgba(0, 243, 255, 0.05); box-shadow: 0 0 15px rgba(0, 243, 255, 0.1); }
.team-home, .team-away { flex: 1; font-weight: bold; }
.team-home { text-align: right; }
.match-vs { padding: 0 15px; color: var(--primary-neon); font-weight: 800; text-shadow: 0 0 10px var(--primary-neon-dim); }

/* ===========================================================
   5. FOOTBAR (MENU INFERIOR)
   =========================================================== */
.app-footbar {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 75px;
    background: var(--glass-bg-nav); backdrop-filter: blur(20px); z-index: 1000;
    display: flex; justify-content: space-around; align-items: center; padding-bottom: 5px;
    border-top: 2px solid transparent; border-image: var(--gradient-pink-blue) 1;
    box-shadow: 0 -5px 30px rgba(0, 243, 255, 0.2);
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-decoration: none; color: var(--text-gray); gap: 5px; width: 20%; height: 100%; transition: all 0.3s ease;
}
.nav-item i { font-size: 1.4rem; transition: 0.3s; margin-bottom: 2px; }
.nav-item span { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.nav-item.active, .nav-item:hover { color: #fff; }
.nav-item.active i, .nav-item:hover i {
    transform: translateY(-6px) scale(1.1); background: var(--gradient-pink-blue);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(213, 0, 249, 0.8)); animation: pulseNeon 2s infinite alternate;
}
@keyframes pulseNeon {
    from { filter: drop-shadow(0 0 10px rgba(213, 0, 249, 0.6)); transform: translateY(-6px) scale(1); }
    to { filter: drop-shadow(0 0 25px rgba(0, 243, 255, 0.9)); transform: translateY(-6px) scale(1.1); }
}

/* ===========================================================
   6. MENUS FLUTUANTES (POPUPS)
   =========================================================== */
.float-menu {
    position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) scale(0.8) translateY(20px);
    width: 90%; max-width: 350px; background: rgba(15, 15, 15, 0.98); backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 20px; padding: 20px;
    box-shadow: 0 0 40px rgba(0,0,0,0.9), inset 0 0 0 1px rgba(213, 0, 249, 0.5);
    opacity: 0; visibility: hidden; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); z-index: 999;
}
.float-menu.show { opacity: 1; visibility: visible; transform: translateX(-50%) scale(1) translateY(0); }
.float-header {
    text-align: center; margin-bottom: 20px; font-size: 1rem; color: var(--text-light);
    text-transform: uppercase; letter-spacing: 2px; font-weight: 800;
    text-shadow: 0 0 10px rgba(213, 0, 249, 0.5);
}
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.menu-option {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)); 
    padding: 20px; border-radius: 15px; text-decoration: none; color: var(--text-light); 
    border: 1px solid rgba(255, 255, 255, 0.05); transition: 0.3s; position: relative; overflow: hidden;
}
.menu-option i { font-size: 1.8rem; margin-bottom: 10px; color: var(--neon-blue); transition: 0.3s; }
.menu-option span { font-size: 0.85rem; font-weight: 700; }
.menu-option:hover {
    border-color: var(--neon-pink); box-shadow: 0 0 25px rgba(213, 0, 249, 0.3); transform: translateY(-3px);
}
.menu-option:hover i { color: var(--neon-pink); text-shadow: 0 0 15px var(--neon-pink); transform: scale(1.1); }

/* ===========================================================
   7. FORMULÁRIOS E INPUTS
   =========================================================== */
.input-game-group { margin-bottom: 20px; }
.input-game-group label { display: block; font-size: 0.8rem; text-transform: uppercase; color: var(--primary-neon); margin-bottom: 8px; font-weight: 700; }
.input-wrapper { position: relative; }
.input-wrapper i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-gray); transition: 0.3s; }
.input-wrapper input {
    width: 100%; padding: 15px 15px 15px 45px; background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; color: #fff; font-size: 1rem; transition: 0.3s; cursor: text;
}
.input-wrapper input:focus { outline: none; border-color: var(--primary-neon); background: rgba(0,0,0,0.8); box-shadow: 0 0 15px var(--primary-neon-dim); }
.input-wrapper input:focus + i { color: var(--primary-neon); }

.row-dupla { display: flex; gap: 15px; }
.row-dupla > div { flex: 1; }

.position-toggle { display: flex; background: rgba(0,0,0,0.6); border-radius: 10px; padding: 5px; border: 1px solid rgba(255,255,255,0.1); }
.position-toggle input { display: none; }
.toggle-btn { flex: 1; text-align: center; padding: 10px; border-radius: 8px; color: var(--text-gray); font-size: 0.9rem; transition: 0.3s; font-weight: 600; }
input:checked + label { background: var(--primary-neon); color: #000; box-shadow: 0 0 10px var(--primary-neon-dim); }
input[value="GOLEIRO"]:checked + label { background: var(--error-color); color: #fff; box-shadow: 0 0 10px rgba(255,68,68,0.4); }

.star-rating { display: flex; gap: 10px; font-size: 1.5rem; }
.star-rating i { transition: 0.2s; color: #333; }

.btn-game-save {
    width: 100%; padding: 18px; margin-top: 10px; background: linear-gradient(45deg, var(--neon-pink), var(--neon-blue));
    border: none; border-radius: 12px; color: #fff; font-size: 1rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
    box-shadow: 0 5px 20px rgba(213, 0, 249, 0.4); transition: 0.3s;
}
.btn-game-save:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 30px rgba(0, 243, 255, 0.6); }

/* Upload de Foto (Jogador/Time) */
.photo-upload-wrapper { display: flex; justify-content: center; margin-bottom: 25px; }
.photo-preview {
    width: 120px; height: 120px; border-radius: 50%; background: rgba(0,0,0,0.5);
    border: 2px dashed var(--text-gray); display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: 0.3s; overflow: hidden;
}
.photo-preview:hover { border-color: var(--primary-neon); box-shadow: 0 0 20px var(--primary-neon-dim); transform: scale(1.05); }
.photo-preview i { font-size: 2rem; color: var(--text-gray); margin-bottom: 5px; }
.photo-preview span { font-size: 0.7rem; color: var(--text-gray); text-transform: uppercase; }

/* Divisória Neon */
.form-divider {
    height: 1px; width: 100%;
    background: linear-gradient(to right, transparent, var(--primary-neon), transparent);
    margin: 20px 0; opacity: 0.5;
}

/* ===========================================================
   8. MODALS & EXTRAS (UI COMPONENTS)
   =========================================================== */
.close-btn-header {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 1px solid rgba(255, 68, 68, 0.3); background: rgba(255, 68, 68, 0.1); transition: 0.3s; color: #ff4444;
}
.close-btn-header:hover { background: #ff4444; box-shadow: 0 0 15px #ff4444; border-color: #ff4444; color: #fff; }

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px); z-index: 2000; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-box {
    background: rgba(20, 20, 20, 0.95); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 20px;
    padding: 30px; width: 90%; max-width: 400px; text-align: center;
    transform: scale(0.8); transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 0 40px rgba(0,0,0,0.8);
}
.modal-overlay.active .modal-box { transform: scale(1); }

.modal-icon { font-size: 4rem; margin-bottom: 20px; display: block; }
.modal-title { font-size: 1.5rem; color: #fff; margin-bottom: 10px; text-transform: uppercase; font-weight: 800; }
.modal-msg { color: var(--text-gray); font-size: 1rem; margin-bottom: 25px; line-height: 1.5; }

.spin-ball { color: rgba(255, 255, 255, 0.3); animation: spin 1.5s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.icon-success { color: var(--success-color); text-shadow: 0 0 20px var(--success-color); }
.icon-warning { color: var(--primary-neon); text-shadow: 0 0 20px var(--primary-neon); }

.modal-btn {
    padding: 12px 30px; border: none; border-radius: 50px; font-weight: bold; text-transform: uppercase;
    background: linear-gradient(45deg, var(--text-gray), #555); color: #fff; transition: 0.3s;
}
.modal-btn.btn-success { background: var(--success-color); color: #000; box-shadow: 0 0 15px rgba(0, 255, 136, 0.4); }
.modal-btn.btn-warning { background: var(--primary-neon); color: #000; box-shadow: 0 0 15px var(--primary-neon-dim); }
.modal-btn:hover { transform: scale(1.05); filter: brightness(1.2); }

/* ===========================================================
   9. PLANTEL DE JOGADORES (CARD STYLE FIFA)
   =========================================================== */
.squad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); 
    gap: 25px; padding-bottom: 90px;
}

.fut-card {
    position: relative;
    background: linear-gradient(160deg, #1e1e1e 0%, #0d0d0d 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px; overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.6);
    display: flex; flex-direction: column;
}
.fut-card:hover {
    transform: translateY(-12px) scale(1.05);
    border-color: var(--primary-neon);
    box-shadow: 0 15px 30px rgba(0,0,0,0.8), 0 0 20px var(--primary-neon-dim), inset 0 0 10px rgba(255, 215, 0, 0.2);
    z-index: 10;
}

.card-header {
    position: absolute; top: 0; left: 0; width: 100%; height: 40px;
    display: flex; justify-content: space-between; padding: 8px; z-index: 5;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}
.card-rating { font-size: 1.1rem; font-weight: 900; color: var(--primary-neon); text-shadow: 0 0 5px var(--primary-neon); }
.card-position { font-size:0.7rem; background:rgba(0,0,0,0.5); padding:2px 4px; border-radius:3px; color: #fff; height: fit-content;}

.card-image-container {
    height: 190px; width: 100%; position: relative;
    background: radial-gradient(circle at 50% 30%, #333 0%, #000 80%);
}
.card-image {
    width: 100%; height: 100%; object-fit: cover;
    mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
    transition: 0.4s;
}
.fut-card:hover .card-image { transform: scale(1.1); filter: contrast(1.1); }

.card-info { position: relative; padding: 10px; text-align: left; height: 60px; }
.card-name {
    font-size: 0.8rem; font-weight: 800; color: #fff;
    text-transform: uppercase; letter-spacing: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; z-index: 2;
}

/* Ícone Luva (Goleiro) */
.glove-icon {
    position: absolute; bottom: 8px; left: 10px; font-size: 1.4rem; color: #fff;
    filter: drop-shadow(0 0 5px var(--primary-neon)); animation: floatGlove 3s ease-in-out infinite; z-index: 3;
}
@keyframes floatGlove { 0%,100%{transform:translateY(0) rotate(0deg);} 50%{transform:translateY(-3px) rotate(-10deg);} }

/* Número Gigante */
.card-number-big {
    position: absolute; bottom: -8px; right: 5px;
    font-size: 3.5rem; font-weight: 900; font-family: 'Montserrat', sans-serif;
    color: rgba(255, 255, 255, 0.08); line-height: 1; z-index: 1; transition: 0.3s;
}
.fut-card:hover .card-number-big {
    color: var(--primary-neon); opacity: 0.8;
    transform: scale(1.1) translateX(-5px); text-shadow: 0 0 20px var(--primary-neon);
}

/* Edição de Foto no Modal */
.edit-photo-wrapper {
    position: relative; width: 100px; height: 100px; margin: 0 auto 20px;
    border-radius: 50%; overflow: hidden;
    border: 3px solid var(--primary-neon); box-shadow: 0 0 15px var(--primary-neon-dim);
}
.edit-photo-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.edit-photo-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: 0.3s;
}
.edit-photo-wrapper:hover .edit-photo-overlay { opacity: 1; }
.edit-photo-overlay i { font-size: 1.5rem; color: #fff; }

.btn-delete {
    background: rgba(255, 68, 68, 0.1); border: 1px solid #ff4444; color: #ff4444;
    padding: 10px 20px; border-radius: 50px; font-weight: bold; transition: 0.3s;
}
.btn-delete:hover { background: #ff4444; color: #fff; box-shadow: 0 0 15px #ff4444; }

/* ===========================================================
   10. CRIADOR DE ESCUDOS (CREST BUILDER)
   =========================================================== */
.crest-preview-container {
    width: 150px; height: 150px; margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
    position: relative; filter: drop-shadow(0 0 15px rgba(0,0,0,0.5)); transition: 0.3s;
}

.crest-shape {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 0; left: 0;
    overflow: hidden; 
    background: linear-gradient(135deg, var(--cor1, #333), var(--cor2, #000));
    border: 4px solid #fff; box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

/* Formatos de Escudo */
.shape-round { border-radius: 50%; } 
.shape-shield { border-radius: 0 0 50% 50%; clip-path: polygon(0 0, 100% 0, 100% 80%, 50% 100%, 0 80%); }
.shape-pentagon { clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%); }

/* Mascote */
.crest-mascot {
    font-size: 5rem; color: #fff; z-index: 2;
    filter: drop-shadow(0 4px 5px rgba(0,0,0,0.8));
    transition: 0.3s;
}
.crest-mascot.emerging { transform: scale(1.3) translateY(-10px); }

/* Opções de Customização */
.builder-options {
    display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 15px;
    scrollbar-width: thin; scrollbar-color: var(--primary-neon) transparent;
}
.option-btn {
    min-width: 50px; height: 50px; border-radius: 10px;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.2rem; transition: 0.2s;
}
.option-btn:hover, .option-btn.selected {
    background: var(--primary-neon); color: #000; border-color: var(--primary-neon);
    box-shadow: 0 0 10px var(--primary-neon-dim);
}

.color-picker-group { display: flex; gap: 10px; justify-content: center; margin-bottom: 15px; }
.color-input {
    width: 40px; height: 40px; border: none; border-radius: 50%;
    cursor: pointer; overflow: hidden; padding: 0;
}
.color-input::-webkit-color-swatch { border: none; border-radius: 50%; border: 2px solid #fff; }

/* =========================================
   11. GALERIA DE TIMES (TEAM CARDS) - NOVO
   ========================================= */

/* O Card do Time */
.team-card {
    position: relative;
    background: linear-gradient(145deg, rgba(20,20,20,0.9), rgba(10,10,10,0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    overflow: hidden;
}

/* Hover: O Card brilha */
.team-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

/* Área do Escudo no Card */
.team-crest-area {
    width: 100px; height: 100px;
    margin-bottom: 15px;
    position: relative;
    display: flex; align-items: center; justify-content: center;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.6));
    transition: 0.3s;
}
.team-card:hover .team-crest-area { transform: scale(1.1); }

/* Imagem Uploaded */
.team-crest-img {
    width: 100%; height: 100%; object-fit: contain;
}

/* Escudo Customizado (Miniatura) */
.mini-crest-shape {
    width: 100%; height: 100%;
    position: absolute; top: 0; left: 0;
    display: flex; align-items: center; justify-content: center;
    border: 3px solid #fff;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    overflow: hidden; 
}
.mini-crest-mascot {
    font-size: 3rem; color: #fff; z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

/* Nome do Time */
.team-name {
    font-size: 1rem; font-weight: 800; color: #fff;
    text-transform: uppercase; text-align: center;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    z-index: 2;
}

/* Fundo decorativo com as cores do time */
.team-card-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at top right, var(--bg-color-1), transparent 70%);
    opacity: 0.2; z-index: 0; transition: 0.3s;
}
.team-card:hover .team-card-bg { opacity: 0.4; }

/* 12. EXTRAS FINAIS (Ônibus e Roster) */

/* Contador de Jogadores no Card */
.team-player-count {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(0,0,0,0.7);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem; font-weight: bold; color: #fff;
    display: flex; align-items: center; gap: 5px;
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.team-player-count i { color: var(--primary-neon); }

/* Lista de Jogadores no Modal (Roster) */
.roster-list {
    max-height: 350px; overflow-y: auto;
    margin-top: 20px; padding-right: 5px; text-align: left;
}
.roster-list::-webkit-scrollbar { width: 5px; }
.roster-list::-webkit-scrollbar-thumb { background: var(--primary-neon); border-radius: 5px; }

.roster-item {
    display: flex; align-items: center; gap: 15px;
    padding: 12px; background: rgba(255,255,255,0.05);
    border-radius: 12px; margin-bottom: 8px;
    border: 1px solid transparent; transition: 0.2s; cursor: pointer;
}
.roster-item:hover {
    border-color: var(--primary-neon);
    background: rgba(255, 215, 0, 0.1);
    transform: translateX(5px);
}

.roster-img {
    width: 45px; height: 45px; border-radius: 50%;
    object-fit: cover; border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.roster-info { flex: 1; }
.roster-name { font-weight: 700; color: #fff; font-size: 0.95rem; text-transform: uppercase; }
.roster-pos { font-size: 0.75rem; color: var(--text-gray); }

.roster-num {
    font-size: 1.4rem; font-weight: 900;
    color: var(--primary-neon);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Responsividade */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .wide-panel { grid-column: span 2; }
}
@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .wide-panel { grid-column: span 1; }
    .user-info, .logo-text { display: none; }
    .brand-area .logo-icon { font-size: 2.2rem; }
}

/* CLASSE DE FUNDO PARA A TELA DE TIMES */
.bg-image.bg-bus {
    /* Tenta carregar do JS primeiro */
    background-image: var(--img-bus); 
    
    /* SE FALHAR, usa essa imagem direto (Garantia) */
    background-image: url('https://images.unsplash.com/photo-1522778119026-d647f0565c6d?q=80&w=1920&auto=format&fit=crop');
    
    filter: blur(2px) brightness(0.6); 
    background-position: center;
    background-size: cover;
}


/* Botão Remover Jogador (X) no Roster */
.remove-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
    color: #ff4444;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    margin-left: auto; /* Empurra para a direita */
}
.remove-btn:hover {
    background: #ff4444; color: #fff;
    box-shadow: 0 0 10px #ff4444;
}

/* Modal Mercado (Select List) */
.select-player-item {
    display: flex; align-items: center; gap: 10px; padding: 10px;
    background: rgba(255,255,255,0.05); border-radius: 8px; margin-bottom: 5px; cursor: pointer; border: 1px solid transparent;
}
.select-player-item:hover { background: rgba(255,255,255,0.1); }
.select-player-item.selected { border-color: var(--success-color); background: rgba(0,255,136,0.1); }
.select-player-item img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }


/* =========================================
   13. BARRA DE PESQUISA (SEARCH BAR)
   ========================================= */
.search-container {
    margin-bottom: 20px;
    position: relative;
    max-width: 400px;
    margin-left: auto; margin-right: auto;
}

.search-input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 1rem;
    transition: 0.3s;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-neon);
    box-shadow: 0 0 15px var(--primary-neon-dim);
    background: rgba(0, 0, 0, 0.9);
}

.search-icon {
    position: absolute;
    left: 20px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    font-size: 1.2rem;
    transition: 0.3s;
}

.search-input:focus + .search-icon {
    color: var(--primary-neon);
}

/* ... (Mantenha todo o CSS anterior igual) ... */

/* =========================================
   13. BARRA DE PESQUISA (SEARCH BAR)
   ========================================= */
.search-container {
    margin-bottom: 20px;
    position: relative;
    max-width: 400px;
    margin-left: auto; margin-right: auto;
    z-index: 10;
}

.search-input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 1rem;
    transition: 0.3s;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-neon);
    box-shadow: 0 0 15px var(--primary-neon-dim);
    background: rgba(0, 0, 0, 0.9);
}

.search-icon {
    position: absolute;
    left: 20px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    font-size: 1.2rem;
    transition: 0.3s;
}

.search-input:focus + .search-icon {
    color: var(--primary-neon);
}

/* =========================================
   14. WIZARD DE CRIAÇÃO DE TORNEIO
   ========================================= */
.wizard-container {
    position: relative;
    overflow: hidden;
    min-height: 400px; /* Altura fixa para transição suave */
}

.wizard-step {
    display: none;
    animation: fadeIn 0.5s ease;
}
.wizard-step.active { display: block; }

/* Cards de Seleção de Tipo */
.type-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}
.type-card:hover, .type-card.selected {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--primary-neon);
    transform: translateY(-5px);
    box-shadow: 0 0 20px var(--primary-neon-dim);
}
.type-icon { font-size: 3rem; margin-bottom: 10px; color: var(--text-gray); transition: 0.3s; }
.type-card:hover .type-icon, .type-card.selected .type-icon { color: var(--primary-neon); }
.type-title { font-weight: 800; text-transform: uppercase; font-size: 1rem; color: #fff; margin-bottom: 5px; }
.type-desc { font-size: 0.75rem; color: var(--text-gray); line-height: 1.4; }

/* Grid de Tipos */
.types-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 20px;
}
@media(max-width: 600px) { .types-grid { grid-template-columns: 1fr; } }

/* Botões de Navegação */
.wizard-nav {
    display: flex; justify-content: space-between; margin-top: 20px;
}

/* =========================================
   15. GALERIA DE TORNEIOS
   ========================================= */
.tournament-card {
    background: linear-gradient(160deg, #1a1a1a 0%, #050505 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 0; overflow: hidden;
    transition: 0.3s; cursor: pointer;
    position: relative;
}
.tournament-card:hover {
    border-color: var(--neon-blue);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 243, 255, 0.2);
}

.t-card-header {
    height: 100px;
    background-size: cover; background-position: center;
    position: relative;
    display: flex; align-items: flex-end; padding: 10px;
}
.t-card-overlay {
    position: absolute; top:0; left:0; width:100%; height:100%;
    background: linear-gradient(to top, #000 10%, transparent);
}
.t-type-badge {
    position: absolute; top: 10px; right: 10px;
    background: rgba(0,0,0,0.8); color: var(--primary-neon);
    padding: 3px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: bold;
    border: 1px solid var(--primary-neon);
}

.t-card-body { padding: 15px; }
.t-title { font-size: 1.1rem; font-weight: 800; color: #fff; margin-bottom: 5px; text-transform: uppercase; }
.t-info { font-size: 0.8rem; color: var(--text-gray); display: flex; justify-content: space-between; }
.t-status { color: var(--success-color); font-weight: bold; font-size: 0.7rem; text-transform: uppercase; }


.bg-image.bg-trophy { background-image: var(--img-trophy); filter: blur(3px) brightness(0.5); background-position: center; }


/* ... (CSS anterior) ... */

/* =========================================
   16. CORES VIVAS DO WIZARD (ICONS)
   ========================================= */
/* Liga (Amarelo/Ouro) */
.type-card.type-liga .type-icon { color: #FFD700; filter: drop-shadow(0 0 5px #FFD700); }
.type-card.type-liga:hover { border-color: #FFD700; box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }

/* Copa (Azul Cyan) */
.type-card.type-copa .type-icon { color: #00f3ff; filter: drop-shadow(0 0 5px #00f3ff); }
.type-card.type-copa:hover { border-color: #00f3ff; box-shadow: 0 0 15px rgba(0, 243, 255, 0.4); }

/* Mata-Mata (Vermelho/Laranja) */
.type-card.type-mata .type-icon { color: #ff4444; filter: drop-shadow(0 0 5px #ff4444); }
.type-card.type-mata:hover { border-color: #ff4444; box-shadow: 0 0 15px rgba(255, 68, 68, 0.4); }

/* Manual (Verde) */
.type-card.type-manual .type-icon { color: #00ff88; filter: drop-shadow(0 0 5px #00ff88); }
/* Calendário (Roxo) */
.type-card.type-auto .type-icon { color: #d500f9; filter: drop-shadow(0 0 5px #d500f9); }

/* =========================================
   17. SELETOR DE TROFÉUS (PASSO 2)
   ========================================= */
.trophy-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 10px;
}
.trophy-option {
    height: 60px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.3s;
    font-size: 1.8rem;
}
.trophy-option:hover, .trophy-option.selected {
    background: rgba(255,255,255,0.1);
    transform: scale(1.1);
    border-color: var(--selected-color, #fff);
    box-shadow: 0 0 15px var(--selected-color, rgba(255,255,255,0.5));
}
.trophy-option i {
    color: var(--selected-color, #888);
    transition: 0.3s;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
}

/* =========================================
   18. SEARCH BAR (PADRÃO)
   ========================================= */
.search-container {
    margin-bottom: 20px; position: relative; max-width: 400px;
    margin-left: auto; margin-right: auto; z-index: 10;
}
.search-input {
    width: 100%; padding: 15px 20px 15px 50px;
    border-radius: 30px; border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(20, 20, 20, 0.8); backdrop-filter: blur(10px);
    color: #fff; font-size: 1rem; transition: 0.3s; outline: none;
}
.search-input:focus { border-color: var(--primary-neon); box-shadow: 0 0 15px var(--primary-neon-dim); background: rgba(0, 0, 0, 0.9); }
.search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--text-gray); font-size: 1.2rem; }
.search-input:focus + .search-icon { color: var(--primary-neon); }


/* ... (Mantenha o CSS anterior) ... */

/* =========================================
   19. PREVIEW DO TORNEIO (PASSO 4)
   ========================================= */

/* Tabela de Liga / Grupos */
.preview-table-container {
    overflow-x: auto;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    color: #fff;
    min-width: 600px; /* Garante scroll em telas pequenas */
}

.preview-table th {
    background: rgba(255, 215, 0, 0.1); /* Dourado fraco */
    color: var(--primary-neon);
    padding: 10px;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.preview-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-align: center;
}

.preview-table tr:hover {
    background: rgba(255,255,255,0.05);
}

.col-team { text-align: left !important; width: 30%; font-weight: bold; }
.col-pos { width: 50px; font-weight: 900; color: var(--text-gray); }

/* Critérios de Desempate (Box) */
.rules-box {
    background: rgba(0, 243, 255, 0.05);
    border-left: 3px solid var(--neon-blue);
    padding: 10px;
    margin-top: 15px;
    font-size: 0.8rem;
    color: var(--text-gray);
    text-align: left;
}
.rules-box strong { color: #fff; text-transform: uppercase; }

/* Grid de Grupos (Copa) */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.group-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
}
.group-header {
    background: rgba(255,255,255,0.1);
    padding: 5px 10px;
    font-weight: bold;
    color: var(--primary-neon);
    text-align: center;
    font-size: 0.9rem;
}

/* Árvore Mata-Mata (Simples) */
.bracket-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    overflow-x: auto;
    padding: 20px 0;
}
.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 20px;
}
.bracket-match {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 5px;
    padding: 5px 10px;
    width: 120px;
    text-align: center;
    font-size: 0.7rem;
    color: #aaa;
    position: relative;
}
/* Linhas de conexão (Simuladas) */
.bracket-match::after {
    content: ''; position: absolute; top: 50%; right: -10px;
    width: 10px; height: 1px; background: rgba(255,255,255,0.2);
}
.bracket-round:last-child .bracket-match::after { display: none; }


/* =========================================
   19. PAINEL DE TORNEIO (HEADER E TABELAS) - CORRIGIDO
   ========================================= */

/* Ajuste para Modal Full (Ver Torneio) com Scroll Inteligente */
.modal-box.modal-full {
    max-width: 950px;
    width: 95%;
    height: 90vh; /* Ocupa 90% da altura da tela */
    padding: 0;
    background: rgba(15, 15, 15, 0.98);
    display: flex;       /* Flex para fixar o header */
    flex-direction: column;
    overflow: hidden;    /* Esconde scroll externo */
}

/* Área de Conteúdo com Scroll (Barra Lateral) */
.modal-content-pad {
    padding: 20px;
    overflow-y: auto; /* A barra aparece aqui se precisar */
    flex: 1;          /* Ocupa o espaço restante */
    
    /* Estilizando a barra de rolagem */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-neon) #222;
}
/* Scrollbar para Webkit (Chrome/Edge) */
.modal-content-pad::-webkit-scrollbar { width: 8px; }
.modal-content-pad::-webkit-scrollbar-track { background: #222; }
.modal-content-pad::-webkit-scrollbar-thumb { background: var(--primary-neon); border-radius: 4px; }


/* Cabeçalho do Painel (Big Header) */
.tournament-header-big {
    background: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.6));
    padding: 30px 20px;
    text-align: center;
    position: relative;
    border-bottom: 2px solid var(--primary-neon);
    flex-shrink: 0; /* Impede que o header encolha */
}

.th-trophy-icon {
    font-size: 3.5rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.2));
}

.th-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 0 4px 10px rgba(0,0,0,0.8);
}

.th-subtitle {
    font-size: 0.8rem;
    color: var(--primary-neon);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* --- BOTÕES POSICIONADOS CORRETAMENTE --- */

/* Botão Fechar (X) -> CANTO SUPERIOR DIREITO */
.close-btn-fixed {
    position: absolute;
    top: 20px; 
    right: 20px; /* Direita */
    width: 40px; height: 40px;
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid #ff4444;
    border-radius: 50%;
    color: #ff4444;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    z-index: 200;
}
.close-btn-fixed:hover { background: #ff4444; color: #fff; box-shadow: 0 0 15px #ff4444; }

/* Botão de Regras (?) -> CANTO SUPERIOR ESQUERDO */
.rules-trigger {
    position: absolute;
    top: 20px; 
    left: 20px; /* Esquerda (Separado do X) */
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    z-index: 200;
}
.rules-trigger:hover {
    background: var(--primary-neon);
    color: #000;
    box-shadow: 0 0 15px var(--primary-neon-dim);
}

/* Popover das Regras (Abre na Esquerda agora) */
.rules-popover {
    display: none;
    position: absolute;
    top: 70px; 
    left: 20px; /* Alinhado com o botão ? */
    width: 280px;
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid var(--primary-neon);
    padding: 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #ccc;
    text-align: left;
    z-index: 300;
    box-shadow: 0 10px 40px rgba(0,0,0,1);
    backdrop-filter: blur(10px);
}
.rules-popover.active { display: block; animation: fadeIn 0.3s ease; }
.rules-popover strong { color: var(--primary-neon); display: block; margin-bottom: 10px; font-size: 0.9rem; }

/* Tabela Profissional (Big Table) */
.responsive-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: rgba(0,0,0,0.4);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    margin-bottom: 30px;
}

.big-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px; /* Garante largura no mobile */
}

.big-table th {
    background: rgba(255,255,255,0.05);
    color: var(--text-gray);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 15px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    white-space: nowrap;
}
.big-table th.th-left { text-align: left; padding-left: 20px; position: sticky; left: 0; background: #1a1a1a; z-index: 2; }

.big-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
}
.big-table td.td-left { 
    text-align: left; padding-left: 20px; font-weight: 600; 
    display: flex; align-items: center; gap: 10px;
    position: sticky; left: 0; background: #111; z-index: 2; /* Fixa a coluna do time */
    border-right: 1px solid rgba(255,255,255,0.1);
}

/* Destaques */
.pos-rank {
    width: 25px; height: 25px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem; font-weight: 900;
}
.rank-1 { background: #FFD700; color: #000; box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
.rank-2 { background: #C0C0C0; color: #000; }
.rank-3 { background: #CD7F32; color: #000; }

.val-pts { font-weight: 900; color: var(--primary-neon); font-size: 1rem; }
.val-bad { color: #ff4444; }
.val-warn { color: #ffee00; }


/* ... (Mantenha todo o CSS anterior) ... */

/* =========================================
   20. ESTILO COPA (GRUPOS + MATA-MATA)
   ========================================= */

/* Título das Fases */
.phase-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-neon);
    text-transform: uppercase;
    margin: 30px 0 15px 0;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    position: relative;
    display: inline-block;
    width: 100%;
}
.phase-title::after {
    content: ''; display: block; width: 50px; height: 3px; 
    background: var(--primary-neon); margin: 5px auto 0 auto;
    box-shadow: 0 0 10px var(--primary-neon);
}

/* Grid de Grupos */
.copa-groups-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Responsivo */
    gap: 20px;
    padding: 10px;
}

/* Card do Grupo Individual */
.group-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: 0.3s;
}
.group-card:hover {
    border-color: rgba(0, 243, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.group-header {
    background: rgba(255,255,255,0.05);
    padding: 8px;
    text-align: center;
    font-weight: 900;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

/* Mini Tabela (Para os Grupos) */
.mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    color: #ccc;
}
.mini-table th {
    text-align: center;
    padding: 5px;
    color: var(--text-gray);
    font-weight: normal;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.mini-table td {
    padding: 6px 5px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}
.mini-table tr:nth-child(-n+2) td:nth-child(1) { /* Primeiros 2 classificados */
    color: var(--success-color);
    font-weight: bold;
    border-left: 2px solid var(--success-color);
}

/* Divisória de Fase (Seta Neon) */
.phase-divider {
    text-align: center;
    margin: 30px 0;
    font-size: 2rem;
    color: var(--text-gray);
    animation: bounce 2s infinite;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}


/* ... (CSS anterior) ... */

/* =========================================
   21. SELEÇÃO DE TIMES (PASSO 4)
   ========================================= */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.team-slot {
    height: 160px;
    background: rgba(255,255,255,0.02);
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

/* Slot Vazio */
.team-slot.empty:hover {
    border-color: var(--success-color);
    background: rgba(0, 255, 136, 0.05);
}
.team-slot.empty i {
    font-size: 2rem;
    color: rgba(255,255,255,0.2);
    margin-bottom: 5px;
}
.team-slot.empty span {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
}

/* Slot Preenchido */
.team-slot.filled {
    border: 1px solid var(--primary-neon);
    background: linear-gradient(135deg, rgba(20,20,20,0.9), rgba(50,50,50,0.5));
    border-style: solid;
}
.team-slot.filled img {
    width: 60px; height: 60px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.5));
}
.team-slot.filled .slot-name {
    font-weight: 800;
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.1;
    color: #fff;
    padding: 0 5px;
}
.remove-slot-btn {
    position: absolute; top: 5px; right: 5px;
    color: #ff4444; font-size: 0.9rem;
    background: rgba(0,0,0,0.5); border-radius: 50%;
    width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
    display: none;
}
.team-slot.filled:hover .remove-slot-btn { display: flex; }

/* Modal de Seleção de Time (Lista) */
.team-select-item {
    display: flex; align-items: center; gap: 15px;
    padding: 10px; background: rgba(255,255,255,0.05);
    border-radius: 8px; margin-bottom: 8px; cursor: pointer;
    transition: 0.2s; border: 1px solid transparent;
}
.team-select-item:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--primary-neon);
}
.team-select-item img { width: 40px; height: 40px; object-fit: contain; }

/* =========================================
   22. CALENDÁRIO (PASSO 5)
   ========================================= */
.calendar-days-options {
    display: flex; gap: 10px; justify-content: center; margin-top: 20px;
    opacity: 0.5; pointer-events: none; transition: 0.3s;
}
.calendar-days-options.active { opacity: 1; pointer-events: all; }

.day-check { display: none; }
.day-label {
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--text-gray); color: var(--text-gray);
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; cursor: pointer; transition: 0.3s;
}
.day-check:checked + .day-label {
    background: var(--neon-blue); color: #000; border-color: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
}

/* ... (Mantenha todo o CSS anterior) ... */

/* =========================================
   21. SLOTS INTERATIVOS (DENTRO DAS TABELAS)
   ========================================= */

/* Estilo para Célula de Time Vazia (Clicável) */
.slot-cell {
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 5px;
    height: 40px; /* Altura fixa para consistência */
}
.slot-cell:hover {
    background: rgba(0, 255, 136, 0.1);
    box-shadow: inset 0 0 10px rgba(0, 255, 136, 0.2);
}
.slot-content {
    display: flex; align-items: center; gap: 10px; height: 100%; width: 100%;
    padding: 0 10px;
}

/* Estado Vazio */
.slot-empty-text {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
    font-size: 0.8rem;
    display: flex; align-items: center; gap: 5px;
}
.slot-cell:hover .slot-empty-text { color: var(--success-color); }

/* Estado Preenchido */
.slot-filled {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}
.slot-filled img {
    width: 25px; height: 25px; object-fit: contain;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
}
.slot-filled span {
    font-weight: 700; color: #fff; font-size: 0.85rem;
    text-transform: uppercase;
}

/* Botão Remover (X) dentro da linha */
.slot-remove {
    margin-left: auto;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
    opacity: 0; transition: 0.2s;
}
.slot-filled:hover .slot-remove { opacity: 1; }
.slot-remove:hover { background: #ff4444; color: #fff; }

/* Ajuste para Árvore Mata-Mata Interativa */
.bracket-match.interactive {
    cursor: pointer; transition: 0.2s;
}
.bracket-match.interactive:hover {
    border-color: var(--success-color);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}
.bracket-match-slot {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 2px 0;
    height: 30px; display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
}
.bracket-match-slot:last-child { border-bottom: none; }


/* ... (Mantenha o CSS anterior até a parte 20) ... */

/* =========================================
   21. SLOTS INTERATIVOS (CORRIGIDO E REFORÇADO)
   ========================================= */

/* Célula Interativa (O lugar onde clica para por o time) */
.interactive-slot {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 5px;
    cursor: pointer;
    transition: 0.2s all;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px; /* Garante altura para o clique */
    position: relative;
}

.interactive-slot:hover {
    background: rgba(0, 255, 136, 0.15);
    border-color: var(--success-color);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
    transform: scale(1.02);
}

/* Estado Vazio */
.empty-slot-content {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    text-transform: uppercase;
    display: flex; align-items: center; gap: 5px;
}
.interactive-slot:hover .empty-slot-content { color: #fff; }

/* Estado Preenchido */
.filled-slot-content {
    display: flex; align-items: center; gap: 10px; width: 100%;
}
.filled-slot-content img {
    width: 28px; height: 28px; object-fit: contain;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
}
.filled-slot-content span {
    font-weight: 700; color: #fff; font-size: 0.85rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Botão Remover (X) Flutuante */
.slot-remove-btn {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px;
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid #ff4444;
    color: #ff4444;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
    opacity: 0; transition: 0.2s;
    z-index: 5;
}
.interactive-slot:hover .slot-remove-btn { opacity: 1; }
.slot-remove-btn:hover { background: #ff4444; color: #fff; transform: translateY(-50%) scale(1.1); }

/* Ajuste específico para Mata-Mata */
.matchup-slot {
    margin-bottom: 5px;
}

/* ... (Mantenha o CSS anterior) ... */

/* =========================================
   22. BRACKET (ÁRVORE) INTERATIVO E VISUAL
   ========================================= */
.bracket-container {
    display: flex;
    padding: 20px 0;
    overflow-x: auto;
    gap: 40px; /* Espaço para as linhas */
    justify-content: flex-start; /* Alinha a esquerda para crescer */
    min-height: 400px;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 220px; /* Largura fixa do card de jogo */
    flex-shrink: 0;
}

.match-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 10px 0;
}

/* Linhas de Conexão (CSS Puro) */
.bracket-round:not(:last-child) .match-card::after {
    content: '';
    position: absolute;
    right: -20px; /* Sai do card */
    top: 50%;
    width: 20px;
    height: 1px;
    background: rgba(255,255,255,0.2);
}

/* Slots dentro do Match Card */
.match-slot {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    padding: 2px 5px;
    height: 35px;
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
    cursor: default;
    transition: 0.2s;
    font-size: 0.75rem;
    position: relative;
}

/* Slot Clicável (Na Criação) */
.match-slot.interactive {
    cursor: pointer;
    border: 1px dashed rgba(255,255,255,0.2);
}
.match-slot.interactive:hover {
    background: rgba(0,255,136,0.1);
    border-color: var(--success-color);
}

/* Slot Preenchido */
.match-slot.filled {
    border-left-color: var(--primary-neon);
    background: linear-gradient(90deg, rgba(255,255,255,0.05), transparent);
}
.match-slot img { width: 22px; height: 22px; object-fit: contain; margin-right: 8px; }
.match-slot span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; font-weight: 600; }

/* Botão Remover Pequeno */
.slot-remove-mini {
    position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; border-radius: 50%;
    background: rgba(255,68,68,0.2); color: #ff4444;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; opacity: 0; transition: 0.2s; cursor: pointer;
}
.match-slot:hover .slot-remove-mini { opacity: 1; }

/* Slot BYE (Passa Direto) */
.match-slot.bye {
    opacity: 0.5;
    font-style: italic;
    border: 1px dashed rgba(255,255,255,0.1);
    justify-content: center;
}

/* Correção Tabela Copa na Galeria */
.copa-table-row {
    height: 40px; /* Altura fixa para alinhar */
}
.copa-team-cell {
    display: flex; 
    align-items: center; 
    height: 100%; 
    width: 100%;
    gap: 8px;
}

/* --- CORREÇÃO CRÍTICA DE FUNDO --- */
body {
    /* Torna o corpo transparente para ver a imagem de fundo (bg-carousel-container) */
    background-color: transparent !important;
    background-image: none !important; /* Remove gradientes antigos */
    min-height: 100vh;
}

/* --- CLASSES DE FUNDO (ATUALIZADAS) --- */
.bg-carousel-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    z-index: -10; /* Garante que fique BEM atrás */
}

.bg-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0.95)); /* Overlay escuro */
    z-index: 1;
}

.bg-image {
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    position: absolute; top: 0; left: 0;
    animation: slowZoom 60s infinite alternate;
}

@keyframes slowZoom { from { transform: scale(1); } to { transform: scale(1.15); } }

/* Fundo: Túnel do Estádio (Para a lista de jogadores) */
.bg-tunnel {
    background-image: url('https://images.unsplash.com/photo-1516731238628-936d7a468205?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
}

/* Fundo: Estúdio/Imprensa (Para o cadastro) - Faltava essa classe! */
.bg-studio {
    background-image: url('https://images.unsplash.com/photo-1577223625816-7546f13df25d?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
}