:root {
    --bg-main: #0b0c10;
    --bg-panel: #16161e;
    --bg-input: #1f1f2e;
    --text-main: #ffffff;
    --text-muted: #888893;
    --f1-red: #e10600;
    --danger: #ef4444;
    --neon-blue: #38bdf8;
    --neon-green: #10b981;
    --ovr-orange: #f59e0b; 
    --ovr-orange-dark: #d97706;
    --border-color: #262633;
    
    --font-main: 'Titillium Web', sans-serif;
    --font-tech: 'Orbitron', sans-serif;
    --font-serif: 'Instrument Serif', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg-main); color: var(--text-main); font-family: var(--font-main); -webkit-font-smoothing: antialiased; }

.font-tech { font-family: var(--font-tech); text-transform: uppercase; }
.font-serif { font-family: var(--font-serif); }
.font-main { font-family: var(--font-main); }
.italic-num { font-style: italic; font-weight: 700; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger) !important; font-weight: 700; }
.text-neon { color: var(--neon-blue) !important; font-weight: 700; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; background-color: var(--bg-main); display: flex; flex-direction: column; overflow-x: hidden; position: relative; }
.screen { display: none; flex: 1; flex-direction: column; padding-bottom: 80px; }
.screen.active { display: flex; }
.step { display: none; flex-direction: column; padding: 20px; }
.step.active { display: flex; }

/* HEADER GLOBAL */
.app-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; background-color: var(--bg-panel); border-bottom: 1px solid var(--border-color); }
.app-logo-mini { background-color: var(--text-main); -webkit-mask: url('assets/F1-Logo.svg') no-repeat center / contain; mask: url('assets/F1-Logo.svg') no-repeat center / contain; width: 20px; height: 18px; display: inline-block; }
.app-title { font-size: 1.2rem; font-weight: 700; letter-spacing: 2px; flex: 1; text-align: center; }
.app-user-icon { font-size: 1.2rem; }

/* ETAPAS COMUNS */
.step-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; }
.progress-bar { width: 100%; height: 4px; background-color: #222; border-radius: 2px; margin-bottom: 20px; overflow: hidden; }
.progress-bar .fill { height: 100%; background-color: var(--neon-green); transition: width 0.3s ease; }
.subtitle-text { font-size: 0.9rem; margin-bottom: 20px; }

/* STEP 1 */
.search-box { display: flex; align-items: center; background-color: var(--bg-input); border-radius: 8px; padding: 10px 15px; margin-bottom: 15px; }
.search-icon { margin-right: 10px; opacity: 0.5; }
.search-box input { background: transparent; border: none; color: white; width: 100%; outline: none; font-size: 1rem; }
.country-list { display: flex; flex-direction: column; gap: 2px; border-radius: 12px; overflow: hidden; background-color: var(--bg-panel); border: 1px solid var(--border-color); }
.country-item { display: flex; align-items: center; padding: 15px; gap: 15px; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; transition: 0.2s; }
.country-item.selected { border-left: 3px solid var(--neon-green); padding-left: 12px; background-color: rgba(255,255,255,0.05); }
.country-flag { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; }

/* STEP 2 */
.helmet-container { display: flex; justify-content: center; align-items: center; background: radial-gradient(circle, #2a2a35 0%, #111115 70%); border-radius: 16px; padding: 20px; margin-bottom: 20px; border: 1px solid var(--border-color); }
.f1-helmet { width: 220px; height: 220px; drop-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.identity-inputs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.input-row { display: flex; align-items: center; justify-content: space-between; background-color: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 8px; padding: 12px 15px; }
.input-row label { font-size: 0.75rem; color: var(--text-muted); }
.input-row input { flex: 1; background: transparent; border: none; color: white; text-align: right; font-size: 1.1rem; outline: none; width: 100%; }

/* STEP 3 */
.personality-list { display: flex; flex-direction: column; gap: 12px; }
.style-card { background-color: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 12px; padding: 18px; cursor: pointer; transition: 0.2s; }
.style-card.selected { border-color: var(--neon-blue); background-color: rgba(56, 189, 248, 0.1); }
.style-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* NAVEGAÇÃO BOTTOM */
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background-color: var(--bg-main); display: flex; gap: 15px; padding: 15px 20px; border-top: 1px solid var(--border-color); z-index: 50; }
.btn-outline, .btn-solid { flex: 1; padding: 16px; border-radius: 24px; font-size: 1rem; font-weight: 600; cursor: pointer; text-align: center; border: 1px solid white; transition: 0.2s; }
.btn-outline { background: transparent; color: white; }
.btn-solid { background: white; color: black; }
.btn-solid:disabled { background: #444; border-color: #444; color: #888; cursor: not-allowed; }
.btn-solid:active { transform: scale(0.98); }

/* ========================================================= */
/* DASHBOARD & STICKY HEADER                                 */
/* ========================================================= */
.sticky-top-area {
    position: sticky; top: 0; z-index: 100;
    background-color: var(--bg-main);
    padding: 15px 15px 10px 15px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.hero-card-copero {
    display: flex; background: linear-gradient(135deg, #1c1c24, #121218);
    border-radius: 12px; padding: 15px; border: 1px solid var(--border-color);
    position: relative; overflow: hidden; gap: 12px;
}
.hero-ovr {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--ovr-orange), var(--ovr-orange-dark));
    border-radius: 10px; width: 70px; height: 80px; color: white; box-shadow: 0 4px 10px rgba(217, 119, 6, 0.4);
}
.hero-ovr .ovr-label { font-size: 0.65rem; margin-bottom: -2px; }
.hero-ovr .ovr-value { font-size: 2rem; font-weight: 900; line-height: 1; }

.hero-details { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.hero-top-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.hero-flag { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; }
.hero-country { font-size: 0.75rem; color: white; }
.hero-tag { background: #333; color: white; font-size: 0.6rem; padding: 2px 6px; border-radius: 4px; margin-left: 5px; }

.hero-mid-row { display: flex; align-items: center; margin-bottom: 4px; }
.title-serif { font-size: 1.8rem; font-style: italic; font-weight: 400; line-height: 1; letter-spacing: 0.5px; }

.hero-bot-row { display: flex; align-items: center; font-size: 0.8rem; }
.team-color-indicator { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background-color: #555; margin-right: 6px; }
.pilot-number { margin-left: 6px; }

.hero-stats-right { display: flex; flex-direction: column; justify-content: space-between; text-align: right; border-left: 1px solid rgba(255,255,255,0.1); padding-left: 10px; }
.stat-group { display: flex; flex-direction: column; }
.stat-lbl { font-size: 0.55rem; color: var(--text-muted); }
.stat-val { font-size: 1rem; color: white; font-weight: 700; }

.dashboard-content { padding: 0 15px 15px 15px; }

/* TABELA DE HISTÓRICO */
.history-section { margin-bottom: 20px; margin-top: 15px; }
.history-table { display: flex; flex-direction: column; }
.table-header { display: flex; padding: 8px 10px; font-size: 0.65rem; color: var(--text-muted); border-bottom: 1px solid rgba(255,255,255,0.1); }
.table-row { display: flex; align-items: center; padding: 10px 10px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.table-row.current-year { background-color: rgba(255,255,255,0.03); border-radius: 8px; }

.age-badge { background-color: #e10600; color: white; border-radius: 6px; padding: 4px 8px; font-size: 0.8rem; font-weight: 700; width: 32px; text-align: center; margin-right: 12px; }
.current-year .age-badge { background-color: #333; }
.row-team-info { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.team-color-dot { width: 14px; height: 14px; border-radius: 3px; background-color: #555; display: inline-block; flex-shrink: 0; }
.col-eq { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #ddd; }

.col-st { width: 14%; text-align: center; font-size: 0.9rem; color: #bbb; }
.col-age { width: 44px; text-align: center; }
.flex-2 { flex: 1; }

.milestone-row { background-color: transparent !important; padding: 15px 0; justify-content: center; }
.milestone-text { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); letter-spacing: 1px; border: 1px solid var(--border-color); padding: 5px 15px; border-radius: 12px; text-align: center;}

/* TIMELINE ANIMADA */
.season-timeline-container { margin-top: 15px; padding: 15px 10px; background-color: var(--bg-panel); border-radius: 8px; border: 1px solid var(--border-color); }
.timeline-header { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--text-muted); margin-bottom: 10px; }
.season-timeline { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
.season-timeline::-webkit-scrollbar { display: none; }

.race-badge {
    min-width: 34px; height: 34px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 700; color: white; background-color: #2a2a35; border: 1px solid var(--border-color);
    flex-shrink: 0; font-family: var(--font-tech); opacity: 1;
}
.race-badge.p1 { background-color: #f59e0b; color: black; border-color: #d97706; }
.race-badge.p2 { background-color: #94a3b8; color: black; border-color: #64748b; }
.race-badge.p3 { background-color: #b45309; color: white; border-color: #78350f; }
.race-badge.pts { background-color: #10b981; color: white; border-color: #059669; }
.race-badge.dnf { background-color: rgba(239, 68, 68, 0.15); color: var(--danger); border-color: var(--danger); }
.race-badge.inj { background-color: #111; color: var(--text-muted); border-color: #333; font-size: 0.7rem;}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
.new-badge { animation: popIn 0.3s ease forwards; }

/* INLINE EVENTS & ACTIONS */
.action-area { padding-bottom: 40px; }
.simulating-state {
    text-align: center; padding: 20px; color: var(--neon-blue); font-size: 1.1rem;
    background-color: rgba(56, 189, 248, 0.05); border: 1px dashed var(--neon-blue); border-radius: 8px;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.inline-event {
    background-color: var(--bg-panel); border: 1px solid var(--neon-blue);
    border-radius: 12px; padding: 20px; text-align: center;
    animation: popIn 0.3s ease; box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}
.inline-event-icon { font-size: 2.5rem; margin-bottom: 10px; }
.inline-event-title { font-size: 1.2rem; margin-bottom: 10px; color: white; }
.inline-event-desc { font-size: 0.95rem; color: #ccc; margin-bottom: 20px; line-height: 1.4;}
.inline-event-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-event { padding: 14px; border-radius: 8px; border: none; font-size: 0.9rem; cursor: pointer; font-weight: 700; transition: 0.2s;}
.btn-event.safe { background-color: var(--bg-input); color: white; border: 1px solid var(--border-color); }
.btn-event.risk { background-color: rgba(225, 6, 0, 0.1); color: var(--f1-red); border: 1px solid var(--f1-red); }
.btn-event:active { transform: scale(0.97); }

/* OFERTAS (Cards Sem Borda Colorida, Com Detalhes) */
.offers-grid { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.offers-grid::-webkit-scrollbar { display: none; }
.offer-card {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    min-width: 170px; background-color: var(--bg-panel); border: 1px solid var(--border-color);
    border-radius: 10px; padding: 20px 15px; cursor: pointer; transition: 0.2s;
    position: relative; text-align: center;
}
.offer-card:active { transform: scale(0.97); background-color: rgba(255,255,255,0.05); }
.offer-card-logo { height: 45px; margin-bottom: 12px; opacity: 0.8; }
.offer-team { font-size: 1.2rem; color: white; margin-bottom: 10px; }
.offer-details {
    display: flex; flex-direction: column; gap: 6px; width: 100%;
    background-color: rgba(0,0,0,0.25); padding: 10px; border-radius: 6px;
    font-size: 0.75rem;
}
.offer-detail-item { display: flex; flex-direction: column; gap: 2px; }
.offer-detail-item span.lbl { color: var(--text-muted); font-size: 0.65rem; text-transform: uppercase; }
.offer-detail-item b { color: white; font-weight: 600; font-size: 0.8rem; }

.action-buttons { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 15px; }
.btn-simulate {
    background-color: var(--text-main); color: var(--bg-main); border: none; padding: 18px; font-size: 1.1rem; font-weight: 700;
    border-radius: 12px; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px;
    box-shadow: 0 4px 15px rgba(255,255,255,0.1); transition: 0.2s;
}
.btn-simulate:active { transform: scale(0.98); }

/* RETIREMENT SCREEN */
.retirement-section { margin-top: 25px; padding-top: 20px; border-top: 1px dashed var(--border-color); text-align: center; }
.btn-retire { background: transparent; border: 1px solid var(--danger); color: var(--danger); padding: 12px; border-radius: 8px; width: 100%; font-weight: 700; cursor: pointer; transition: 0.2s;}
.btn-retire:active { background-color: rgba(239, 68, 68, 0.1); }
.retirement-screen { text-align: center; padding: 40px 20px; }
.retirement-screen h1 { font-size: 3rem; color: var(--neon-blue); margin-bottom: 10px; }
.retirement-stats { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; margin-top: 30px; }
.ret-stat { background: var(--bg-panel); padding: 20px; border-radius: 12px; border: 1px solid var(--border-color); min-width: 120px; }
.ret-stat h3 { font-size: 2rem; color: white; }
.ret-stat span { font-size: 0.7rem; color: var(--text-muted); }
