@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    background: #000;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.container {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* Camera fills the whole screen. The modern Html5Qrcode API puts a plain
   <video> inside #reader, so this needs no hacks against library internals. */
#reader,
#reader video {
    width: 100%;
    height: 100%;
}

#reader video {
    display: block;
    object-fit: cover;
    background: #000;
}

/* Scanning frame + logo, drawn as an overlay rather than by restyling the
   library's own region element. */
#reader {
    position: absolute;
    inset: 0;
}

.scan-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250px;
    height: 250px;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(139, 69, 19, 0.9);
    border-radius: 12px;
    pointer-events: none;
    z-index: 5;
}

.scan-frame img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    transform: translate(-50%, -50%);
    opacity: 0.9;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    text-align: center;
    padding: calc(16px + env(safe-area-inset-top)) 16px 24px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent);
    pointer-events: none;
}

.logo {
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.header h1 {
    font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
    font-size: 24px;
    font-weight: 400;
    color: #fff;
    letter-spacing: 1px;
    margin-top: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 24px 16px calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
}

.footer a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #fff;
    font-size: 20px;
    text-decoration: none;
    border-radius: 50%;
    transition: background-color 0.2s, opacity 0.2s;
}

.footer a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.footer a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Loading and error states, so a denied camera says what happened and what
   to do next instead of leaving a black screen. */
.status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    display: none;
    width: min(320px, calc(100% - 48px));
    padding: 24px;
    text-align: center;
    color: #fff;
    background: rgba(20, 14, 10, 0.92);
    border: 1px solid rgba(139, 69, 19, 0.5);
    border-radius: 12px;
}

.status.is-visible {
    display: block;
}

.status p {
    font-size: 15px;
    line-height: 1.5;
}

.status button {
    margin-top: 16px;
    min-height: 44px;
    padding: 0 24px;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: #8b4513;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.status button:hover {
    background: #6b3410;
}

.status button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}