body {
    margin: 0;
    padding: 20px;
    font-family: Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(123, 220, 57, 0.14), transparent 28%),
        linear-gradient(135deg, #10151a, #151821, #0d1117, #12301f);
    background-size: 320% 320%;
    color: #e2e8f0;
    min-height: 100vh;
    animation: fondoMovimiento 8s ease infinite;
}

@keyframes fondoMovimiento {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.encabezado-app {
    max-width: 1000px;
    margin: 0 auto 14px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.encabezado-app h1 {
    margin: 0;
    color: #c8ff72;
    font-size: 2rem;
}

.logo-app {
    width: min(320px, 80%);
    height: auto;
    display: block;
    margin: 0 auto;
}

.encabezado-app p {
    margin: 5px 0 0;
    color: #94a3b8;
}

.contenedor {
    display: flex;
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.body-personajes .contenedor {
    height: calc(100vh - 360px);
    min-height: 330px;
}

.acciones-app {
    max-width: 1000px;
    margin: 0 auto 14px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.panel-izquierdo {
    width: 300px;
    background-color: rgba(26, 30, 36, 0.94);
    border: 1px solid rgba(123, 220, 57, 0.18);
    padding: 18px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.28);
    min-height: 0;
}

.titulo-panel {
    margin: 0 0 16px;
    color: #e2e8f0;
    font-size: 1.2rem;
}

.form-temporada select {
    width: 100%;
    padding: 10px;
    background: #0f1216;
    color: white;
    border: 1px solid #334155;
    border-radius: 6px;
    margin-bottom: 15px;
    cursor: pointer;
}

.form-sincronizar {
    margin: 0;
    width: 260px;
}

.btn-sincronizar {
    width: 100%;
    padding: 11px;
    border: 0;
    border-radius: 6px;
    background: #16a34a;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.btn-sincronizar:hover {
    background: #15803d;
    transform: translateY(-1px);
}

.btn-importar {
    background: #7bdc39;
    color: #102014;
    box-shadow: 0 0 14px rgba(123, 220, 57, 0.55);
    animation: flotarBoton 2s infinite ease-in-out;
}

.btn-importar:hover {
    background: #a7f35a;
    box-shadow: 0 0 22px rgba(167, 243, 90, 0.75);
}

.btn-importar:disabled {
    opacity: 0.8;
    cursor: wait;
}

@keyframes flotarBoton {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }

    100% {
        transform: translateY(0);
    }
}

.mensaje-sincronizacion {
    margin: 0;
    padding: 10px;
    border-radius: 6px;
    background: #0f2f1d;
    color: #86efac;
    font-size: 0.9rem;
    text-align: center;
}

.intro .mensaje-sincronizacion {
    margin-top: 15px;
}

.overlay-sincronizacion {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 8, 12, 0.86);
    backdrop-filter: blur(6px);
}

.overlay-contenido {
    width: min(520px, calc(100% - 40px));
    padding: 28px;
    border: 1px solid rgba(77, 215, 255, 0.4);
    border-radius: 8px;
    background: rgba(13, 17, 23, 0.88);
    box-shadow: 0 0 28px rgba(77, 215, 255, 0.22);
    text-align: center;
}

.overlay-contenido p {
    margin: 0 0 8px;
    color: #4dd7ff;
    font-weight: bold;
}

.overlay-contenido p + p {
    color: #dbeafe;
    font-weight: normal;
}

.carga-inicial {
    margin-top: 15px;
}

.carga-inicial p {
    margin: 0 0 6px;
    color: #c8ff72;
    font-weight: bold;
}

.carga-inicial p + p {
    color: #e2e8f0;
    font-weight: normal;
}

.portal-carga {
    position: relative;
    width: 82px;
    height: 82px;
    margin: 18px auto 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, #e7ff89 0 8%, #7bdc39 9% 24%, transparent 25%),
        conic-gradient(from 0deg, #c8ff72, #42ff8f, #1fbf5b, #e7ff89, #7bdc39, #c8ff72);
    border: 4px solid rgba(210, 255, 120, 0.85);
    box-shadow:
        0 0 18px rgba(123, 220, 57, 0.95),
        0 0 36px rgba(66, 255, 143, 0.65),
        inset 0 0 20px rgba(16, 32, 20, 0.55);
    animation: girarPortal 1s linear infinite, pulsoPortal 1.8s ease-in-out infinite;
}

.portal-carga::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    background:
        conic-gradient(from 120deg, transparent 0 18%, #0f7f3a 19% 28%, transparent 29% 44%, #e7ff89 45% 52%, transparent 53% 100%);
    filter: blur(1px);
    opacity: 0.75;
}

.portal-carga::after {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 15% 30%, #c8ff72 0 3px, transparent 4px),
        radial-gradient(circle at 85% 28%, #42ff8f 0 4px, transparent 5px),
        radial-gradient(circle at 70% 88%, #e7ff89 0 3px, transparent 4px),
        radial-gradient(circle at 20% 82%, #7bdc39 0 4px, transparent 5px);
    animation: orbitasPortal 2.4s linear infinite;
}

.portal-sincronizacion {
    background:
        radial-gradient(circle at 50% 50%, #d9fff6 0 8%, #4dd7ff 9% 24%, transparent 25%),
        conic-gradient(from 0deg, #4dd7ff, #7c5cff, #22d3ee, #d9fff6, #4dd7ff);
    border-color: rgba(77, 215, 255, 0.9);
    box-shadow:
        0 0 18px rgba(77, 215, 255, 0.95),
        0 0 36px rgba(124, 92, 255, 0.65),
        inset 0 0 20px rgba(13, 17, 23, 0.6);
}

@keyframes girarPortal {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes orbitasPortal {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(-360deg);
    }
}

@keyframes pulsoPortal {
    0% {
        filter: brightness(0.9);
    }

    50% {
        filter: brightness(1.35);
    }

    100% {
        filter: brightness(0.9);
    }
}

#buscadorPersonaje {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    background: #0f1216;
    color: white;
    border: 1px solid #334155;
    border-radius: 6px;
    margin-bottom: 12px;
}

#buscadorPersonaje::placeholder {
    color: #94a3b8;
}

.lista-personajes-contenedor {
    position: relative;
    flex: 1;
    min-height: 0;
    border: 1px solid #26313f;
    border-radius: 8px;
    background: #111720;
    overflow: hidden;
}

.lista-personajes-contenedor::before,
.lista-personajes-contenedor::after {
    content: "";
    position: absolute;
    left: 0;
    right: 8px;
    height: 20px;
    pointer-events: none;
    z-index: 2;
}

.lista-personajes-contenedor::before {
    top: 0;
    background: linear-gradient(#111720, transparent);
}

.lista-personajes-contenedor::after {
    bottom: 0;
    background: linear-gradient(transparent, #111720);
}

.lista-personajes {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    height: 100%;
    overflow-y: auto;
}

.lista-personajes::-webkit-scrollbar {
    width: 8px;
}

.lista-personajes::-webkit-scrollbar-track {
    background: #0f1216;
}

.lista-personajes::-webkit-scrollbar-thumb {
    background: linear-gradient(#7bdc39, #2563eb);
    border-radius: 20px;
}

.btn-personaje {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    background: none;
    color: #cbd5e1;
    border: none;
    border-bottom: 1px solid #1f242d;
    cursor: pointer;
    font-size: 0.82rem;
    transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.btn-personaje:hover {
    background-color: #244631;
    color: #c8ff72;
    padding-left: 16px;
}

.btn-personaje.activo {
    background: #172d1f;
    color: #c8ff72;
    font-weight: bold;
    border-top: 2px solid #7bdc39;
    border-bottom: 2px solid #7bdc39;
}

.panel-derecho {
    flex: 1;
    display: flex;
    gap: 20px;
    background-color: rgba(26, 30, 36, 0.94);
    border: 1px solid rgba(123, 220, 57, 0.18);
    padding: 20px;
    border-radius: 8px;
    min-height: 0;
    overflow: hidden;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.28);
}

.foto img {
    width: 170px;
    border-radius: 8px;
    border: 3px solid rgba(200, 255, 114, 0.55);
    background: #0f1216;
    box-shadow: 0 0 24px rgba(123, 220, 57, 0.22);
}

.info {
    flex: 1;
}

.info h2 {
    margin-top: 0;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(123, 220, 57, 0.25);
    padding-bottom: 10px;
    color: #c8ff72;
    font-size: 1.35rem;
}

.dato {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    font-size: 0.78rem;
}

.etiqueta {
    color: #94a3b8;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.72rem;
}

.label-formulario {
    margin-bottom: 5px;
}

.sin-resultados-item {
    padding: 10px;
    color: gray;
}

.oculto {
    display: none;
}

.valor {
    text-align: right;
    color: #e2e8f0;
    line-height: 1.2;
}

.badge {
    padding: 4px 9px;
    border-radius: 999px;
    font-weight: bold;
}

.badge.Alive {
    background: #166534;
    color: #86efac;
}

.badge.Dead {
    background: #991b1b;
    color: #fca5a5;
}

.badge.unknown {
    background: #374151;
    color: #d1d5db;
}

@media (max-width: 800px) {
    body {
        padding: 10px;
    }

    .encabezado-app {
        margin-bottom: 8px;
    }

    .encabezado-app h1 {
        font-size: 1.7rem;
    }

    .logo-app {
        width: min(260px, 82%);
    }

    .contenedor {
        flex-direction: column;
        gap: 10px;
    }

    .acciones-app {
        display: block;
        margin-bottom: 14px;
        text-align: center;
    }

    .form-sincronizar {
        width: 100%;
    }

    .acciones-app .mensaje-sincronizacion {
        margin-top: 10px;
    }

    .body-personajes .contenedor {
        height: auto;
        min-height: 0;
    }

    .panel-izquierdo {
        width: auto;
        padding: 14px;
    }

    .titulo-panel {
        margin-bottom: 10px;
        font-size: 1.25rem;
    }

    .etiqueta {
        font-size: 0.68rem;
    }

    .form-temporada select,
    #buscadorPersonaje {
        padding: 8px;
        font-size: 0.82rem;
        margin-bottom: 10px;
    }

    .lista-personajes {
        height: 92px;
    }

    .lista-personajes-contenedor {
        flex: none;
    }

    .panel-derecho {
        flex-direction: column;
        gap: 10px;
        padding: 14px;
        max-height: none;
    }

    .foto img {
        width: 100%;
        max-width: 120px;
        display: block;
        margin: 0 auto;
    }

    .info h2 {
        margin-bottom: 8px;
        padding-bottom: 8px;
        font-size: 1.15rem;
    }

    .dato {
        padding: 5px 0;
        font-size: 0.72rem;
    }

    .valor {
        max-width: 58%;
    }
}


.body-inicio {
    min-height: 100vh;
    background-image: url('../img/bg_inicio_rick_morty.jpg');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.body-inicio::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(white 1px, transparent 1px),
        radial-gradient(white 1px, transparent 1px);
    background-size: 90px 90px, 140px 140px;
    background-position: 0 0, 40px 60px;
    opacity: 0.35;
    animation: estrellas 3s infinite alternate;
    pointer-events: none;
}

@keyframes estrellas {
    from {
        opacity: 0.15;
    }

    to {
        opacity: 0.45;
    }
}

.intro {
    position: relative;
    max-width: 520px;
    margin: 80px auto;
    background-color: rgba(26, 30, 36, 0.88);
    border: 1px solid #2d333b;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
}

.intro h1 {
    margin-top: 0;
}

.intro .logo-app {
    margin-bottom: 14px;
}

.intro p {
    color: #cbd5e1;
}
