/* --- ESTILO GERAL --- */
:root {
    --pe-blue: #0038a8; 
    --pe-yellow: #ffe500; 
    --pe-red: #d50000; 
    --pe-green: #009b3a;
    --cbc-gold: #D4AF37;
    --bg-body: #f0f2f5;
    --text-main: #1e293b;
    --bg-card: white;
    --sat: env(safe-area-inset-top);
    --sab: env(safe-area-inset-bottom);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; -webkit-tap-highlight-color: transparent; outline: none; }
.uppercase-input { text-transform: uppercase; }

html, body { 
    width: 100%; height: 100%; overflow-x: hidden; 
    background: var(--bg-body); position: fixed; 
}

.app-container { 
    width: 100%; max-width: 600px; margin: 0 auto; 
    position: relative; height: 100%; 
    background: var(--bg-card); 
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column;
    padding-top: var(--sat);
}

/* Inputs & Forms */
input.valid { border-color: #009b3a !important; background-color: #f0fdf4; }
input.invalid { border-color: #d50000 !important; background-color: #fef2f2; }
input, select { width: 100%; padding: 12px; border: 2px solid #cbd5e1; border-radius: 8px; background: white; font-size: 16px; color: #1e293b; font-weight: 600; transition:0.3s; }
input:focus { border-color: var(--pe-blue); }
.input-group { margin-bottom: 15px; width: 100%; position: relative; }
.input-group label { font-size: 11px; font-weight: 800; color: var(--pe-blue); margin-left: 2px; display: block; margin-bottom: 5px; }
.input-wrapper { display: flex; align-items: center; position: relative; }
.pass-eye { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: #666; cursor: pointer; z-index: 10; font-size: 16px; }

/* Buttons */
.btn { width: 100%; padding: 14px; border: none; border-radius: 6px; background: var(--pe-blue); color: white; font-weight: 700; cursor: pointer; margin-top: 15px; box-shadow: 0 4px 6px rgba(0,0,0,0.2); font-size: 14px; text-transform: uppercase; flex-shrink: 0; }
.btn:active { transform: scale(0.97); }
.btn-icon { width: 50px; height: 50px; border-radius: 50%; border: 2px solid #f0f0f0; background: white; color: var(--pe-blue); font-size: 22px; cursor: pointer; box-shadow: 0 4px 8px rgba(0,0,0,0.15); display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.btn-mini-adm { padding: 4px 8px; border-radius: 4px; border:none; color:white; font-size: 10px; cursor: pointer; font-weight: bold; text-transform: uppercase; }

/* Screens & Layout */
.screen { display: none; flex-direction: column; animation: fade 0.3s; padding-bottom: calc(80px + var(--sab)); width: 100%; min-height: 100%; }
.screen.active { display: flex; }
.section-header-area { background: white; padding: 10px 15px; border-bottom: 1px solid #eee; margin-bottom: 10px; display: flex; flex-direction: column; gap: 10px; }
.section-title { font-size: 14px; color: var(--pe-blue); font-weight: 900; display: flex; align-items: center; gap: 8px; border-left: 5px solid var(--pe-yellow); padding-left: 10px; }
.filter-row { display: flex; gap: 5px; }

/* Login Screen */
#screen-login { height: 100%; overflow-y: auto; position: absolute; top:0; left:0; width:100%; background: black; padding-bottom: 0; z-index: 2000; }
.login-overlay-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, #111 0%, #0038a8 100%); z-index: 2; pointer-events: none; }
.login-content-layer { position: relative; z-index: 100; min-height: 100%; width: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px; text-align: center; }
.login-logo-img { width: 120px; margin-bottom: 20px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3)); }
.login-content-layer h1 { margin: 0 auto 5px auto; color: white; font-size: 24px; text-shadow: 0 3px 10px rgba(0,0,0,0.5); font-weight: 900; letter-spacing: -1px; line-height: 1.1; }

/* Header & Bottom Bar */
.app-header { background: white; padding: 10px 15px; display: none; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 500; height: 65px; flex-shrink: 0; }
.header-support-btn { background-color: #25D366; color: white; padding: 6px 12px; border-radius: 20px; font-size: 10px; font-weight: 900; text-decoration: none; display: flex; align-items: center; gap: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); cursor: pointer; }
.version-badge { font-size: 10px; font-weight: 900; color: var(--pe-blue); background: #e0e7ff; padding: 6px 10px; border-radius: 20px; border: 1px solid var(--pe-blue); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;}
.season-selector-ui { font-size: 8px; font-weight: bold; background: transparent; border: none; color: var(--pe-blue); text-align: center; padding: 0; margin-top: 2px; appearance: none; -webkit-appearance: none; cursor: pointer; outline: none;}
.header-logo-text { font-size: 18px; font-weight: 900; color: var(--pe-blue); letter-spacing: -1px; display: flex; align-items: center; gap: 10px; }

/* LOGO DO TOPO: MAIOR E COM CONTORNO FINO */
.header-mini-logo { height: 65px; width: auto; max-width: 150px; object-fit: contain; filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.9)); }

.bottom-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 600px; height: 60px; background: white; display: none; justify-content: space-around; align-items: center; border-top: 1px solid #ddd; z-index: 10000; box-shadow: 0 -5px 15px rgba(0,0,0,0.05); padding-bottom: var(--sab); }
.bar-item { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #94a3b8; font-size: 10px; font-weight: 700; cursor: pointer; background: white; }
.bar-item.active { color: var(--pe-blue); background: #f0f9ff; border-top: 3px solid var(--pe-red); }

/* Calendar & Events */
.calendar-wrapper { padding: 15px; }
.highlight-event { width: 100%; border: 2px solid var(--pe-yellow); box-shadow: 0 5px 10px rgba(0,0,0,0.1); margin-bottom: 15px; border-radius: 10px; overflow: hidden; background:white; position: relative; }
/* ALTERAÇÃO FEITA AQUI: */
.highlight-event img { height: auto; width: 100%; object-fit: contain; display: block; border-radius: 8px 8px 0 0; background-color: #000; }
.event-body { padding: 8px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; text-align: left; }
.event-price { font-size: 10px; font-weight: 900; color: var(--pe-green); background: #dcfce7; padding: 2px 5px; border-radius: 4px; display: inline-block; margin-bottom: 5px; }
.mini-events-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.event-card { background: white; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); overflow: hidden; display: flex; flex-direction: column; transition: 0.3s; position: relative; border: 1px solid #eee; }
.past-events-bar { padding: 10px 15px; background: #f8fafc; border-bottom: 1px solid #eee; white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; display: flex; gap: 10px; }
.past-event-chip { display: inline-block; background: white; border: 1px solid #ddd; border-radius: 6px; padding: 8px; font-size: 10px; color: #666; min-width: 120px; flex-shrink: 0; opacity: 0.9; }
.chip-closed { background-color: #fee2e2 !important; border-color: #ef4444 !important; }

/* Ranking & Listas */
.rank-list-container { background: white; border-radius: 8px; overflow: hidden; border: 1px solid #e2e8f0; margin: 0 10px; min-height: 50px; }
.rank-row { display: flex; align-items: center; padding: 10px 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; }
.rank-row:nth-child(even) { background: #f8fafc; }
.rank-pos { width: 30px; font-weight: 900; color: #64748b; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.rank-name { flex: 1; font-weight: 700; color: #334155; display: flex; flex-direction: column; padding-left: 5px; line-height: 1.2; }
.rank-cat { font-size: 9px; color: #666; font-weight: 500; }
.rank-val { font-family: monospace; font-weight: 900; color: var(--pe-blue); background: #e0e7ff; padding: 4px 8px; border-radius: 4px; font-size: 11px; }

/* --- PERFIL E CARTEIRINHA PREMIUM --- */
.id-card-premium { 
    width: 100%;
    max-width: 550px; 
    margin: 0 auto; 
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); 
    border-radius: 16px; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.5); 
    position: relative; overflow: hidden; color: white; 
    border: 2px solid var(--cbc-gold); 
}
.id-card-header { 
    background: linear-gradient(90deg, #021a4f 0%, var(--pe-red) 100%); 
    padding: 10px 15px; 
    display: flex; align-items: center; justify-content: space-between; 
    border-bottom: 2px solid var(--pe-yellow);
}

.id-card-header img { 
    height: 80px; 
    width: auto; 
    max-width: 200px; 
    object-fit: contain; 
    background: transparent; 
    padding: 0; 
    border-radius: 0; 
    box-shadow: none; 
    filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.9)); 
    border: none; 
} 

.id-card-header span { 
    font-size: 11px; 
    font-weight: 900;
    letter-spacing: 1.5px; 
    text-align: right;
    color: var(--pe-yellow); 
}
.id-card-body { 
    padding: 15px 20px; 
    display: flex; gap: 10px; 
    align-items: center; position: relative; z-index: 2;
}
.id-photo-box { 
    width: 80px; height: 80px; border-radius: 12px; overflow: hidden; 
    border: 2px solid #fff; 
    background: #000; box-shadow: 0 4px 10px rgba(0,0,0,0.3); flex-shrink: 0; cursor: pointer; position: relative; 
}
.id-photo-box::after { content: '\f030'; font-family: "Font Awesome 5 Free"; font-weight: 900; position: absolute; bottom: 0; right: 0; background: rgba(0,0,0,0.6); color: white; padding: 2px 5px; font-size: 10px; border-top-left-radius: 5px;}
.id-photo-box img { width: 100%; height: 100%; object-fit: cover; }
.id-info-box { flex: 1; text-align: left; }
.id-name { 
    font-size: 17px; 
    font-weight: 900; color: var(--pe-yellow); line-height: 1.1; 
    margin-bottom: 3px; 
    text-transform: uppercase;
}
.id-row { 
    font-size: 10px; 
    color: #cbd5e1; 
    margin-bottom: 1.5px; 
    display: flex; justify-content: space-between; 
    border-bottom: 1.5px dashed rgba(255,255,255,0.2); 
    padding-bottom: 1.5px;
}
.id-footer { 
    background: #0f172a; 
    padding: 6px 8px; 
    text-align: center; font-size: 8px; color: #64748b; 
    letter-spacing: 2.5px; 
    border-top: 1px solid #334155; 
}

/* Admin Dashboard */
.admin-dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 10px; }
.adm-dash-btn { background: white; border-radius: 12px; padding: 15px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); cursor: pointer; text-align: center; border: 1px solid #eee; transition: transform 0.2s; height: 100px; }
.adm-dash-btn:active { transform: scale(0.95); background: #f8fafc; }
.adm-dash-btn i { font-size: 28px; color: var(--pe-blue); margin-bottom: 5px; }
.adm-dash-btn span { font-size: 10px; font-weight: 800; color: #334155; text-transform: uppercase; }

.admin-header-flag { background: linear-gradient(180deg, var(--pe-blue) 0%, var(--pe-blue) 40%, white 40%, white 60%, var(--pe-yellow) 60%, var(--pe-yellow) 80%, var(--pe-green) 80%, var(--pe-green) 100%); height: 10px; width: 100%; margin-bottom: 10px; border-radius: 4px; border: 1px solid #ddd; }
.hist-row { background:white; padding:10px; margin-bottom:5px; border-radius:5px; border:1px solid #eee; display:flex; justify-content:space-between; align-items:center; }

/* --- TICKET PREMIUM STYLE --- */
.ticket-visual { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.2); width: 320px; position: relative; text-align: left; }
.ticket-header { background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%); padding: 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 4px solid var(--pe-yellow); }
.ticket-logo-main { height: 40px; }
.ticket-logo-cbc { height: 35px; }
.ticket-header-text { color: white; font-size: 9px; line-height: 1.2; text-align: center; flex: 1; margin: 0 10px; opacity: 0.9; }
.ticket-header-text b { display: block; font-size: 11px; color: var(--pe-yellow); }
.ticket-body { padding: 20px; background-image: radial-gradient(circle at 0 0, transparent 10px, #fff 11px), radial-gradient(circle at 100% 0, transparent 10px, #fff 11px); background-position: top left, top right; background-size: 50% 50%; background-repeat: no-repeat; }
.ticket-row { margin-bottom: 12px; }
.ticket-label { font-size: 8px; color: #94a3b8; font-weight: 700; display: block; text-transform: uppercase; letter-spacing: 1px; }
.ticket-value { font-size: 14px; font-weight: 700; color: #334155; display: block; }
.ticket-value-lg { font-size: 18px; font-weight: 900; color: #0f172a; display: block; line-height: 1.1; }
.ticket-divider { height: 1px; background: #e2e8f0; margin: 15px 0; border-top: 1px dashed #cbd5e1; }
.ticket-status { background: #dcfce7; color: #15803d; font-weight: 900; text-align: center; padding: 10px; border-radius: 8px; font-size: 12px; margin-top: 15px; border: 1px solid #86efac; }
.ticket-footer { background: #f1f5f9; padding: 10px; text-align: center; font-size: 8px; color: #64748b; font-weight: 600; border-top: 1px solid #e2e8f0; }

/* Modals & UI */
.toast { position: fixed; top: calc(20px + var(--sat)); left: 50%; transform: translateX(-50%); background: var(--pe-blue); color: white; padding: 12px 25px; font-size: 13px; opacity: 0; pointer-events: none; transition: 0.3s; z-index: 300000; font-weight: 900; border-radius: 50px; border-bottom: 3px solid var(--pe-yellow); display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.toast.show { opacity: 1; top: calc(60px + var(--sat)); }
.modal-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.8); z-index: 200000; display:none; flex-direction:column; align-items:center; justify-content:center; padding: 20px; }
.modal-box { background: white; width: 100%; max-width: 380px; padding: 20px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.5); border-top: 5px solid var(--pe-yellow); border-radius: 8px; max-height: 90vh; overflow-y: auto; animation: fade 0.3s; }
@keyframes fade { from {opacity:0; transform:translateY(20px);} to {opacity:1; transform:translateY(0);} }

/* Live Screen */
.live-screen { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #f3f4f6; z-index: 99999; display: flex; flex-direction: column; overflow: hidden; padding-top: var(--sat); padding-bottom: var(--sab); }
.live-top-bar { height: 60px; background: white; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; border-bottom: 3px solid #000; flex-shrink: 0; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.live-content-wrapper { flex: 1; width: 100%; height: 100%; overflow: hidden; }

/* TAGS CIRCULARES */
.evt-badge { position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 50px; font-size: 9px; font-weight: 900; z-index: 10; box-shadow: 0 2px 4px rgba(0,0,0,0.3); border: 2px solid white; letter-spacing: 0.5px; }
.badge-pe { background: var(--pe-blue); color: white; }
.badge-cbc { background: var(--cbc-gold); color: #d50000; } 
.badge-postponed { background: #f97316; color: white; }

/* GRID DE IMAGENS NA GALERIA DO ADMIN */
.adm-gallery-edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; margin-top: 10px; }
.adm-gallery-edit-item { position: relative; width: 70px; height: 70px; border-radius: 6px; overflow: hidden; border: 2px solid #ccc; background: #fff; }
.adm-gallery-edit-item img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.adm-gallery-del-btn { position: absolute; top: 2px; right: 2px; background: rgba(213,0,0,0.9); color: white; border: none; border-radius: 50%; width: 22px; height: 22px; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* --- BANNER DE INSTALAÇÃO DO APP (PWA) --- */
.pwa-install-banner {
    position: fixed; bottom: calc(80px + var(--sab)); left: 50%; transform: translateX(-50%);
    width: 95%; max-width: 400px; background: white; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); display: none; align-items: center; justify-content: space-between;
    padding: 15px; z-index: 999999; border: 2px solid var(--pe-blue);
    animation: fadeUp 0.5s ease-out;
}
@keyframes fadeUp { from { bottom: -50px; opacity: 0; } to { bottom: calc(80px + var(--sab)); opacity: 1; } }

/* Ajuste Modo Leitura Arquivo Histórico */
body.archive-mode { border-top: 5px solid var(--pe-red); }
.archive-badge { position: fixed; top: 0; left: 50%; transform: translateX(-50%); background: var(--pe-red); color: white; padding: 2px 10px; font-size: 10px; font-weight: bold; border-radius: 0 0 8px 8px; z-index: 999999; }
.season-selector-ui { font-size: 8px; font-weight: bold; background: transparent; border: none; color: var(--pe-blue); text-align: center; padding: 0; margin-top: 2px; appearance: none; -webkit-appearance: none; cursor: pointer; outline: none; }
