:root {
    --bg: #f8f4ef;
    --card: #ffffff;
    --text: #3d3229;
    --text2: #7a6b5d;
    --accent: #c4956a;
    --accent2: #d4a87a;
    --border: #e8e0d6;
    --green: #7db88a;
    --yellow: #d4b86a;
    --red: #c98a84;
    --shadow: 0 2px 20px rgba(120,100,80,0.08);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

#app { max-width: 460px; margin: 0 auto; padding: 16px; min-height: 100vh; position: relative; }

/* Progress */
.progress-bar { margin-bottom: 20px; }
.progress-text { font-size: 11px; color: var(--text2); margin-bottom: 4px; letter-spacing: 0.3px; }
.progress-track { height: 2px; background: var(--border); border-radius: 1px; }
.progress-fill { height: 100%; background: var(--accent); transition: width 0.4s; width: 0%; }

/* Screen number — почти незаметный, верхний левый угол */
.screen-number {
    position: fixed;
    top: 5px;
    left: 8px;
    color: rgba(61, 50, 41, 0.28);
    font-size: 10px;
    font-weight: 400;
    line-height: 1;
    z-index: 50;
    pointer-events: none;
    user-select: none;
}

/* Pause */
.pause-btn {
    position: fixed; top: 10px; right: 10px;
    background: var(--card); border: 1px solid var(--border);
    color: var(--text2); width: 32px; height: 32px; border-radius: 50%;
    font-size: 13px; cursor: pointer; z-index: 50;
    box-shadow: var(--shadow);
}

.screens-container { min-height: 400px; }

/* Card */
.card {
    background: var(--card);
    border-radius: 20px;
    padding: 28px 22px;
    box-shadow: var(--shadow);
    animation: slideUp 0.4s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 { font-size: 20px; font-weight: 700; margin-bottom: 14px; line-height: 1.3; }
h2 { font-size: 18px; font-weight: 600; margin-bottom: 14px; line-height: 1.4; color: var(--text); }

.q-text { font-size: 16px; line-height: 1.6; margin-bottom: 22px; color: var(--text); }

/* Options */
.opt {
    display: block; width: 100%; padding: 13px 16px; margin-bottom: 8px;
    background: var(--card); color: var(--text);
    border: 1.5px solid var(--border); border-radius: 12px;
    font-size: 15px; cursor: pointer; text-align: left;
    transition: all 0.2s;
}
.opt:hover { border-color: var(--accent); background: #fdf9f5; }
.opt.sel { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 500; }

/* Buttons */
.btn-primary {
    display: block; width: 100%; padding: 14px; border-radius: 12px;
    font-size: 15px; font-weight: 600; cursor: pointer; border: none;
    margin-top: 10px; min-height: 48px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    box-shadow: 0 4px 12px rgba(196,149,106,0.25);
    transition: all 0.2s;
    position: relative; overflow: hidden;
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(196,149,106,0.35); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: #d5cec6; box-shadow: none; cursor: default; }

.btn-outline {
    display: block; width: 100%; padding: 13px; border-radius: 12px;
    font-size: 15px; font-weight: 500; cursor: pointer;
    background: transparent; color: var(--accent);
    border: 1.5px solid var(--accent);
    margin-top: 8px;
    transition: all 0.2s;
}
.btn-outline:hover { background: #fdf9f5; }

/* Slider */
.slider-wrap { padding: 16px 0; }
.slider-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.slider-val { text-align: center; font-size: 28px; font-weight: 700; color: var(--accent); margin: 6px 0; }
input[type="range"] {
    width: 100%; height: 4px; -webkit-appearance: none;
    background: var(--border); border-radius: 2px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 24px; height: 24px;
    background: var(--card); border: 2px solid var(--accent); border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Verse */
.verse {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 70vh; padding: 32px 16px; text-align: center;
}
.v-line {
    font-size: 20px; font-style: italic; color: #d4c5b9;
    margin-bottom: 14px; line-height: 1.7;
    font-family: Georgia, 'Times New Roman', serif;
}
.v-author {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 14px; color: #a08c7a; margin-top: 20px;
}

/* Breathing */
@keyframes br { 0%,100%{transform:scale(1);opacity:.6} 50%{transform:scale(1.3);opacity:1} }
.breath-circle {
    width: 100px; height: 100px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    margin: 16px auto; animation: br 16s ease-in-out infinite;
}
.breath-text { font-size: 15px; color: var(--text2); margin: 8px 0; }
.support-msg { font-size: 13px; color: var(--text2); margin: 12px 0 16px; line-height: 1.5; }

.hidden { display: none !important; }

/* Scene */
.scene {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 70vh; padding: 32px 20px; text-align: center;
    background: #1a1a2e; border-radius: 20px;
    animation: slideUp 0.5s ease;
}
.scene-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
    color: #c97b5d; margin-bottom: 12px;
}
.scene-text {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px; line-height: 1.7; color: #8a7a6a;
    margin-bottom: 20px;
}
.card > .scene-text,
.card > .scene-title {
    text-align: left;
}

/* Symbol circle */
.q-symbol {
    width: 44px; height: 44px; min-width: 44px;
    border-radius: 50%;
    background: #f0e8dd;
    border: 1.5px solid #e0d5c5;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
    color: #b8864a;
}
.q-symbol svg { width: 26px; height: 26px; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(61,50,41,0.3); backdrop-filter: blur(6px);
    z-index: 100; display: flex; align-items: center; justify-content: center;
}
.modal-card {
    background: var(--card); border-radius: 20px; padding: 32px 24px;
    max-width: 340px; width: 88%; text-align: center;
    box-shadow: 0 16px 40px rgba(0,0,0,0.1);
}

/* Legend */
.legend { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.lg { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-g { background: var(--green); }
.dot-y { background: var(--yellow); }
.dot-r { background: var(--red); }

/* Guide reply */
.guide-reply {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 14px;
    font-style: italic;
    color: #c97b5d;
    margin-bottom: 16px;
    padding: 8px 0;
    line-height: 1.5;
}

/* Revelation */
.revelation-card {
    text-align: center;
    padding: 32px 24px;
}
.revelation-icon {
    font-size: 32px;
    color: var(--accent);
    margin-bottom: 16px;
    font-family: Georgia, 'Times New Roman', serif;
}
.revelation-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 20px;
}

/* Reflection */
.reflection-label {
    font-size: 14px;
    color: var(--text2);
    margin-bottom: 10px;
    font-style: italic;
}
.reflection-input {
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 70px;
    margin-bottom: 16px;
    color: var(--text);
    background: #faf6f0;
}
.reflection-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Skip choice */
.skip-card {
    text-align: center;
}
.skip-question {
    font-size: 17px;
    margin-bottom: 20px;
}
.skip-opt {
    display: block;
    width: 100%;
    padding: 16px;
    margin-bottom: 10px;
    background: var(--card);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: 14px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.skip-opt:hover {
    border-color: var(--accent);
    background: #fdf9f5;
}
.skip-opt.sel {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Transition overlay */
.transition-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    animation: fadeIn 0.3s ease;
}
.transition-text {
    font-size: 15px;
    color: var(--text2);
    font-style: italic;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scene button */
.scene-btn {
    margin-top: 24px;
}

/* Event text (after skip choice) */
.event-text {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
    line-height: 1.7;
    color: #a08c7a;
    margin-bottom: 18px;
    padding: 12px 16px;
    background: #faf6f0;
    border-radius: 10px;
    font-style: italic;
}

/* Registration / contacts block — ближе к верху экрана */
#reg-screen {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    min-height: 100vh;
    padding-top: 24px;
    margin-top: -40px;
}
#reg-screen .card {
    width: 100%;
    margin-top: 0;
    padding: 20px 22px;
}
#reg-screen input {
    padding: 12px;
    border: 1px solid var(--border, #ddd);
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}
#reg-screen input:focus {
    border-color: var(--accent);
}

/* Consent screen */
.consent-screen {
    background: var(--bg);
    color: var(--text);
    font-family: Georgia, 'Times New Roman', serif;
    max-width: 480px;
    margin: -16px auto;
    padding: 40px 22px;
    min-height: 100vh;
    border-radius: 0;
}
.consent-photo { text-align: center; }
.consent-photo img {
    width: 80px; height: 80px; min-width: 80px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 12px;
    border: 2px solid var(--accent);
    box-shadow: 0 4px 14px rgba(196,149,106,0.25);
}
.consent-name { font-size: 18px; color: var(--text); margin-bottom: 4px; }
.consent-role { font-size: 13px; color: var(--text2); margin-bottom: 28px; }
.consent-welcome {
    font-size: 15px; line-height: 1.7; color: var(--text);
    margin-bottom: 24px; text-align: center; font-style: italic;
}
.consent-list { margin-bottom: 24px; }
.consent-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}
.consent-item-text { font-size: 14px; line-height: 1.6; color: var(--text); margin-bottom: 12px; }
.consent-yn {
    display: flex;
    gap: 10px;
}
.consent-yn button {
    flex: 1;
    height: 48px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: Georgia, 'Times New Roman', serif;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(120,100,80,0.18), inset 0 1px 0 rgba(255,255,255,0.6);
    transition: all 0.2s;
}
.consent-yn button::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 52%;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,0.42), rgba(255,255,255,0.06));
    pointer-events: none;
}
.consent-yn button:hover { transform: translateY(-1px); }
.consent-yn button:active { transform: translateY(1px); box-shadow: 0 2px 4px rgba(120,100,80,0.2), inset 0 1px 0 rgba(255,255,255,0.4); }
.consent-yn button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.consent-yes {
    background: linear-gradient(180deg, #dca97a, var(--accent) 55%, #a97b4c);
    color: #fff;
    border: 1px solid rgba(160,120,80,0.55);
    text-shadow: 0 1px 1px rgba(0,0,0,0.15);
}
.consent-yes.sel { box-shadow: 0 4px 12px rgba(196,149,106,0.45), inset 0 1px 0 rgba(255,255,255,0.65); border-color: #8a5f36; }
.consent-no {
    background: linear-gradient(180deg, #ffffff, #f0e9e0);
    color: var(--text);
    border: 1px solid var(--accent);
}
.consent-no.sel { background: linear-gradient(180deg, #dca97a, var(--accent) 55%, #a97b4c); color: #fff; border-color: #8a5f36; text-shadow: 0 1px 1px rgba(0,0,0,0.15); }
.consent-no-text {
    font-size: 12px;
    color: var(--text2);
    font-style: italic;
    line-height: 1.5;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.consent-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
}
.consent-btn {
    display: block;
    width: 100%;
    height: 48px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-family: Georgia, 'Times New Roman', serif;
    cursor: pointer;
    transition: all 0.2s;
    background: #e4ddd3;
    color: #a89a8c;
}
.consent-btn:not(:disabled) {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    box-shadow: 0 4px 12px rgba(196,149,106,0.25);
}
.consent-btn:not(:disabled):hover { box-shadow: 0 6px 20px rgba(196,149,106,0.35); transform: translateY(-1px); }
.consent-note {
    font-size: 12px;
    color: var(--text2);
    font-style: italic;
    text-align: center;
    line-height: 1.6;
    margin-top: 16px;
}
.consent-footer {
    font-size: 12px;
    color: var(--text2);
    text-align: center;
    margin-top: 22px;
    line-height: 1.6;
}

/* Mobile responsive */
@media (max-width: 480px) {
    body { font-size: 16px; }
    #app { padding: 12px; }
    .card { padding: 24px 18px; }
    .opt { padding: 14px 16px; font-size: 16px; }
    .btn-primary { padding: 16px; font-size: 16px; }
    .scene { padding: 28px 20px; }
    .scene-text { font-size: 17px; }
    .guide-reply { font-size: 14px; padding: 10px 12px; }
    .revelation-text { font-size: 16px; }
    .reflection-input { font-size: 16px; }
    .q-text { font-size: 16px; }
    h2 { font-size: 18px; }
    .consent-screen { padding: 20px 16px; margin: -12px auto; }
    .consent-item-text { font-size: 13px; }
    .consent-yn { flex-direction: column; gap: 10px; }
    .consent-yn button { flex: 0 0 auto; height: 50px; font-size: 14px; }
}
