:root {
    --gold: #FFD700;
    --bg: #111111;
    --card-bg: #1c1c1c;
    --text: #ffffff;
    --success: #4CAF50;
}

/* --- THEMES SYSTEM --- */
body.theme-carbon {
    --bg: #1a1a1a;
    --card-bg: #2d2d2d;
    --gold: #8e8e8e; /* Silver/Carbon Look */
}

body.theme-ferrari {
    --bg: #120000;
    --card-bg: #2b0000;
    --gold: #ff0000; /* Racing Red */
}

body.theme-electric {
    --bg: #000814;
    --card-bg: #001d3d;
    --gold: #00b4d8; /* Electric Blue */
}

body.theme-forest {
    --bg: #0b140b;
    --card-bg: #1a2e1a;
    --gold: #2ecc71; /* Forest Green */
}

body.theme-mpower {
    --bg: #000a1a;
    --card-bg: #001a33;
    --gold: #3399ff; /* M-Power Blue */
}

/* --- BASE STYLES --- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    background: var(--bg); color: var(--text); margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) 0;
    transition: background 0.3s ease;
}

header { padding: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); }

.header-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.brand-center {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-main { width: 130px; height: auto; margin-bottom: 5px; }
h1 { margin: 0; color: var(--gold); font-size: 1.6rem; letter-spacing: 1px; text-transform: uppercase; transition: color 0.3s; }

/* --- NAVIGATION & BUTTONS --- */
.lang-wrapper { grid-column: 3; display: flex; justify-content: flex-end; }
.lang-dropdown { position: relative; display: inline-block; z-index: 9999; }
.dropbtn { 
    background: rgba(0,0,0,0.3); color: var(--gold); border: 1px solid var(--gold); 
    padding: 6px 10px; border-radius: 8px; cursor: pointer; font-weight: bold;
}
.dropdown-content {
    display: none; position: absolute; right: 0; background: #222;
    min-width: 140px; border: 1px solid var(--gold); border-radius: 8px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.8); z-index: 10000;
}
.lang-dropdown:hover .dropdown-content { display: block; }
.dropdown-content a { color: white; padding: 12px; display: block; text-decoration: none; border-bottom: 1px solid #333; font-size: 14px; }

.total-box { 
    text-align: center; margin: 25px 15px; padding: 20px; 
    background: var(--card-bg); border: 2px solid var(--gold); border-radius: 15px; 
}
.price-tag { font-size: 3rem; color: var(--gold); font-weight: bold; line-height: 1.1; }

.primary-btn { background: var(--gold); color: black; padding: 16px; width: calc(100% - 30px); border: none; margin: 10px 15px; font-weight: bold; border-radius: 12px; cursor: pointer; }
.secondary-btn { background: rgba(255,255,255,0.1); color: white; padding: 12px; width: calc(100% - 30px); border: none; margin: 5px 15px; border-radius: 10px; cursor: pointer; }
.danger-btn { background: #800000; color: white; padding: 16px; width: calc(100% - 30px); border: none; margin: 20px 15px; border-radius: 12px; cursor: pointer; }

/* --- CARDS & LISTS --- */
.vehicle-card { background: var(--card-bg); border: 1px solid var(--gold); padding: 20px; margin: 15px; border-radius: 15px; text-align: center; cursor: pointer; transition: 0.2s; }
.vehicle-card:active { transform: scale(0.98); }

.history-item { 
    background: var(--card-bg); border: 1px solid rgba(255,255,255,0.05); padding: 15px; margin: 10px 15px; 
    border-radius: 10px; display: flex; justify-content: space-between; align-items: center; 
}

.del-x { background: #444; color: white; border: none; border-radius: 5px; padding: 5px 10px; cursor: pointer; }

/* --- MODALS & INPUTS --- */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); display: none; align-items: center; justify-content: center; z-index: 2000; }
.modal-content { background: #1a1a1a; padding: 25px; width: 90%; max-width: 400px; border-radius: 15px; border: 1px solid var(--gold); }
input { width: 100%; background: #222; border: 1px solid #444; color: white; padding: 14px; margin: 8px 0; border-radius: 8px; font-size: 16px; }

/* --- REWARDS & SHOP --- */
.points-header-container { text-align: center; margin: 10px 0; cursor: pointer; }
.points-badge {
    display: inline-flex; align-items: center; background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--gold); padding: 5px 15px; border-radius: 20px;
    color: var(--gold); font-weight: bold; font-size: 0.9rem;
}
.reward-card {
    background: var(--card-bg); padding: 25px; border-radius: 15px;
    text-align: center; border: 1px solid rgba(255,255,255,0.1); margin: 15px;
}
.big-points-display { font-size: 2.5rem; font-weight: 900; color: var(--gold); text-shadow: 0 0 15px rgba(255, 215, 0, 0.3); }

.shop-item {
    background: var(--card-bg); padding: 15px; border-radius: 10px;
    display: flex; justify-content: space-between; align-items: center;
    border: 1px solid rgba(255,255,255,0.05); margin: 0 15px 10px 15px;
}

/* --- TABS --- */
.tab-container { display: flex; gap: 5px; padding: 10px; background: rgba(0,0,0,0.2); }
.tab-btn {
    flex: 1; padding: 12px; background: rgba(255,255,255,0.05); border: none; color: #888;
    font-weight: bold; border-radius: 5px; cursor: pointer;
}
.tab-btn.active { background: var(--gold); color: #000; }

/* --- TOAST --- */
#toast {
    visibility: hidden; min-width: 200px; background-color: var(--gold);
    color: #000; text-align: center; border-radius: 50px; padding: 12px;
    position: fixed; z-index: 9999; left: 50%; bottom: 30px;
    transform: translateX(-50%); font-weight: bold;
}
#toast.show { visibility: visible; animation: fadein 0.5s, fadeout 0.5s 2.5s; }

@keyframes fadein { from {bottom: 0; opacity: 0;} to {bottom: 30px; opacity: 1;} }
@keyframes fadeout { from {bottom: 30px; opacity: 1;} to {bottom: 0; opacity: 0;} }

.hidden { display: none !important; }
.adsense-container {
    min-height: 90px;
    background: rgba(255,255,255,0.02);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#start-video-btn:disabled {
    background: #444 !important;
    color: #888 !important;
    cursor: not-allowed;
}