*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Inter,Arial,sans-serif;
}

body{
    background:#050505;
    color:#fff;
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    padding:30px;
}

.container{
    width:100%;
    max-width:650px;
}

h1{
    text-align:center;
    font-size:42px;
    font-weight:700;
}

.subtitle{
    text-align:center;
    color:#888;
    margin:10px 0 35px;
}

.card{
    background:#0d0d0d;
    border:2px solid #222;
    border-radius:24px;
    padding:25px;
}

.camera{
    position:relative;
    width:100%;
    aspect-ratio:1/1;
    border-radius:20px;
    overflow:hidden;
    background:#000;
}

video,
canvas{
    width:100%;
    height:100%;
    object-fit:cover;
}

.scan-frame{
    position:absolute;
    top:50%;
    left:50%;
    width:220px;
    height:220px;
    transform:translate(-50%,-50%);
    border:3px solid #fff;
    border-radius:20px;
    pointer-events:none;
    animation:pulse 2s infinite;
}

.scan-frame::before,
.scan-frame::after{
    content:"";
    position:absolute;
    width:35px;
    height:35px;
    border:4px solid #fff;
}

.scan-frame::before{
    top:-4px;
    left:-4px;
    border-right:none;
    border-bottom:none;
}

.scan-frame::after{
    bottom:-4px;
    right:-4px;
    border-left:none;
    border-top:none;
}

.loading{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.45);
    backdrop-filter:blur(10px);
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:18px;
}

.hidden{
    display:none;
}

.spinner{
    width:60px;
    height:60px;
    border:4px solid rgba(255,255,255,.2);
    border-top:4px solid #fff;
    border-radius:50%;
    animation:spin .8s linear infinite;
}

.loading p{
    font-size:18px;
}

.buttons{
    display:flex;
    gap:15px;
    margin-top:25px;
}

.buttons button{
    flex:1;
    background:#fff;
    color:#000;
    border:none;
    border-radius:16px;
    padding:16px;
    font-size:17px;
    font-weight:600;
    cursor:pointer;
    transition:.2s;
}

.buttons button:hover{
    transform:translateY(-2px);
}

.buttons button:active{
    transform:scale(.98);
}

.result{
    margin-top:25px;
    background:#111;
    border:2px solid #222;
    border-radius:16px;
    padding:18px;
    text-align:center;
    color:#bbb;
    word-break:break-word;
}

@keyframes spin{

    from{
        transform:rotate(0deg);
    }

    to{
        transform:rotate(360deg);
    }

}

@keyframes pulse{

    0%{
        transform:translate(-50%,-50%) scale(1);
        opacity:1;
    }

    50%{
        transform:translate(-50%,-50%) scale(1.03);
        opacity:.7;
    }

    100%{
        transform:translate(-50%,-50%) scale(1);
        opacity:1;
    }

}

@media(max-width:600px){

    h1{
        font-size:34px;
    }

    .buttons{
        flex-direction:column;
    }

    .scan-frame{
        width:180px;
        height:180px;
    }

}