:root {
    --bg-dark: #121212;
    --bg-surface: #1e1e1e;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --primary: #ff9800;
    --primary-dark: #e65100;
    --success: #4caf50;
    --error: #f44336;
    --border: #333333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    user-select: none; /* Заборона виділення тексту для мобільних */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    width: 100%;
    max-width: 480px;
    position: relative;
}

.view {
    display: none;
    width: 100%;
    min-height: 100vh;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: flex;
    flex-direction: column;
}

.container {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Типографіка */
h1, h2 { font-weight: 600; }
.hint { text-align: center; color: var(--text-muted); font-size: 14px; margin-top: 16px; }

/* Форми та Кнопки */
input {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: white;
    font-size: 16px;
    margin-bottom: 12px;
    outline: none;
}

input:focus { border-color: var(--primary); }

button {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    min-height: 56px; /* Зручний розмір для пальця */
    transition: opacity 0.2s;
}

button:active { opacity: 0.8; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--bg-surface); color: var(--primary); border: 1px solid var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-text { background: transparent; color: var(--text-muted); width: auto; min-height: auto; padding: 8px; }

/* Сканер */
.scanner-header { display: flex; justify-content: space-between; align-items: center; padding: 24px; }
#qr-reader { width: 100%; border: none; background: #000; }
#qr-reader video { object-fit: cover; }

/* Картка */
.card-info { background: var(--bg-surface); padding: 24px; border-radius: 16px; text-align: center; }
.pass-id { font-size: 12px; color: var(--text-muted); margin: 8px 0; word-break: break-all; }
.balance-display { font-size: 32px; font-weight: bold; color: var(--primary); margin-top: 16px; }

.actions-grid { display: flex; flex-direction: column; gap: 12px; }
.custom-stamp-group { display: flex; gap: 12px; }
.custom-stamp-group input { margin-bottom: 0; width: 80px; text-align: center; }
.custom-stamp-group button { flex: 1; }

/* Сповіщення */
.alert { padding: 16px; border-radius: 12px; font-size: 14px; text-align: center; }
.alert.error { background: rgba(244, 67, 54, 0.1); color: var(--error); border: 1px solid var(--error); }
.alert.success { background: rgba(76, 175, 80, 0.1); color: var(--success); border: 1px solid var(--success); }
.alert.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }