:root {
    --bg-base: #f4f6fa;
    --text-dark: #1b1c21;
    --accent-color: #6b11ff; 
    --word-future: #abaec2;  
}

body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    font-family: 'Montserrat', sans-serif; overflow: hidden; background-color: var(--bg-base);
}

/* --- ФОН --- */
.mesh-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: 1; }
.blob { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.32; mix-blend-mode: multiply; will-change: transform; }
.blob1 { width: 650px; height: 650px; background: #ffafbd; top: -10%; left: -10%; }
.blob2 { width: 750px; height: 750px; background: #c9ffbf; bottom: -10%; right: -10%; }
.blob3 { width: 550px; height: 550px; background: #a1c4fd; top: 30%; left: 40%; }
.blob4 { width: 600px; height: 600px; background: #fed6e3; bottom: 15%; left: 5%; }

/* --- 3D ПЛАТОНОВЫ ТЕЛА --- */
#canvas-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: hidden; }
.glass-canvas canvas { filter: blur(6px); opacity: 0.7; mix-blend-mode: color-burn; }

/* --- СТАРТОВЫЙ ЭКРАН --- */
#start-overlay {
    position: absolute; z-index: 100; display: flex; justify-content: center; align-items: center;
    width: 100%; height: 100%; background: rgba(244,246,250,0.9); backdrop-filter: blur(5px);
}
#start-btn {
    padding: 20px 50px; font-size: 1.5rem; font-weight: 900; background: linear-gradient(135deg, #6b11ff, #00d2ff);
    color: white; border: none; border-radius: 50px; cursor: pointer;
    box-shadow: 0 15px 35px rgba(107, 17, 255, 0.3); transition: transform 0.2s, opacity 0.2s;
}
#start-btn:disabled { opacity: 0.5; cursor: wait; }
#start-btn:not(:disabled):hover { transform: scale(1.05) translateY(-5px); }

/* --- ГЛАВНЫЙ КОНТЕЙНЕР --- */
#app-container {
    position: relative; z-index: 2; width: 100%; height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    box-sizing: border-box; opacity: 0; padding-bottom: 60px;
}

/* --- ШАПКА --- */
#header-section {
    display: flex; flex-direction: column; align-items: center;
    transition: gap 2s cubic-bezier(0.25, 1, 0.5, 1), margin-top 2s cubic-bezier(0.25, 1, 0.5, 1),
                transform 2s cubic-bezier(0.25, 1, 0.5, 1), opacity 2s cubic-bezier(0.25, 1, 0.5, 1);
}
#logo-img { display: block; height: auto; filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.08)); transition: width 2s cubic-bezier(0.25, 1, 0.5, 1); will-change: transform, width; }
#main-title {
    font-weight: 900; text-transform: uppercase; text-align: center; margin: 0; line-height: 1.2;
    transition: font-size 2s cubic-bezier(0.25, 1, 0.5, 1), opacity 2s cubic-bezier(0.25, 1, 0.5, 1), letter-spacing 2s cubic-bezier(0.25, 1, 0.5, 1);
    background: linear-gradient(to right, #1e3c72, #2E7D32, #D4AF37, #2E7D32, #1e3c72);
    background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    animation: seamless-flow 8s infinite linear;
}

@keyframes seamless-flow { 0% { background-position: 0% center; } 100% { background-position: -200% center; } }

/* === СОСТОЯНИЯ ЧЕРЕЗ CSS === */
body.intro-mode #header-section { margin-top: 50vh; transform: translateY(-50%); gap: 80px; opacity: 1; } 
body.intro-mode #logo-img { width: 560px; } 
body.intro-mode #main-title { font-size: 2.6rem; letter-spacing: 4px; opacity: 1; }
body.intro-mode #subtitles-wrapper { height: 0; opacity: 0; margin-top: 0; transform: translateY(0); }
body.intro-mode #controls { opacity: 0; pointer-events: none; bottom: -50px; }

body.main-mode #header-section { margin-top: 4vh; transform: translateY(0); gap: 45px; opacity: 1; } 
body.main-mode #logo-img { width: 380px; } 
body.main-mode #main-title { font-size: 1.45rem; letter-spacing: 6px; opacity: 0.7; }
body.main-mode #subtitles-wrapper { height: 45vh; opacity: 1; margin-top: 0px; transform: translateY(0); }
body.main-mode #controls { opacity: 1; pointer-events: auto; bottom: 15px; }

/* СОСТОЯНИЕ ФИНАЛА (Жёстко фиксируем размеры логотипа и текста, чтобы они не прыгали при исчезновении) */
body.end-mode #header-section { margin-top: 4vh; transform: translateY(-80px); opacity: 0; pointer-events: none; gap: 45px; }
body.end-mode #logo-img { width: 380px; }
body.end-mode #main-title { font-size: 1.45rem; letter-spacing: 6px; opacity: 0; }
body.end-mode #subtitles-wrapper { opacity: 0; pointer-events: none; transform: scale(0.9) translateY(40px); }
body.end-mode #controls { opacity: 0; pointer-events: none; bottom: -50px; }


/* --- ФИНАЛЬНЫЙ ЭКРАН (ТИТРЫ) --- */
#ending-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transform: scale(0.95) translateY(20px);
    transition: opacity 2s ease 0.5s, transform 2s ease 0.5s; text-align: center;
}
body.end-mode #ending-screen { opacity: 1; pointer-events: auto; transform: scale(1) translateY(0); }

.ending-title { font-size: 2.2rem; font-weight: 800; color: #1e3c72; margin-bottom: 5px; line-height: 1.4; }
.ending-title span { background: linear-gradient(135deg, #6b11ff, #00d2ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-size: 3rem; font-weight: 900; }
.ending-subtitle { font-size: 1.3rem; font-weight: 600; color: #555; margin-bottom: 40px; margin-top: 0; }

.support-box { background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); padding: 35px 50px; border-radius: 20px; box-shadow: 0 15px 40px rgba(107, 17, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.9); }
.support-box h3 { margin-top: 0; font-size: 1.3rem; font-weight: 900; color: #333; margin-bottom: 25px; text-transform: uppercase; letter-spacing: 2px; }

.support-table { width: auto; margin: 0 auto; border-collapse: collapse; text-align: left; font-size: 1.15rem; color: #111; }
.support-table td { padding: 12px 25px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.support-table tr:last-child td { border-bottom: none; }
.support-table td:first-child { color: #666; font-weight: 600; text-align: right; white-space: nowrap; }
.support-table td:last-child { font-weight: 900; color: #1e3c72; font-variant-numeric: tabular-nums; }
.support-table small { font-weight: 600; color: #888; font-size: 0.9rem; display: block; margin-top: 3px; }

/* КОПИРОВАНИЕ РЕКВИЗИТОВ */
.copy-val {
    position: relative; display: inline-block; cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease, text-shadow 0.2s ease;
}
.copy-val:hover { color: #6b11ff; transform: scale(1.03); text-shadow: 0 2px 10px rgba(107, 17, 255, 0.3); }

/* ВЫДЕЛЕНИЕ ВАЖНОГО ТЕКСТА */
.support-footer { 
    margin-top: 25px; margin-bottom: 0; font-size: 1.05rem; font-weight: 800; 
    color: #d32f2f;
    /*background: rgba(211, 47, 47, 0.08); border: 1px dashed rgba(211, 47, 47, 0.4);*/
    padding: 12px 20px; border-radius: 12px; display: inline-block;
}

/* --- СУБТИТРЫ --- */
#subtitles-wrapper {
    width: 85%; max-width: 950px; position: relative; overflow: hidden;
    transition: height 2s cubic-bezier(0.25, 1, 0.5, 1), opacity 2s cubic-bezier(0.25, 1, 0.5, 1), margin-top 2s cubic-bezier(0.25, 1, 0.5, 1), transform 2s cubic-bezier(0.25, 1, 0.5, 1);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0px, black 40px, black calc(100% - 40px), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0px, black 40px, black calc(100% - 40px), transparent 100%);
}
#subtitles-track { display: flex; flex-direction: column; align-items: center; will-change: transform; }
.paragraph { width: 100%; margin-bottom: 60px; font-size: 2rem; font-weight: 700; line-height: 1.5; text-align: center; opacity: 0.35; transition: opacity 0.8s ease, filter 0.8s ease; }
.paragraph.active { opacity: 1; }
.paragraph.past { opacity: 0.15; filter: blur(2px); }
.word-wrap { position: relative; display: inline-block; margin: 0; font-weight: 900; }
.word-base { color: var(--word-future); opacity: 0.6; transition: opacity 0.3s ease; }
.word-highlight { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: #6b11ff; -webkit-background-clip: text; -webkit-text-fill-color: transparent; clip-path: inset(0 100% 0 0); will-change: clip-path; }

/* --- ПАНЕЛЬ УПРАВЛЕНИЯ И КНОПКА ЗАПИСИ --- */
.record-btn { position: absolute; top: 20px; right: 20px; z-index: 9999; padding: 12px 24px; font-size: 14px; font-weight: 900; background: #ff116b; color: white; border: none; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 15px rgba(255, 17, 107, 0.4); }
#controls { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 15px; align-items: center; z-index: 20; background: rgba(255, 255, 255, 0.75); padding: 5px 20px; border-radius: 15px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08); border: 1px solid rgba(255, 255, 255, 0.5); transition: opacity 2s ease, bottom 2s cubic-bezier(0.25, 1, 0.5, 1); width: 60%; max-width: 700px; }
button.control-btn { background: #fff; border: none; padding: 6px 16px; font-size: 0.8rem; font-weight: 900; border-radius: 10px; cursor: pointer; color: #111; box-shadow: 0 2px 8px rgba(0,0,0,0.05); transition: transform 0.2s; }
button.control-btn:hover { transform: translateY(-2px); }
#progress-container { flex-grow: 1; height: 20px; display: flex; align-items: center; cursor: pointer; margin: 0 10px; }
#progress-track-bg { width: 100%; height: 5px; background: rgba(0,0,0,0.1); border-radius: 3px; pointer-events: none; }
#progress-bar { width: 0%; height: 100%; background: var(--accent-color); border-radius: 3px; pointer-events: none; }
#time-display { font-weight: 900; font-size: 0.9rem; font-variant-numeric: tabular-nums; color: #111; min-width: 75px; text-align: right; }