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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #212121; /* Темная тема TG */
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

header p {
    font-size: 14px;
    color: #aaaaaa;
    margin-bottom: 24px;
}

/* Область камеры */
#reader-wrapper {
    width: 100%;
    aspect-ratio: 1.0;
    border-radius: 16px;
    overflow: hidden;
    background-color: #17212b;
    border: 2px dashed #2481cc;
    margin-bottom: 24px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#reader {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

#reader video {
    object-fit: cover !important;
}

/* Кнопки */
.controls {
    width: 100%;
}

.btn {
    display: block;
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    background-color: #2481cc; /* Синий цвет Telegram */
    color: #ffffff;
}

.btn:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: #e53935; /* Красный для закрытия */
    margin-top: 12px;
}

/* Красивое модальное окно статуса */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background-color: #181818;
    border-radius: 16px;
    padding: 30px;
    max-width: 320px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border: 1px solid #333333;
}

.modal-content h3 {
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.modal-content p {
    font-size: 14px;
    color: #aaaaaa;
}

/* Спиннер загрузки */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(36, 129, 204, 0.2);
    border-top: 4px solid #2481cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
