.s-alpr__stage {
    --alpr-t: 9s;
    position: relative;
}

.s-alpr__screen {

    --px: 51.4%;
    --py: 42.4%;
    --pw: 5%;
    --ph: 6.6%;
    position: relative;
    aspect-ratio: 1380 / 591;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #0b0b0c;
}

.s-alpr__game {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.s-alpr__screen::after {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 42%),
        radial-gradient(120% 90% at 55% 50%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .4) 100%);
    content: "";
    pointer-events: none;
}

.s-alpr__aim {
    position: absolute;
    z-index: 1;
    top: var(--py);
    left: var(--px);
    width: calc(var(--pw) + 18px);
    height: calc(var(--ph) + 14px);
    border: 1px solid rgba(0, 207, 255, .7);
    border-radius: 6px;
    translate: -50% -50%;
}

.s-alpr__scan {
    position: absolute;
    right: -1px;
    bottom: -5px;
    left: -1px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #00cfff, #0047ff);
    transform-origin: left center;
}

.s-alpr__cursor {
    position: absolute;
    z-index: 2;
    top: calc(var(--py) + .6%);
    left: calc(var(--px) + .6%);
    width: clamp(16px, 1.6vw, 24px);
    height: auto;
    fill: #fff;
    stroke: #000;
    stroke-width: 1.3;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55));
}

.s-alpr__keys {
    position: absolute;
    z-index: 2;
    right: 3%;
    bottom: 6%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.s-alpr__keys kbd {
    display: inline-grid;
    place-items: center;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-bottom-width: 3px;
    border-radius: 8px;
    padding: 0 12px;
    background: rgba(12, 12, 14, .86);
    color: #f4f4f5;
    font-family: Satoshi, "Inter", sans-serif;
    font-size: 13px;
    font-weight: 600;
}

.s-alpr__keys small {
    border-radius: 999px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, .6);
    color: #5fd8ff;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 12.5px;
}

.s-alpr__float {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: flex;
    align-items: center;
    padding-left: 3%;
    pointer-events: none;
}

.alpr-card {
    --ac: #f87171;
    position: relative;
    display: grid;
    width: 300px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 12px;
    padding: 8px 10px 10px;
    background: linear-gradient(180deg, #111215, #0c0d0f);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 24px 60px -24px rgba(0, 0, 0, .95);
    color: #f4f4f5;
    font-family: Satoshi, Inter, "Segoe UI", sans-serif;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    text-align: left;
    -webkit-font-smoothing: antialiased;
}

.alpr-card.is-alarm { border-color: rgba(248, 113, 113, .32); }
.alpr-card__head { display: flex; align-items: center; gap: 7px; min-height: 22px; }

.alpr-card__ic {
    display: grid;
    flex: none;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1px solid color-mix(in srgb, var(--ac), transparent 62%);
    border-radius: 7px;
    background: color-mix(in srgb, var(--ac) 14%, #000);
    color: var(--ac);
}

.alpr-card__ic svg { width: 13px; height: 13px; }
.alpr-card__label { flex: 1; min-width: 0; color: #f4f4f5; font-size: 12px; font-weight: 650; letter-spacing: -.005em; }
.alpr-card.is-alarm .alpr-card__label { color: #fca5a5; }
.alpr-card__x { display: grid; place-items: center; width: 22px; height: 22px; margin-right: -3px; color: #77777f; }
.alpr-card__x svg { width: 12px; height: 12px; }

.alpr-card__banner {
    margin: 8px 0 0;
    border: 1px solid #dc2626;
    border-radius: 8px;
    padding: 5px 8px;
    background: #b91c1c;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.alpr-card__id { display: flex; align-items: center; gap: 9px; margin-top: 8px; }

.alpr-card__plate {
    flex: none;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 7px;
    padding: 3px 8px;
    background: #060708;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6);
    font-family: ui-monospace, "SF Mono", Consolas, Menlo, monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .07em;
    line-height: 1.2;
}

.alpr-card__car { min-width: 0; overflow: hidden; color: #a1a1aa; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.alpr-card__rows { display: flex; flex-direction: column; margin-top: 8px; border-top: 1px solid rgba(255, 255, 255, .045); }

.alpr-card__row {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .045);
    padding: 4px 0;
    font-size: 11.5px;
    line-height: 1.35;
}

.alpr-card__row:last-child { border-bottom: 0; padding-bottom: 0; }
.alpr-card__row span { color: #a1a1aa; }
.alpr-card__row b { min-width: 0; font-weight: 600; }
.alpr-card__chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

.alpr-card__chips span {
    border: 1px solid rgba(251, 191, 36, .4);
    border-radius: 999px;
    padding: 1px 8px;
    background: rgba(251, 191, 36, .08);
    color: #fcd34d;
    font-size: 10.5px;
    font-weight: 650;
}

.alpr-card__life {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--ac);
    opacity: .7;
    transform-origin: left center;
    transform: scaleX(.55);
}

@media (prefers-reduced-motion: no-preference) {
    .js .s-alpr__cursor { animation: alpr-cursor var(--alpr-t) infinite both; }
    .js .s-alpr__aim { animation: alpr-aim var(--alpr-t) infinite both; }
    .js .s-alpr__scan { animation: alpr-scan var(--alpr-t) infinite both; }
    .js .s-alpr__keys kbd { animation: alpr-key var(--alpr-t) infinite both; }
    .js .s-alpr__keys small { animation: alpr-read var(--alpr-t) infinite both; }
    .js .alpr-card { animation: alpr-card var(--alpr-t) infinite both; }
    .js .alpr-card > div { animation: alpr-row var(--alpr-t) calc(var(--r) * 45ms) infinite both; }
    .js .alpr-card__life { animation: alpr-life var(--alpr-t) infinite both; }

    .js .s-alpr__stage:not(.is-live) * { animation-play-state: paused; }
}

@keyframes alpr-cursor {
    0% { opacity: 0; transform: translate(-120px, 90px); }
    4% { opacity: 1; transform: translate(-120px, 90px); animation-timing-function: cubic-bezier(.45, .05, .2, 1); }
    17%, 88% { opacity: 1; transform: none; }
    93%, 100% { opacity: 0; transform: none; }
}

@keyframes alpr-aim {
    0%, 16% { opacity: 0; transform: scale(1.12); }
    20%, 88% { opacity: 1; transform: none; }
    92%, 100% { opacity: 0; transform: none; }
}

@keyframes alpr-scan {
    0%, 22% { opacity: 1; transform: scaleX(0); animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
    28%, 88% { opacity: 1; transform: none; }
    92%, 100% { opacity: 0; transform: none; }
}

@keyframes alpr-key {
    0%, 18% { opacity: 0; transform: translateY(-6px); }
    19.5%, 24% { opacity: 1; transform: translateY(2px) scale(.96); }
    26.5%, 88% { opacity: 1; transform: none; }
    92%, 100% { opacity: 0; transform: none; }
}

@keyframes alpr-read {
    0%, 27% { opacity: 0; transform: translateX(-6px); }
    30%, 88% { opacity: 1; transform: none; }
    92%, 100% { opacity: 0; transform: none; }
}

@keyframes alpr-card {
    0%, 31% { opacity: 0; transform: translateX(-16px); animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
    35%, 88% { opacity: 1; transform: none; }
    93%, 100% { opacity: 0; transform: translateX(-8px); }
}

@keyframes alpr-row {
    0%, 32% { opacity: 0; transform: translateY(5px); animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
    37%, 100% { opacity: 1; transform: none; }
}

@keyframes alpr-life {
    0%, 33% { transform: scaleX(1); }
    92%, 100% { transform: scaleX(.3); }
}

@media (max-width: 1000px) {

    .s-alpr__screen { --px: 51.2%; --py: 48.1%; --pw: 8.6%; --ph: 7.8%; aspect-ratio: 16 / 10; }
    .s-alpr__keys { top: 5%; right: auto; bottom: auto; left: 4%; }

    .s-alpr__float {
        position: relative;
        inset: auto;
        display: block;
        width: min(330px, calc(100% - 24px));
        margin: -48px auto 0;
        padding: 0;
    }

    .alpr-card { width: 100%; }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 1000px) {
    .js .alpr-card { animation: none; }
    .js .alpr-card > div { animation-name: alpr-row-slot; }
    .js .alpr-card > div:first-child { animation: none; }
}

@keyframes alpr-row-slot {
    0%, 32% { opacity: .3; }
    37%, 88% { opacity: 1; }
    93%, 100% { opacity: .3; }
}

@media (max-width: 640px) {
    .s-alpr__screen { border-radius: 14px; }
    .s-alpr__aim { width: calc(var(--pw) + 12px); height: calc(var(--ph) + 10px); }
    .s-alpr__keys kbd { height: 28px; padding: 0 9px; font-size: 11.5px; }
    .s-alpr__keys small { padding: 4px 8px; font-size: 11px; }
}
