/* ===========================================
   MOTO PRO MANAGER - ESTILOS GLOBALES
   =========================================== */
/* --- VARIABLES GLOBALES --- */
:root {
    --red: #e10600;
    --red-dark: #c1121f;
    --dark: #121212;
    --card-bg: rgba(255, 255, 255, 0.98);
    --card-dark: #1e1e1e;
    --green: #2ecc71;
    --text-light: #ffffff;
    --text-dark: #1a1a1a;
}
/* --- RESET Y BASE --- */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Segoe UI', Arial, sans-serif;
}
body {
    background: var(--dark);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    padding-top: 5vh; /* Empieza desde arriba */
    box-sizing: border-box;
}
/* --- TARJETA PRINCIPAL (Login, Registro, etc) --- */
.card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.7);
    text-align: center;
}
/* --- CABECERA EXTERNA SOLO LOGO --- */
.page-header {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
    padding: 40px;
}
.page-header::before {
    display: none;
}
.page-header h1 {
    display: none;
}
.page-header h1 span {
    color: #e10600;
}
.page-header .logo-serie {
    width: 270px;
    height: auto;
    position: relative;
    z-index: 2;
}
/* Responsive para móviles */
@media (max-width: 768px) {
    .page-header {
        padding: 30px;
    }
    .page-header .logo-serie {
        width: 200px;
    }
}
@media (max-width: 480px) {
    .page-header {
        padding: 20px;
    }
    .page-header .logo-serie {
        width: 160px;
    }
}
/* --- HEADER LEGACY (dentro de card - ya no usado) --- */
.card-header {
    display: none;
}
.logo-serie {
    width: 85px;
    height: auto;
    margin-bottom: 15px;
}
h2 {
    color: var(--text-dark);
    text-transform: uppercase;
    margin-bottom: 15px;
    font-size: 1.1rem;
}
/* --- INPUTS Y BOTONES --- */
input {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-sizing: border-box;
}
button {
    width: 100%;
    padding: 14px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    text-transform: uppercase;
}
button:hover {
    background: var(--red-dark);
}
button:disabled {
    background: #bbb;
    cursor: not-allowed;
}
.btn-rojo {
    background: var(--red);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
}
.btn-rojo:hover {
    background: var(--red-dark);
}
/* --- CAMPO CONTRASEÑA CON OJO --- */
.password-field {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    margin: 8px 0;
}
.password-field input {
    flex: 1;
    margin: 0;
    padding-right: 45px;
}
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3em;
    color: #888;
    padding: 0;
    width: auto;
    transition: color 0.2s;
}
.toggle-password:hover {
    color: var(--red);
}
.toggle-password:active {
    transform: scale(0.95);
}
/* --- VALIDADOR DE CONTRASEÑA --- */
.validator-list {
    text-align: left;
    font-size: 0.85em;
    margin: 10px 0;
    padding-left: 20px;
    list-style: none;
}
.validator-list li {
    color: #888;
    margin-bottom: 5px;
    position: relative;
}
.validator-list li::before {
    content: "✖ ";
    color: var(--red);
    position: absolute;
    left: -20px;
}
.validator-list li.valid {
    color: var(--green);
    font-weight: bold;
}
.validator-list li.valid::before {
    content: "✔ ";
    color: var(--green);
}
.match-msg {
    font-size: 0.85em;
    margin-top: -10px;
    margin-bottom: 10px;
    display: none;
}
/* --- RECORDAR SESIÓN --- */
.remember-me {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 10px 0;
    font-size: 0.9em;
}
.remember-me input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}
.remember-me label {
    cursor: pointer;
    color: #666;
}
/* ===========================================
   PÁGINAS SIMPLES (mensaje, verificar)
   =========================================== */
body.simple-page {
    background: #1a1a1a;
    color: white;
}
.simple-box {
    background: white;
    padding: 40px;
    border-radius: 25px;
    text-align: center;
    width: 350px;
    color: #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.simple-box h2 {
    color: #00aa00;
    text-transform: uppercase;
}
.btn-red-simple {
    background: #cc0000;
    color: white;
    padding: 15px;
    width: 100%;
    border-radius: 10px;
    display: block;
    text-decoration: none;
    margin-top: 20px;
    font-weight: bold;
    text-align: center;
    box-sizing: border-box;
}
.btn-red-simple:hover {
    background: #aa0000;
}
/* --- LOADER (animación de carga) --- */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #cc0000;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 2s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* ===========================================
   PADDOCK - ÁREA PRINCIPAL DEL JUEGO
   =========================================== */
body.paddock-page {
    display: block;
    background: var(--dark);
    color: white;
    padding: 0;
}

/* --- TEXT RED HELPER --- */
.text-red {
    color: var(--red);
}

/* --- NAVBAR (todos los dispositivos) --- */
.nav-mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(225, 6, 0, 0.2);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
}

.nav-logo-img-mobile {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
}

.nav-page-title {
    font-weight: bold;
    font-size: 18px;
    letter-spacing: 1px;
    color: white;
}

.nav-logo-text {
    display: none;
}

.nav-logo-icon {
    display: none;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    vertical-align: middle;
}

.nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

.nav-link.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

/* --- DROPDOWN GARAJE --- */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.nav-dropdown-toggle {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-transform: none;
    vertical-align: middle;
}

.nav-dropdown-toggle:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: rgba(30,30,30,0.98);
    border-radius: 8px;
    min-width: 140px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 100;
    border: 1px solid rgba(225, 6, 0, 0.2);
}

.nav-dropdown-link {
    display: block;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 10px 16px;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-dropdown-link:first-child {
    border-radius: 8px 8px 0 0;
}

.nav-dropdown-link:last-child {
    border-radius: 0 0 8px 8px;
}

.nav-dropdown-link:hover {
    color: white;
    background: var(--red);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-user-info {
    text-align: right;
}

.nav-user-name {
    font-size: 14px;
    font-weight: 500;
}

.nav-user-team {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

.nav-user-money {
    font-size: 12px;
    color: #2ecc71;
    font-weight: 600;
}

.nav-user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--red), #c10500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* --- NAVBAR MÓVIL (TODOS LOS DISPOSITIVOS) --- */
.nav-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
}

.hamburger {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--red);
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.3s;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: #000;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger.active {
    background: #000;
}

.hamburger.active .hamburger-line {
    background: var(--red);
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

.nav-mobile-menu {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--dark);
    z-index: 95;
    padding: 16px;
    transform: translateX(-100%);
    transition: transform 0.3s;
    overflow-y: auto;
}

.nav-mobile-menu.active {
    transform: translateX(0);
}

.nav-mobile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.nav-mobile-link:hover {
    background: rgba(255,255,255,0.05);
}

.nav-mobile-section {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 16px 8px;
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-mobile-section:first-child {
    margin-top: 0;
    border-top: none;
}

.nav-mobile-sub {
    padding-left: 32px;
    font-size: 14px;
}

.nav-mobile-logout {
    color: var(--red);
}

/* Dropdown móvil desplegable */
.nav-mobile-dropdown {
    margin-bottom: 8px;
}

.nav-mobile-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    text-transform: none;
}

.nav-mobile-dropdown-toggle:hover {
    background: rgba(255,255,255,0.05);
}

.nav-mobile-dropdown-toggle.active {
    background: rgba(255,255,255,0.05);
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.nav-mobile-dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-mobile-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-mobile-dropdown-menu.show {
    max-height: 500px;
}

/* Sub-dropdown para pilotos dentro de Garaje */
.nav-mobile-sub-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px 14px 24px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-transform: none;
    border-radius: 12px;
    margin-bottom: 4px;
}

.nav-mobile-sub-toggle:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-mobile-sub-toggle.active {
    color: white;
    background: rgba(225, 6, 0, 0.2);
}

.nav-mobile-sub-toggle .dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.nav-mobile-sub-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-mobile-sub-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 4px;
}

.nav-mobile-sub-dropdown.show {
    max-height: 500px;
}

.nav-mobile-sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 10px 32px !important;
    font-size: 13px;
}

.piloto-menu-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e10600, #ff6b6b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.piloto-menu-media {
    margin-left: auto;
    font-size: 12px;
}

.nav-mobile-dropdown-menu .nav-mobile-link {
    margin-bottom: 4px;
}

.nav-mobile-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
}

/* --- CONTENIDO PRINCIPAL PADDOCK --- */
.paddock-main {
    padding: 88px 24px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.paddock-header {
    margin-bottom: 32px;
}

.paddock-header h1 {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
}

.paddock-header p {
    color: rgba(255,255,255,0.6);
}

.paddock-content {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    min-height: 300px;
    margin-bottom: 24px;
}

.paddock-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: rgba(255,255,255,0.4);
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.paddock-placeholder p {
    font-size: 18px;
    margin-bottom: 8px;
}

.paddock-placeholder span {
    font-size: 14px;
}

.ad-section {
    background: rgba(30,30,30,0.8);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 30px;
    border: 1px dashed #444;
    text-align: center;
}
.ad-section h4 {
    margin: 15px 0 10px;
    text-transform: uppercase;
}
.ad-section p {
    color: #aaa;
    margin-bottom: 20px;
}
.btn-bonus {
    background: #fff;
    color: #000;
    padding: 18px 40px;
    border-radius: 50px;
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}
.btn-bonus:hover {
    background: #f0f0f0;
    transform: scale(1.02);
}
.alert {
    background: #008800;
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
}

/* --- CONFIGURACIÓN --- */
.config-section {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
}

.config-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.config-form {
    max-width: 400px;
}

.config-description {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.form-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.form-message.error {
    display: block;
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: rgba(225, 6, 0, 0.5);
}

.btn-save {
    background: var(--red);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save:hover {
    background: var(--red-dark);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
}

/* Select desplegable */
.config-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.config-select:focus {
    outline: none;
    border-color: rgba(225, 6, 0, 0.5);
}

.config-select option {
    background: #1a1a1a;
    color: white;
}

/* Language Grid */
.lang-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Zona Peligrosa */
.config-danger {
    border: 1px solid rgba(225, 6, 0, 0.3);
    background: rgba(225, 6, 0, 0.05);
}

.config-title-danger {
    color: #ff6b6b !important;
}

.config-danger-text {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    margin-bottom: 16px;
}

.btn-danger {
    background: rgba(225, 6, 0, 0.2);
    border: 1px solid var(--red);
    color: #ff6b6b;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: var(--red);
    color: white;
}

/* Modal de Eliminación */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #1a1a1a;
    border: 1px solid rgba(225, 6, 0, 0.3);
    border-radius: 20px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-bottom: 12px;
}

.modal-text {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.modal-subtext {
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    margin-bottom: 12px;
}

.modal-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    color: white;
    font-size: 16px;
    text-align: center;
    box-sizing: border-box;
    margin-bottom: 20px;
}

.modal-input:focus {
    outline: none;
    border-color: var(--red);
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

.btn-cancel {
    flex: 1;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: rgba(255,255,255,0.15);
}

.btn-confirm-delete {
    flex: 1;
    padding: 12px;
    background: var(--red);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm-delete:hover:not(:disabled) {
    background: #c10500;
}

.btn-confirm-delete:disabled {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.3);
    cursor: not-allowed;
}

.lang-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.lang-btn.active {
    background: var(--red);
    border-color: var(--red);
    color: white;
}

/* Toggle List */
.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toggle-list-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

.toggle-list-inline .toggle-item {
    flex: 0 0 auto;
    min-width: 120px;
}

.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 8px 0;
}

.toggle-item span:first-child {
    color: rgba(255,255,255,0.8);
}

.toggle-item input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
}

.toggle-item input:checked + .toggle-slider {
    background: var(--red);
}

.toggle-item input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .paddock-main {
        padding-top: 72px;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .paddock-header h1 {
        font-size: 24px;
    }
    
    .config-section {
        padding: 16px;
    }
    
    .config-form {
        max-width: 100%;
    }
    
    .ad-section {
        padding: 24px;
    }
}
/* --- MENSAJES CON ESTILO --- */
.message-box {
    text-align: center;
}
.message-box h2 {
    margin-bottom: 10px;
}
.message-icon {
    font-size: 48px;
    margin-bottom: 15px;
}
.message-text {
    font-size: 16px;
    color: #555;
    margin: 15px 0;
    line-height: 1.6;
}
/* --- NOTIFICACIÓN FLOTANTE --- */
.success-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #2ecc71;
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 9999;
    animation: slideDown 0.5s ease;
}
@keyframes slideDown {
    from { top: -50px; opacity: 0; }
    to { top: 20px; opacity: 1; }
}
/* --- NOTIFICACIÓN DE ERROR --- */
.error-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #f39c12;
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 9999;
    animation: slideDown 0.5s ease;
}
/* --- BANNER DE ERROR EN FORMULARIOS --- */
.error-banner {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    text-align: left;
}
/* ===========================================
   BANNER DE COOKIES
   =========================================== */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    color: #fff;
    padding: 15px 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    z-index: 99999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
#cookie-banner.cookie-visible {
    transform: translateY(0);
}
#cookie-banner.cookie-hidden {
    transform: translateY(100%);
}
.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}
.cookie-text {
    flex: 1;
    min-width: 250px;
}
.cookie-text strong {
    color: #e10600;
    font-size: 16px;
    display: block;
    margin-bottom: 5px;
}
.cookie-text p {
    margin: 0;
    font-size: 13px;
    color: #ccc;
    line-height: 1.5;
}
.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.cookie-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: all 0.2s ease;
}
.cookie-btn-primary {
    background: #e10600;
    color: white;
}
.cookie-btn-primary:hover {
    background: #c1121f;
}
.cookie-btn-secondary {
    background: #333;
    color: #fff;
    border: 1px solid #555;
}
.cookie-btn-secondary:hover {
    background: #444;
}
@media (max-width: 600px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }
    .cookie-btn {
        flex: 1;
        min-width: 120px;
    }
}
/* ===========================================
   VER ANUNCIO - PÁGINA DE PATROCINIO
   =========================================== */
body.ad-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #1a1a1a;
    color: white;
    text-align: center;
    padding: 50px;
}
body.ad-page h2 {
    color: white;
    text-transform: uppercase;
    letter-spacing: 2px;
}
body.ad-page p {
    margin-bottom: 20px;
}
.ad-box {
    background: white;
    color: black;
    padding: 30px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.ad-placeholder {
    width: 300px;
    height: 250px;
    background: #eee;
    border: 2px dashed #bbb;
    line-height: 250px;
    color: #888;
    font-weight: bold;
    margin-bottom: 20px;
    border-radius: 10px;
}
.btn-confirm {
    background: #cc0000;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    transition: 0.3s;
    width: 100%;
}
.btn-confirm:hover {
    background: #aa0000;
}
/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 480px) {
    .card {
        padding: 20px;
        max-width: 90%;
    }
    
    .navbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .paddock-card {
        padding: 20px;
    }
    
    .money-display {
        font-size: 28px;
    }
    
    .ad-placeholder {
        width: 250px;
        height: 200px;
        line-height: 200px;
    }
}

/* ===========================================
   SELECTOR DE IDIOMA
   =========================================== */
.lang-selector {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 9999;
}
.lang-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    color: #000;
    transition: all 0.2s;
}
.lang-toggle:hover {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.lang-icon {
    font-size: 18px;
}
.lang-text {
    color: #000;
}
.lang-arrow {
    font-size: 10px;
    color: #000;
    transition: transform 0.2s;
}
.lang-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    overflow: hidden;
    display: none;
    min-width: 150px;
}
.lang-dropdown.show {
    display: block;
}
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 15px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    color: #000;
    transition: background 0.2s;
}
.lang-option:hover {
    background: #f5f5f5;
}
.lang-option.active {
    background: #e10600;
    color: white;
}
.lang-flag {
    font-size: 18px;
}
@media (max-width: 480px) {
    .lang-selector {
        top: 10px;
        left: 10px;
    }
    .lang-toggle {
        padding: 6px 10px;
        font-size: 12px;
    }
    .lang-text {
        display: none;
    }
}

/* ===========================================
   PÁGINA PILOTO
   =========================================== */
.piloto-section {
    width: 100%;
    max-width: 100%;
}

.section-title {
    color: white;
    font-size: 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.piloto-card {
    background: rgba(30,30,30,0.95);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(225, 6, 0, 0.2);
}

.piloto-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.piloto-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--red), #c10500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: white;
}

.piloto-info {
    flex: 1;
}

.piloto-name {
    color: white;
    font-size: 24px;
    margin: 0 0 5px 0;
}

.piloto-number {
    color: var(--red);
    font-size: 18px;
    margin: 0;
    font-weight: 600;
}

.piloto-stats {
    color: rgba(255,255,255,0.8);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: rgba(255,255,255,0.5);
}

.stat-value {
    color: white;
    font-weight: 500;
}

.no-piloto-msg {
    text-align: center;
    color: rgba(255,255,255,0.5);
    padding: 20px;
}

/* ===========================================
   EDICIÓN DE NÚMERO DE PILOTO
   =========================================== */
.piloto-number-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.edit-link {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.edit-link:hover {
    color: var(--red);
}

.piloto-number-edit {
    display: flex;
    align-items: center;
    gap: 10px;
}

.number-input {
    width: 60px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.number-input:focus {
    outline: none;
    border-color: var(--red);
}

/* Ocultar flechas del input number */
.number-input::-webkit-outer-spin-button,
.number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.number-input[type=number] {
    -moz-appearance: textfield;
}

.save-link {
    color: var(--green);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.save-link:hover {
    color: #27ae60;
}

/* ===========================================
   CÍRCULO INFO CON GLOBO TOOLTIP
   =========================================== */
.info-icon {
    width: 12px;
    height: 12px;
    background: transparent;
    border: 1.5px solid var(--red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
    color: var(--red);
    cursor: pointer;
    font-style: italic;
    transition: all 0.2s;
}

.info-icon:hover {
    background: var(--red);
    color: white;
}

/* Globo tipo chat 💬 */
.info-bubble {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30,30,30,0.98);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12px;
    color: white;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

/* Flecha del globo */
.info-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(30,30,30,0.98);
}

.info-bubble.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 480px) {
    .info-bubble {
        font-size: 11px;
        padding: 8px 12px;
        white-space: normal;
        min-width: 180px;
        text-align: center;
    }
}

/* ===========================================
   SUB-DROPDOWN DE PILOTOS (NUEVO)
   =========================================== */

.pilotos-dropdown-wrapper {
    width: 100%;
}

.nav-mobile-sub-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px 14px 24px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    border-radius: 10px;
    margin-bottom: 4px;
    text-align: left;
}

.nav-mobile-sub-toggle:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.nav-mobile-sub-toggle.active {
    color: white;
    background: rgba(225, 6, 0, 0.25);
}

.nav-mobile-sub-toggle .dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.nav-mobile-sub-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.nav-mobile-sub-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    margin: 0 4px 8px 4px;
}

.nav-mobile-sub-dropdown.show {
    max-height: 400px;
}

.nav-mobile-sub-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px !important;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 2px 4px;
}

.nav-mobile-sub-item:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.08);
}

.piloto-avatar {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e10600, #ff4444);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.piloto-nombre {
    flex: 1;
    font-size: 14px;
}

.piloto-media {
    font-size: 13px;
    font-weight: bold;
    color: #4caf50;
}

/* ===========================================
   CARRERAS DE PRUEBA - PADDOCK
   =========================================== */
.test-races-section {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.section-title {
    font-size: 28px;
    color: var(--red);
    margin: 0 0 10px 0;
    font-weight: 700;
    text-transform: uppercase;
}

.section-subtitle {
    color: #666;
    font-size: 14px;
    margin: 0 0 30px 0;
}

.test-races-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.test-race-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
}

.test-race-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(225, 6, 0, 0.2);
    border-color: var(--red);
}

.race-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.test-race-card h3 {
    font-size: 22px;
    color: var(--text-dark);
    margin: 0 0 10px 0;
    font-weight: 700;
}

.test-race-card p {
    color: #666;
    font-size: 14px;
    margin: 0 0 20px 0;
}

.race-features {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
    text-align: left;
}

.race-features li {
    padding: 8px 0;
    color: #555;
    font-size: 14px;
    border-bottom: 1px solid #e0e0e0;
}

.race-features li:last-child {
    border-bottom: none;
}

.btn-race {
    width: 100%;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-race-2d {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-race-2d:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: scale(1.05);
}

.btn-race-3d {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-race-3d:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    transform: scale(1.05);
}

/* ===========================================
   PÁGINA DE CARRERA - LAYOUT
   =========================================== */
.race-page {
    margin: 0;
    padding: 0;
    background: #0d0d0d;
    overflow: hidden;
}

.race-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.race-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 15px 30px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    z-index: 100;
}

.race-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--red);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.race-info {
    display: flex;
    gap: 30px;
    align-items: center;
}

.race-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.race-stat-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.race-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: white;
    font-family: 'Courier New', monospace;
}

.race-viewport {
    flex: 1;
    position: relative;
    background: #1a1a1a;
    overflow: hidden;
}

#raceCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.race-controls {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
    z-index: 100;
}

.controls-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-control {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-control-primary {
    background: var(--red);
    color: white;
}

.btn-control-primary:hover {
    background: var(--red-dark);
    transform: scale(1.05);
}

.btn-control-secondary {
    background: #444;
    color: white;
}

.btn-control-secondary:hover {
    background: #555;
}

.btn-control-success {
    background: var(--green);
    color: white;
}

.btn-control-success:hover {
    background: #27ae60;
}

.speed-selector {
    display: flex;
    gap: 10px;
}

.btn-speed {
    padding: 10px 20px;
    border: 2px solid #444;
    background: transparent;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 700;
}

.btn-speed.active {
    background: var(--red);
    border-color: var(--red);
}

.btn-speed:hover {
    border-color: var(--red);
}

.race-leaderboard {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    padding: 20px;
    border-radius: 12px;
    min-width: 350px;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 50;
}

.leaderboard-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--red);
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--red);
    padding-bottom: 10px;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 40px 1fr 80px 100px;
    gap: 10px;
    padding: 10px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: white;
    font-size: 14px;
    align-items: center;
    transition: background 0.3s;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.leaderboard-item.first {
    background: rgba(255, 215, 0, 0.15);
    border-left: 3px solid gold;
}

.leaderboard-item.second {
    background: rgba(192, 192, 192, 0.15);
    border-left: 3px solid silver;
}

.leaderboard-item.third {
    background: rgba(205, 127, 50, 0.15);
    border-left: 3px solid #cd7f32;
}

.leaderboard-pos {
    font-weight: 700;
    font-size: 18px;
    text-align: center;
    color: var(--red);
}

.leaderboard-name {
    font-weight: 600;
}

.leaderboard-gap {
    font-family: 'Courier New', monospace;
    color: #999;
    font-size: 12px;
}

.leaderboard-time {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #0ff;
}

.camera-selector {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
}

.btn-camera {
    padding: 12px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.btn-camera.active {
    background: var(--red);
    border-color: var(--red);
}

.btn-camera:hover {
    background: rgba(225, 6, 0, 0.8);
    border-color: var(--red);
}

/* Responsive */
@media (max-width: 768px) {
    .race-leaderboard {
        min-width: 280px;
        font-size: 12px;
    }
    
    .leaderboard-item {
        grid-template-columns: 30px 1fr 60px 80px;
        padding: 8px;
    }
    
    .race-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .controls-group {
        width: 100%;
        justify-content: center;
    }
}
