:root {
    --accent: #ff4757;
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --glass-bg: rgba(255, 255, 255, 0.1);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-gradient);
    font-family: 'Quicksand', sans-serif;
    color: white;
    padding: 20px;
    box-sizing: border-box;
}


.main-layout {
    display: flex;
    flex-direction: column; 
    align-items: center;
    gap: 30px;
    width: 100%;
    max-width: 500px; 
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 35px;
    padding: 2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}


.scanner-section {
    width: 100%;
    text-align: center;
}

.title {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: var(--accent);
    margin: 0 0 10px 0;
}

.subtitle {
    margin-bottom: 20px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Cámara */
.camera-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 4px solid white;
    margin-bottom: 20px;
    width: 100%;
    aspect-ratio: 4/3; 
    background: #000;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-bar {
    position: absolute;
    top: 0;
    width: 100%;
    height: 4px;
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
    animation: scanning 2.5s infinite ease-in-out;
}

/* Botón */
button {
    font-family: 'Fredoka One', cursive;
    background: white;
    color: var(--accent);
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
    width: 100%; 
    max-width: 300px;
}

button:hover {
    transform: scale(1.05);
    background: var(--accent);
    color: white;
}

.side-guide {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.guide-title {
    font-family: 'Fredoka One', cursive;
    color: var(--accent);
    text-align: center;
    margin-top: 0;
    font-size: 1.2rem;
}

.guide-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 10px;
}

.guide-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.emoji {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
    border-radius: 8px;
    font-size: 1.1rem;
}


#result-container {
    width: 100%;
    margin-top: 20px;
}

.image-frame {
    width: 200px;
    height: 200px;
    margin: 15px auto;
    border: 4px solid white;
    border-radius: 20px;
    overflow: hidden;
}

#pibble-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hidden { display: none; }
.divider { height: 1px; background: rgba(255,255,255,0.2); margin: 20px 0; }

/* Animaciones */
@keyframes scanning {
    0%, 100% { top: 0%; }
    50% { top: 98%; }
}


@media (min-width: 900px) {
    .main-layout {
        flex-direction: row;
        max-width: 850px;
    }
    .guide-list {
        grid-template-columns: 1fr; 
    }
}