/*
 * HoloRyn TCG
 * Scanner UI V2
 *
 * PRESENTATION ONLY.
 * Does not perform recognition, OCR or saving.
 */

body.hr-scanner-v2-open {
    overflow-x:hidden;
}

.hr-scanner-v2 {
    position:relative;
}

/* -----------------------------------------------
   CAMERA
------------------------------------------------ */

.hr-scanner-v2 #guidedCamera.inline-camera {
    position:relative;
    margin:0;
    width:100%;
    border:0;
    border-radius:22px;
    overflow:hidden;
    background:#05070b;
}

.hr-scanner-v2 #guidedCamera.inline-camera .camera-shell {
    --camera-fixed-height:min(72vh,760px);

    position:relative !important;
    width:100% !important;

    height:var(--camera-fixed-height) !important;
    min-height:var(--camera-fixed-height) !important;
    max-height:var(--camera-fixed-height) !important;

    border-radius:22px !important;
    overflow:hidden !important;

    background:#05070b !important;
    border:1px solid rgba(255,255,255,.10) !important;

    box-shadow:
        0 20px 55px rgba(0,0,0,.30);
}

.hr-scanner-v2 #guidedCameraVideo,
.hr-scanner-v2 #guidedCameraPreview {
    width:100% !important;
    height:100% !important;
    object-fit:cover !important;
}

/* -----------------------------------------------
   RAW / SLAB SWITCH
------------------------------------------------ */

.hr-scanner-v2 .camera-mode-switch {
    display:flex !important;

    position:absolute !important;
    top:14px !important;
    left:50% !important;

    transform:translateX(-50%) !important;

    z-index:40 !important;

    padding:4px !important;

    border-radius:999px !important;

    background:rgba(7,10,15,.82) !important;
    border:1px solid rgba(255,255,255,.16) !important;

    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);

    box-shadow:0 8px 30px rgba(0,0,0,.28);
}

.hr-scanner-v2 .camera-mode-button {
    min-width:82px;

    padding:9px 18px !important;

    border:0 !important;
    border-radius:999px !important;

    background:transparent !important;
    color:rgba(255,255,255,.72) !important;

    font-size:14px !important;
    font-weight:700 !important;

    cursor:pointer;
}

.hr-scanner-v2 .camera-mode-button.active,
.hr-scanner-v2 .camera-mode-button[aria-pressed="true"] {
    background:#fff !important;
    color:#080b10 !important;

    box-shadow:0 4px 14px rgba(0,0,0,.22);
}

/* -----------------------------------------------
   CARD GUIDE
------------------------------------------------ */

.hr-scanner-v2 .camera-guide {
    z-index:15 !important;
}

.hr-scanner-v2 .camera-guide::after {
    content:"";

    position:absolute;
    inset:-10px;

    border-radius:inherit;

    box-shadow:
        0 0 0 999px rgba(0,0,0,.12);
}

/* -----------------------------------------------
   TAP INSTRUCTION
------------------------------------------------ */

.hr-scanner-v2 .camera-tap-hint {
    top:auto !important;
    bottom:88px !important;
    left:50% !important;
    right:auto !important;

    transform:translateX(-50%) !important;

    width:auto !important;
    max-width:calc(100% - 40px);

    padding:9px 15px !important;

    border-radius:999px !important;

    background:rgba(6,9,14,.80) !important;
    border:1px solid rgba(255,255,255,.14) !important;

    color:#fff !important;

    font-size:13px !important;
    font-weight:700 !important;
    text-align:center !important;

    backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);

    z-index:35 !important;
}

/* -----------------------------------------------
   STATUS
------------------------------------------------ */

.hr-scanner-v2 .camera-status {
    position:absolute !important;

    left:14px !important;
    right:14px !important;
    bottom:18px !important;

    z-index:34 !important;

    margin:0 !important;

    text-align:center !important;

    font-size:13px !important;

    color:#fff !important;

    text-shadow:0 1px 4px rgba(0,0,0,.8);
}

/* -----------------------------------------------
   SEARCH / SELECT CARD BUTTON
------------------------------------------------ */

.hr-scanner-actions {
    display:flex;

    gap:10px;

    margin-top:10px;
}

.hr-scanner-search-button {
    display:flex;
    align-items:center;
    justify-content:center;

    gap:8px;

    width:100%;
    min-height:50px;

    border:1px solid rgba(255,255,255,.12);
    border-radius:15px;

    background:#111721;
    color:#f6f8fb;

    font:inherit;
    font-weight:750;

    cursor:pointer;

    box-shadow:0 8px 22px rgba(0,0,0,.16);
}

.hr-scanner-search-button:active {
    transform:scale(.985);
}

.hr-scanner-search-icon {
    font-size:18px;
}

/* -----------------------------------------------
   BOTTOM SHEET
------------------------------------------------ */

.hr-scanner-sheet-backdrop {
    position:fixed;

    inset:0;

    z-index:1090;

    background:rgba(0,0,0,.56);

    opacity:0;
    pointer-events:none;

    transition:opacity .18s ease;
}

.hr-scanner-sheet-backdrop.open {
    opacity:1;
    pointer-events:auto;
}

.hr-scanner-sheet {
    position:fixed;

    left:0;
    right:0;
    bottom:0;

    z-index:1100;

    max-height:min(76vh,720px);

    display:flex;
    flex-direction:column;

    background:#0e131c;

    border:1px solid rgba(255,255,255,.10);
    border-bottom:0;

    border-radius:24px 24px 0 0;

    box-shadow:0 -18px 60px rgba(0,0,0,.42);

    transform:translateY(105%);

    transition:transform .22s ease;
}

.hr-scanner-sheet.open {
    transform:translateY(0);
}

.hr-scanner-sheet-handle {
    width:42px;
    height:5px;

    flex:0 0 auto;

    margin:8px auto 3px;

    border-radius:99px;

    background:rgba(255,255,255,.24);
}

.hr-scanner-sheet-header {
    display:flex;
    align-items:center;
    justify-content:space-between;

    gap:14px;

    padding:10px 16px 12px;

    border-bottom:1px solid rgba(255,255,255,.08);
}

.hr-scanner-sheet-title {
    min-width:0;
}

.hr-scanner-sheet-title strong {
    display:block;

    color:#fff;

    font-size:17px;
}

.hr-scanner-sheet-title small {
    display:block;

    margin-top:2px;

    color:rgba(255,255,255,.60);

    font-size:12px;
}

.hr-scanner-sheet-close {
    width:42px;
    height:42px;

    flex:0 0 42px;

    border:0;
    border-radius:50%;

    background:rgba(255,255,255,.08);
    color:#fff;

    font-size:22px;
    line-height:1;

    cursor:pointer;
}

.hr-scanner-sheet-content {
    overflow:auto;
    overscroll-behavior:contain;

    padding:14px 16px calc(22px + env(safe-area-inset-bottom));
}

/*
 * Existing controls are moved here by JavaScript.
 * Their IDs, inputs, event listeners and forms are NOT recreated.
 */

.hr-scanner-sheet-content > *:first-child {
    margin-top:0 !important;
}

.hr-scanner-sheet-content input[type="search"],
.hr-scanner-sheet-content input[type="text"],
.hr-scanner-sheet-content select {
    min-height:48px;
}

.hr-scanner-sheet-content button,
.hr-scanner-sheet-content .button,
.hr-scanner-sheet-content .btn {
    min-height:44px;
}

/* -----------------------------------------------
   DESKTOP
------------------------------------------------ */

@media (min-width:800px) {

    .hr-scanner-v2 #guidedCamera.inline-camera .camera-shell {
        --camera-fixed-height:min(74vh,780px);
    }

    .hr-scanner-v2 {
        max-width:820px;
        margin-left:auto;
        margin-right:auto;
    }

    .hr-scanner-sheet {
        left:50%;

        width:min(680px,calc(100% - 32px));

        border-radius:24px 24px 0 0;

        transform:translate(-50%,105%);
    }

    .hr-scanner-sheet.open {
        transform:translate(-50%,0);
    }
}

/* -----------------------------------------------
   SMALL MOBILE
------------------------------------------------ */

@media (max-width:480px) {

    .hr-scanner-v2 #guidedCamera.inline-camera .camera-shell {
        --camera-fixed-height:calc(
            100dvh - 215px
        );

        min-height:500px !important;
    }

    .hr-scanner-v2 .camera-mode-switch {
        top:10px !important;
    }

    .hr-scanner-v2 .camera-mode-button {
        min-width:72px;

        padding:8px 14px !important;
    }

    .hr-scanner-sheet {
        max-height:82dvh;
    }
}
