u23-27gurkin 1 месяц назад
Родитель
Сommit
ca91e59dd0
1 измененных файлов с 372 добавлено и 108 удалено
  1. 372 108
      docs/index.html

+ 372 - 108
docs/index.html

@@ -6,7 +6,7 @@
     <meta name="theme-color" content="#9C27B0">
     <meta name="apple-mobile-web-app-capable" content="yes">
     <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
-    <title>HarmoniX | Academy & InfoSec</title>
+    <title>HarmoniX v21.0 | Academy & InfoSec</title>
 
     <style>
         /* ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ И ДИНАМИЧЕСКИЕ ТЕМЫ */
@@ -35,6 +35,32 @@
         html, body { width: 100%; min-height: 100vh; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; color: var(--text-color); background-color: var(--bg-color); overflow-x: hidden; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
         .emoji-fix { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif; }
 
+        /* УВЕДОМЛЕНИЯ (TOASTS) */
+        #toast-container { position: fixed; bottom: 25px; right: 25px; z-index: 9999999; display: flex; flex-direction: column; gap: 14px; pointer-events: none; }
+        .toast { pointer-events: auto; background: rgba(var(--panel-rgb), 0.92); border-left: 5px solid var(--accent); border-radius: 12px; padding: 16px 20px; width: 330px; box-shadow: 0 12px 35px rgba(0,0,0,0.25); backdrop-filter: blur(12px); transform: translateX(120%); transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.5s ease; display: flex; gap: 14px; align-items: flex-start; cursor: pointer; position: relative; overflow: hidden; }
+        .toast.show { transform: translateX(0); opacity: 1; }
+        .toast:hover { transform: translateX(-5px) scale(1.02); box-shadow: 0 15px 40px var(--btn-glow); }
+        .toast-icon { font-size: 26px; animation: toastBounce 2s infinite; }
+        .toast-content { flex-grow: 1; }
+        .toast-title { font-weight: 900; font-size: 15px; color: var(--accent); margin-bottom: 4px; }
+        .toast-text { font-size: 13px; line-height: 1.4; color: var(--text-color); font-weight: 500; }
+        @keyframes toastBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
+
+        /* СИСТЕМА ПОДСКАЗОК (СТРЕЛОЧКИ) */
+        .onboarding-hint { position: absolute; z-index: 5000; animation: pointBounce 1.5s infinite; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3)); pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; }
+        .onboarding-text { background: var(--accent); color: #fff; padding: 6px 12px; border-radius: 10px; font-size: 12px; font-weight: bold; white-space: nowrap; box-shadow: 0 4px 15px var(--btn-glow); border: 1.5px solid #fff; }
+        @keyframes pointBounce { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-10px) scale(1.05); } }
+
+        /* РЕЙТИНГ ЗВЕЗДЫ */
+        .star-rating { display: inline-flex; flex-direction: row-reverse; gap: 6px; justify-content: center; margin: 15px 0; }
+        .star-rating input { display: none; }
+        .star-rating label { font-size: 38px; color: #ccc; cursor: pointer; transition: 0.2s; text-shadow: 0 2px 4px rgba(0,0,0,0.2); line-height: 1; }
+        .star-rating label:hover, .star-rating label:hover ~ label, .star-rating input:checked ~ label { color: #FFD700; text-shadow: 0 0 15px rgba(255, 215, 0, 0.7); transform: scale(1.15); }
+
+        /* ГЛОБАЛЬНЫЙ RIPPLE ЭФФЕКТ (КРУГИ ПО ВОДЕ) */
+        .global-ripple { position: fixed; border-radius: 50%; border: 2.5px solid var(--accent); transform: translate(-50%, -50%); pointer-events: none; animation: rippleAnim 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; z-index: 9999999; box-shadow: 0 0 15px var(--btn-glow); }
+        @keyframes rippleAnim { 0% { width: 0; height: 0; opacity: 1; border-width: 4px; } 100% { width: 120px; height: 120px; opacity: 0; border-width: 1px; } }
+
         /* ВОЛНОВЫЕ КНОПКИ С КОНТРАСТОМ ДЛЯ ПАНЕЛЕЙ */
         .btn, .btn-enter, .premium-link-btn, .lang-btn, .step-btn, 
         .accordion-btn, .formula-card, .menu-btn-special, 
@@ -53,7 +79,7 @@
         .file-upload-btn:hover, .glass-controls button:hover, .quiz-option:hover, 
         .tab:hover, .btn-submit-main:hover, .btn-tzi:hover, .quiz-nav-btn:hover {
             border-radius: var(--wave-btn-hover) !important;
-            transform: translateY(-2px);
+            transform: translateY(-3px); box-shadow: 0 8px 20px var(--btn-glow);
         }
 
         .btn-pause, .btn-medium, .premium-link-btn[style*="FF9800"] {
@@ -62,18 +88,26 @@
             box-shadow: 0 4px 14px rgba(230, 74, 25, 0.45) !important; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
         }
 
-        .btn-pause.active {
-            background: linear-gradient(135deg, #D81B60, #AD1457) !important;
-            border-color: #ffffff !important; box-shadow: 0 0 18px rgba(216, 27, 96, 0.7) !important;
-        }
+        .btn-pause.active { background: linear-gradient(135deg, #D81B60, #AD1457) !important; border-color: #ffffff !important; box-shadow: 0 0 18px rgba(216, 27, 96, 0.7) !important; }
 
-        /* ИСПРАВЛЕННАЯ СУПЕР-ЯРКАЯ КНОПКА FOXFORD */
         .premium-link-btn.foxford-btn {
-            background: linear-gradient(135deg, #FF6D00, #DD2C00) !important;
-            color: #ffffff !important; border: 2px solid #ffffff !important;
+            background: linear-gradient(135deg, #FF6D00, #DD2C00) !important; color: #ffffff !important; border: 2px solid #ffffff !important;
             box-shadow: 0 4px 15px rgba(221, 44, 0, 0.5) !important; text-shadow: 0 1px 3px rgba(0,0,0,0.6) !important;
         }
 
+        /* УНИКАЛЬНАЯ КНОПКА КАМЕРЫ (СНИМОК) С ИНТЕРАКТИВОМ */
+        .btn-camera-snap {
+            display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 18px; font-size: 13px; font-weight: 900; cursor: pointer;
+            background: linear-gradient(135deg, #651FFF, #3D5AFE) !important; color: #fff !important; border: 2px solid #fff !important;
+            border-radius: 24px 6px 24px 6px !important; box-shadow: 0 4px 15px rgba(101, 31, 255, 0.4) !important; text-shadow: 0 1px 2px rgba(0,0,0,0.5);
+            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); position: relative; overflow: visible; z-index: 10;
+        }
+        .btn-camera-snap:hover { border-radius: 6px 24px 6px 24px !important; transform: translateY(-2px) scale(1.05); box-shadow: 0 6px 20px rgba(101, 31, 255, 0.6) !important; }
+        .btn-camera-snap:active { transform: scale(0.9); }
+        
+        .camera-flash-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #ffffff; z-index: 10; opacity: 0; pointer-events: none; border-radius: 12px; }
+        @keyframes flashAnim { 0% { opacity: 0; } 10% { opacity: 1; } 100% { opacity: 0; } }
+
         #bg-layer { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: radial-gradient(circle at 10% 20%, rgba(156, 39, 176, 0.08), transparent 40%), radial-gradient(circle at 90% 80%, rgba(33, 150, 243, 0.08), transparent 40%), linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px); background-size: 100% 100%, 100% 100%, 30px 30px, 30px 30px; background-color: var(--bg-color); z-index: -2; transition: filter 0.4s ease, background-image 0.4s ease; }
         .gradient-text { animation: colorFlow 6s ease infinite; font-weight: bold; }
         @keyframes colorFlow { 0% { color: #ff00cc; } 50% { color: #3333ff; } 100% { color: #ff00cc; } }
@@ -92,7 +126,7 @@
         @media (hover: hover) and (pointer: fine) {
             .glass-element:hover { background: rgba(var(--panel-rgb), calc(var(--glass-alpha) - 0.05)); border-color: var(--accent); box-shadow: 0 6px 16px var(--btn-glow); }
             .accordion-btn:hover { background: var(--accent); color: white; padding-left: 22px; }
-            .info-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); border-color: var(--accent); }
+            .info-card:hover { transform: translateY(-6px) scale(1.01); box-shadow: 0 15px 35px var(--btn-glow); border-color: var(--accent); z-index: 5; }
             .btn-enter:hover { transform: translateY(-4px) scale(1.04) !important; box-shadow: 0 15px 40px var(--btn-glow) !important; }
             .interactive-hover:hover { box-shadow: 0 8px 25px var(--btn-glow); }
         }
@@ -101,15 +135,14 @@
         .btn-enter { position: relative; z-index: 10; padding: 16px 44px; font-size: 22px; font-weight: bold; color: #fff !important; background: linear-gradient(135deg, var(--accent), #ff00cc) !important; border: 2px solid rgba(255, 255, 255, 0.9) !important; border-radius: 35px; box-shadow: 0 0 25px var(--btn-glow); cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); outline: none; }
         .btn-enter:active { transform: scale(0.96) !important; }
 
-        /* ИСПРАВЛЕННАЯ ВЕРХНЯЯ ПАНЕЛЬ С КРУГЛЫМ ЛОГОТИПОМ, КНОПКОЙ ФУЛЛСКРИН И ОБНОВИТЬ */
         .top-bar-wrapper { display: none; position: fixed; top: 0; left: 0; width: 100%; z-index: 2000; padding: max(10px, env(safe-area-inset-top)) 10px 10px; pointer-events: none; justify-content: center; }
-        .top-bar { pointer-events: auto; display: inline-flex; align-items: center; gap: clamp(6px, 1.5vw, 12px); padding: 8px 16px; border-radius: 35px; box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3); background: rgba(var(--panel-rgb), 0.98); border: 2px solid var(--accent); }
+        .top-bar { pointer-events: auto; display: inline-flex; align-items: center; gap: clamp(6px, 1.5vw, 12px); padding: 8px 16px; border-radius: 35px; box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3); background: rgba(var(--panel-rgb), 0.98); border: 2px solid var(--accent); position: relative; }
         
         .nav-logo { font-size: clamp(16px, 3.5vw, 20px); display: flex; align-items: center; gap: 8px; padding: 4px 8px; font-weight: 900; background: transparent !important; border: none !important; cursor: pointer; }
         .nav-logo .logo-super-shape.small { width: 36px; height: 36px; animation: morphRing 3s ease-in-out infinite alternate, ringGlow 2s infinite alternate; }
 
         .menu-btn-special { font-size: clamp(13px, 2vw, 15px); font-weight: 900; background: linear-gradient(135deg, #7B1FA2, #E91E63) !important; color: white !important; cursor: pointer; padding: 10px 22px; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 15px rgba(123, 31, 162, 0.45) !important; }
-        .btn-test-special { font-size: clamp(13px, 2vw, 15px); font-weight: 900; background: linear-gradient(135deg, #FF5722, #C2185B) !important; color: white !important; cursor: pointer; padding: 10px 18px; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 15px rgba(233, 30, 99, 0.45) !important; }
+        .btn-test-special { font-size: clamp(13px, 2vw, 15px); font-weight: 900; background: linear-gradient(135deg, #FF5722, #C2185B) !important; color: white !important; cursor: pointer; padding: 10px 18px; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 15px rgba(233, 30, 99, 0.45) !important; position: relative; }
         .btn-reload-styled { font-size: clamp(13px, 2vw, 15px); font-weight: 900; background: linear-gradient(135deg, #0091EA, #0052cc) !important; color: white !important; cursor: pointer; padding: 10px 16px; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 15px rgba(0, 145, 234, 0.45) !important; }
         .btn-fullscreen-compact { width: 40px; height: 40px; padding: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; background: rgba(var(--panel-rgb), 0.9); border: 2px solid var(--border-color) !important; color: var(--text-color); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
 
@@ -132,22 +165,38 @@
         .app-subtitle { font-size: clamp(14px, 3.5vw, 18px); color: var(--text-color); margin-bottom: 35px; opacity: 0.85; max-width: 600px; font-weight: 500; }
 
         #main-app { display: none; width: 100%; max-width: 1300px; margin: 0 auto; padding: calc(max(10px, env(safe-area-inset-top)) + 80px) 14px 40px; flex-direction: column; }
-        #sidebar { position: fixed; left: -360px; top: 0; width: 320px; max-width: 85%; height: 100vh; z-index: 3000; transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); padding: max(20px, env(safe-area-inset-top)) 20px 30px; overflow-y: auto; display: flex; flex-direction: column; border-right: 2px solid var(--accent); }
+        #sidebar { position: fixed; left: -360px; top: 0; width: 320px; max-width: 85%; height: 100vh; z-index: 3000; transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); padding: max(20px, env(safe-area-inset-top)) 20px 30px; overflow-y: auto; display: flex; flex-direction: column; border-right: 2px solid var(--accent); }
         #sidebar.open { left: 0; }
         #sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.5); z-index: 1999; backdrop-filter: blur(4px); }
         #sidebar-overlay.show { display: block; }
+        
         .sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
+        .sidebar-header h2 .emoji-fix { display: inline-block; transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); }
+        .sidebar-header:hover h2 .emoji-fix { transform: rotate(180deg) scale(1.2); }
         .close-sidebar { font-size: 34px; cursor: pointer; color: var(--text-color); transition: 0.2s; padding: 5px; }
+        .close-sidebar:hover { color: var(--accent); transform: scale(1.1); }
+        
         .sidebar-section { margin-bottom: 20px; }
         .sidebar-title { font-size: 13px; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; font-weight: bold; letter-spacing: 0.5px; }
-        .sidebar-btn-asym { padding: 12px 16px; margin-bottom: 8px; font-weight: bold; display: flex; align-items: center; gap: 10px; font-size: 14px; border-left: 4px solid var(--accent); cursor: pointer; }
-        .sidebar-btn-asym:hover { transform: translateX(8px); background: var(--accent); color: white; }
+        
+        /* ИНТЕРАКТИВНЫЕ КНОПКИ МЕНЮ С ЭФФЕКТОМ ЗАЛИВКИ */
+        .sidebar-btn-asym { 
+            padding: 12px 16px; margin-bottom: 8px; font-weight: bold; display: flex; align-items: center; gap: 10px; 
+            font-size: 14px; border-left: 4px solid var(--accent); cursor: pointer; 
+            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); position: relative; overflow: hidden; z-index: 1;
+        }
+        .sidebar-btn-asym::before {
+            content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
+            background: linear-gradient(90deg, transparent, var(--accent)); transition: all 0.4s ease; z-index: -1;
+        }
+        .sidebar-btn-asym:hover { transform: translateX(8px) scale(1.02); color: white; border-color: white; box-shadow: 0 4px 15px var(--btn-glow); }
+        .sidebar-btn-asym:hover::before { left: 0; }
         
         .setting-block { margin-bottom: 15px; }
         .setting-block label { display: block; margin-bottom: 6px; font-weight: bold; font-size: 14px; }
-        .setting-block select { width: 100%; padding: 10px; border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; border: 1.5px solid var(--element-border); background: rgba(var(--panel-rgb), 0.95); color: var(--text-color); font-weight: bold; }
+        .setting-block select { width: 100%; padding: 10px; border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; border: 1.5px solid var(--element-border); background: rgba(var(--panel-rgb), 0.95); color: var(--text-color); font-weight: bold; transition: 0.3s; cursor: pointer; }
+        .setting-block select:hover { border-color: var(--accent); box-shadow: 0 0 10px var(--btn-glow); }
 
-        /* ВЕРНУЛ ОБОИ И КНОПКИ СБРОСА */
         .file-upload-wrapper { position: relative; overflow: hidden; display: block; margin-bottom: 8px; }
         .file-upload-input { position: absolute; left: 0; top: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; z-index: 2; }
         .file-upload-btn { background: rgba(var(--panel-rgb), 0.9); border: 2px dashed var(--accent) !important; color: var(--text-color); padding: 11px; text-align: center; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; }
@@ -156,21 +205,22 @@
         .glass-controls button { flex: 1; padding: 9px; font-size: 13px; font-weight: 800; cursor: pointer; border: 1.5px solid var(--element-border) !important; background: rgba(var(--panel-rgb), 0.9); color: var(--text-color); }
         .btn-glass-on.active { background: var(--accent) !important; color: white !important; border-color: #fff !important; box-shadow: 0 0 12px var(--btn-glow) !important; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
         
-        .btn-tzi { background: var(--tzi-color) !important; color: #000 !important; border: 2px solid #fff !important; box-shadow: 0 0 16px var(--tzi-glow); font-weight: 900; }
-        input[type=range] { width: 100%; margin-top: 5px; accent-color: var(--accent); cursor: pointer; }
+        .btn-tzi { background: var(--tzi-color) !important; color: #000 !important; border: 2px solid #fff !important; box-shadow: 0 0 16px var(--tzi-glow); font-weight: 900; position: relative; }
+        input[type=range] { width: 100%; margin-top: 5px; accent-color: var(--accent); cursor: pointer; transition: 0.2s; }
+        input[type=range]:hover { transform: scale(1.02); filter: brightness(1.2); }
 
         .grid-container { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 16px; min-height: 75vh; margin-bottom: 30px; }
         .panel { padding: 16px; background: rgba(var(--panel-rgb), 0.85); border: 1px solid var(--border-color); display: flex; flex-direction: column; min-height: 0; position: relative; border-radius: 16px; }
         .panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-shrink: 0; flex-wrap: wrap; gap: 8px; }
-        .canvas-wrapper { flex-grow: 1; position: relative; width: 100%; height: 260px; min-height: 260px; border-radius: 12px; overflow: hidden; border: 2px solid var(--element-border); background: var(--canvas-bg); }
-        canvas { display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
-
-        .btn-download-compact { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; font-size: 13px; font-weight: bold; cursor: pointer; border: 1.5px solid var(--accent) !important; color: var(--accent); background: rgba(var(--panel-rgb), 0.9); transition: all 0.2s ease; }
-        .btn-download-compact:hover { background: var(--accent); color: #fff; box-shadow: 0 4px 12px var(--btn-glow); text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
+        
+        /* 3D ИНТЕРАКТИВ ДЛЯ ГРАФИКОВ */
+        .canvas-wrapper { flex-grow: 1; position: relative; width: 100%; height: 260px; min-height: 160px; resize: both; overflow: hidden; border-radius: 12px; border: 2px solid var(--element-border); background: var(--canvas-bg); transition: transform 0.3s ease, box-shadow 0.3s ease; }
+        .canvas-wrapper:hover { transform: scale(1.01); box-shadow: 0 12px 35px var(--btn-glow); z-index: 10; border-color: var(--accent); }
+        canvas { display: block; position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; }
 
         .chart-telemetry { position: absolute; bottom: 8px; left: 8px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
         .chart-telemetry.hidden { display: none; }
-        .telemetry-chip { background: rgba(var(--panel-rgb), 0.96); border: 1.5px solid var(--element-border); padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--text-color); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); backdrop-filter: blur(8px); font-variant-numeric: tabular-nums; }
+        .telemetry-chip { background: rgba(var(--panel-rgb), 0.96); border: 1.5px solid var(--element-border); padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--text-color); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); backdrop-filter: blur(8px); font-variant-numeric: tabular-nums; transition: 0.3s; }
         .telemetry-chip .val-highlight { color: var(--accent); font-weight: 900; font-size: 13px; }
         .telemetry-chip .val-fixed { display: inline-block; min-width: 42px; text-align: right; }
 
@@ -193,7 +243,7 @@
 
         .input-wrapper { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
         .value-input { width: 80px; padding: 6px; border-radius: 8px; border: 2px solid var(--accent); font-weight: 900; font-size: 15px; text-align: center; outline: none; background: var(--badge-bg); color: var(--accent); font-family: monospace; transition: all 0.25s ease; }
-        .value-input:focus { box-shadow: 0 0 12px var(--btn-glow); background: rgba(var(--panel-rgb), 0.98); transform: scale(1.05); }
+        .value-input:focus { box-shadow: 0 0 15px var(--btn-glow); background: rgba(var(--panel-rgb), 0.98); transform: scale(1.08); border-color: var(--accent-alt); color: var(--accent-alt); }
 
         .slider-alt { accent-color: var(--accent-alt) !important; }
         .input-alt { border-color: var(--accent-alt) !important; color: var(--accent-alt) !important; background: rgba(230, 74, 25, 0.12) !important; }
@@ -217,18 +267,21 @@
         .faq-link:hover { color: var(--accent); text-decoration: underline; }
 
         .calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 40px; }
-        .wave-calculator { background: #111119; border: 2.5px solid #2a2a38; padding: 22px; border-radius: 20px; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); color: #fff; }
-        .calc-screen { background: #051007 !important; border: 2px solid #1b5e20; border-radius: 12px; padding: 16px; box-shadow: inset 0 0 15px rgba(0, 230, 118, 0.15); margin-bottom: 15px; }
+        .wave-calculator { background: #111119; border: 2.5px solid #2a2a38; padding: 22px; border-radius: 20px; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); color: #fff; transition: 0.4s; }
+        .wave-calculator:hover { transform: translateY(-5px); border-color: #00E676; box-shadow: 0 15px 40px rgba(0, 230, 118, 0.2); }
+        .calc-screen { background: #051007 !important; border: 2px solid #1b5e20; border-radius: 12px; padding: 16px; box-shadow: inset 0 0 15px rgba(0, 230, 118, 0.15); margin-bottom: 15px; transition: 0.3s; }
         .calc-formula { font-family: 'Courier New', monospace; font-size: 18px; color: #81c784; margin-bottom: 8px; font-weight: bold; }
         .calc-result { font-family: 'Courier New', monospace; font-size: 26px; font-weight: 900; color: #00E676; text-shadow: 0 0 10px rgba(0, 230, 118, 0.7); margin-top: 5px; }
         .calc-controls { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
         .calc-input { font-size: 16px; padding: 8px; width: 110px; text-align: center; border-radius: 8px; border: 2px solid #444; background: #0a0a10 !important; color: #00E676 !important; font-weight: 900; outline: none; font-family: 'Courier New', monospace; transition: all 0.3s; }
-        .calc-input:focus { border-color: #00E676; box-shadow: 0 0 15px rgba(0, 230, 118, 0.5); transform: scale(1.04); }
+        .calc-input:focus { border-color: #00E676; box-shadow: 0 0 15px rgba(0, 230, 118, 0.5); transform: scale(1.08); }
         .calc-select { font-size: 14px; padding: 6px; border-radius: 8px; border: 2px solid #444; background: #0a0a10; color: #00E676; font-weight: bold; outline: none; font-family: 'Courier New', monospace; cursor: pointer; transition: 0.3s; max-width: 150px; }
         .calc-select:focus { border-color: #00E676; box-shadow: 0 0 15px rgba(0,230,118,0.5); }
 
         .accordion { width: 100%; margin-top: 15px; }
-        .accordion-btn { background: rgba(var(--panel-rgb), 0.95); color: var(--text-color); cursor: pointer; padding: 16px 22px; width: 100%; border: 2px solid var(--border-color); text-align: left; outline: none; font-size: 16px; font-weight: bold; display: flex; justify-content: space-between; margin-bottom: 8px; }
+        .accordion-btn { background: rgba(var(--panel-rgb), 0.95); color: var(--text-color); cursor: pointer; padding: 16px 22px; width: 100%; border: 2px solid var(--border-color); text-align: left; outline: none; font-size: 16px; font-weight: bold; display: flex; justify-content: space-between; margin-bottom: 8px; position: relative; overflow: hidden; z-index: 1;}
+        .accordion-btn::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(156, 39, 176, 0.2)); transition: all 0.4s ease; z-index: -1; }
+        .accordion-btn:hover::before { left: 0; }
         .accordion-btn.active { background: var(--accent); color: #fff; border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: 0; }
         .accordion-content { padding: 0 22px; background: rgba(var(--panel-rgb), 0.85); max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; margin-bottom: 8px; }
         .accordion-content p { padding: 16px 0; line-height: 1.6; margin: 0; font-size: 15px; }
@@ -247,22 +300,27 @@
         .modal-overlay.show { opacity: 1; display: flex; }
         .modal-content { padding: 28px; border-radius: 22px; width: 100%; max-width: 800px; max-height: 85vh; overflow-y: auto; position: relative; border: 2.5px solid var(--accent); }
         .close-btn { position: absolute; top: 12px; right: 15px; font-size: 30px; cursor: pointer; color: var(--text-color); padding: 4px; z-index: 10; transition: transform 0.2s; font-weight: bold; }
-        .close-btn:hover { transform: scale(1.15); color: var(--accent); }
+        .close-btn:hover { transform: scale(1.15) rotate(90deg); color: var(--accent); }
 
         .about-section { background: rgba(var(--panel-rgb), 0.8); border: 1.5px solid var(--border-color); padding: 20px; margin-bottom: 18px; border-radius: 16px; }
         .about-section h3 { margin-top: 0; color: var(--accent); display: flex; align-items: center; gap: 10px; font-size: 18px; }
         .about-section p { line-height: 1.6; font-size: 15px; margin-bottom: 0; }
         
+        /* КРАСИВЫЙ ЖУРНАЛ ИЗМЕНЕНИЙ (CHANGELOG) */
         .timeline { border-left: 3px solid var(--accent); padding-left: 18px; margin-left: 10px; position: relative; margin-top: 15px; }
-        .timeline-item { position: relative; margin-bottom: 18px; font-size: 14px; line-height: 1.6; background: rgba(var(--panel-rgb), 0.6); padding: 12px; border-radius: 8px; border: 1px solid var(--border-color); transition: 0.2s; }
-        .timeline-item:hover { background: rgba(var(--panel-rgb), 0.9); transform: translateX(5px); }
-        .timeline-item::before { content: ''; position: absolute; left: -26px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-color); box-shadow: 0 0 8px var(--btn-glow); }
-        .timeline-item b { color: var(--accent); display: block; font-size: 15px; margin-bottom: 4px; }
+        .timeline-item { position: relative; margin-bottom: 22px; font-size: 14px; line-height: 1.6; background: rgba(var(--panel-rgb), 0.6); padding: 15px; border-radius: 10px; border: 1.5px solid var(--border-color); transition: 0.3s; }
+        .timeline-item:hover { background: rgba(var(--panel-rgb), 0.95); transform: translateX(8px) scale(1.01); box-shadow: 0 8px 25px var(--btn-glow); border-color: var(--accent); }
+        .timeline-item::before { content: ''; position: absolute; left: -26px; top: 18px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg-color); box-shadow: 0 0 10px var(--btn-glow); transition: 0.3s; }
+        .timeline-item:hover::before { transform: scale(1.3); background: #fff; border-color: var(--accent); }
+        .timeline-item h4 { color: var(--accent); display: block; font-size: 16px; margin: 0 0 8px 0; font-weight: 900; }
+        .timeline-item ul { margin: 0; padding-left: 20px; color: var(--text-color); font-weight: 500; list-style-type: none; }
+        .timeline-item ul li { margin-bottom: 5px; position: relative; }
+        .timeline-item ul li::before { content: "🔹"; position: absolute; left: -22px; font-size: 12px; top: 2px; }
 
         .formula-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 24px; }
         @media (min-width: 600px) { .formula-grid { grid-template-columns: 1fr 1fr; } }
         .formula-card { padding: 14px 18px; font-size: 14px; line-height: 1.6; border-left: 4px solid var(--accent); background: rgba(var(--panel-rgb), 0.8); font-family: monospace; font-weight: bold; border-radius: 12px; transition: 0.3s; }
-        .formula-card:hover { transform: translateY(-3px); box-shadow: 0 4px 15px var(--btn-glow); }
+        .formula-card:hover { transform: translateY(-5px) scale(1.02); box-shadow: 0 8px 25px var(--btn-glow); border-color: var(--accent); z-index: 2; }
         .formula-card b { display: block; color: var(--accent); margin-bottom: 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; font-family: -apple-system, sans-serif; }
 
         /* ИНТЕРАКТИВНЫЕ ТЕСТЫ И СЛАЙДЕР С SVG АНИМАЦИЕЙ */
@@ -279,18 +337,18 @@
         .test-modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 25px; }
         .test-modes .btn { font-size: 15px; padding: 16px 10px; color: #ffffff !important; font-weight: 900; text-align: center; border: 2px solid rgba(255, 255, 255, 0.8) !important; cursor: pointer; text-shadow: 0 1px 3px rgba(0,0,0,0.6); display: flex; flex-direction: column; align-items: center; justify-content: center; transition: all 0.3s ease !important; }
         .btn-easy { background: linear-gradient(135deg, #4CAF50, #2E7D32) !important; box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3) !important; }
-        .btn-easy:hover { box-shadow: 0 0 20px rgba(76, 175, 80, 0.9) !important; border-color: #fff !important; filter: brightness(1.15); }
+        .btn-easy:hover { box-shadow: 0 0 25px rgba(76, 175, 80, 0.9) !important; border-color: #fff !important; filter: brightness(1.15); transform: translateY(-3px) scale(1.02); }
         .btn-medium { background: linear-gradient(135deg, #FF9800, #EF6C00) !important; box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3) !important; }
-        .btn-medium:hover { box-shadow: 0 0 20px rgba(255, 152, 0, 0.9) !important; border-color: #fff !important; filter: brightness(1.15); }
+        .btn-medium:hover { box-shadow: 0 0 25px rgba(255, 152, 0, 0.9) !important; border-color: #fff !important; filter: brightness(1.15); transform: translateY(-3px) scale(1.02); }
         .btn-hard { background: linear-gradient(135deg, #F44336, #C62828) !important; box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3) !important; }
-        .btn-hard:hover { box-shadow: 0 0 20px rgba(244, 67, 54, 0.9) !important; border-color: #fff !important; filter: brightness(1.15); }
+        .btn-hard:hover { box-shadow: 0 0 25px rgba(244, 67, 54, 0.9) !important; border-color: #fff !important; filter: brightness(1.15); transform: translateY(-3px) scale(1.02); }
         .btn-ultra { background: linear-gradient(135deg, #9C27B0, #E91E63) !important; border: 2.5px solid #FF80AB !important; box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3) !important; }
-        .btn-ultra:hover { box-shadow: 0 0 20px rgba(233, 30, 99, 0.9) !important; border-color: #fff !important; filter: brightness(1.15); }
+        .btn-ultra:hover { box-shadow: 0 0 25px rgba(233, 30, 99, 0.9) !important; border-color: #fff !important; filter: brightness(1.15); transform: translateY(-3px) scale(1.02); }
 
         .question-card-wrapper { margin-top: 10px; min-height: 250px; }
         .question { margin-bottom: 20px; padding: 24px; background: rgba(var(--panel-rgb), 0.85); border: 2px solid var(--border-color); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08); border-radius: var(--wave-btn-radius); animation: fadeInUp 0.4s ease-out forwards; }
         
-        @keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
+        @keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
 
         .question-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; font-weight: 900; font-size: 15px; color: var(--accent); }
         .question p { font-weight: bold; margin-top: 0; margin-bottom: 20px; font-size: 18px; line-height: 1.5; color: var(--text-color); }
@@ -298,23 +356,22 @@
         .quiz-option { display: flex; align-items: center; padding: 16px 20px; margin-bottom: 12px; font-size: 16px; cursor: pointer; border: 2px solid var(--element-border); background: rgba(var(--panel-rgb), 0.9); transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1); position: relative; font-weight: bold; }
         .quiz-option input { display: none; }
         .custom-radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--accent); margin-right: 14px; position: relative; flex-shrink: 0; transition: 0.2s; }
-        .quiz-option.selected { border-color: var(--accent); background: rgba(156, 39, 176, 0.15); transform: scale(1.02); box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3); border-radius: var(--wave-btn-hover) !important; }
-        .quiz-option.selected .custom-radio { border-color: var(--accent); box-shadow: 0 0 10px var(--btn-glow); }
+        .quiz-option.selected { border-color: var(--accent); background: rgba(156, 39, 176, 0.15); transform: scale(1.03); box-shadow: 0 8px 20px rgba(156, 39, 176, 0.3); border-radius: var(--wave-btn-hover) !important; z-index: 2;}
+        .quiz-option.selected .custom-radio { border-color: var(--accent); box-shadow: 0 0 15px var(--btn-glow); }
         .quiz-option.selected .custom-radio::after { content: ''; position: absolute; top: 4px; left: 4px; width: 10px; height: 10px; background: var(--accent); border-radius: 50%; }
         .quiz-option.selected .option-text { color: var(--accent); }
 
-        .quiz-option.correct-answer { background: rgba(76, 175, 80, 0.22) !important; border-color: #4CAF50 !important; color: #1B5E20 !important; box-shadow: 0 0 14px rgba(76, 175, 80, 0.4); }
+        .quiz-option.correct-answer { background: rgba(76, 175, 80, 0.22) !important; border-color: #4CAF50 !important; color: #1B5E20 !important; box-shadow: 0 0 14px rgba(76, 175, 80, 0.4); transform: scale(1.02); }
         .quiz-option.correct-answer::after { content: '✔'; position: absolute; right: 16px; color: #2E7D32; font-size: 20px; font-weight: 900; }
-        .quiz-option.wrong-answer { background: rgba(244, 67, 54, 0.22) !important; border-color: #f44336 !important; color: #B71C1C !important; box-shadow: 0 0 14px rgba(244, 67, 54, 0.4); }
+        .quiz-option.wrong-answer { background: rgba(244, 67, 54, 0.22) !important; border-color: #f44336 !important; color: #B71C1C !important; box-shadow: 0 0 14px rgba(244, 67, 54, 0.4); transform: scale(1.02); }
         .quiz-option.wrong-answer::after { content: '✖'; position: absolute; right: 16px; color: #C62828; font-size: 20px; font-weight: 900; }
 
         .quiz-nav-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 15px; }
         .quiz-nav-btn { padding: 12px 24px; font-weight: 900; font-size: 15px; cursor: pointer; border: 2px solid var(--accent); background: rgba(var(--panel-rgb), 0.95); color: var(--text-color); }
-        .quiz-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; }
+        .quiz-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
 
         #test-result-screen { display: none; text-align: center; padding: 15px 5px; }
         
-        /* ИНТЕРАКТИВНЫЙ КРУГ SVG */
         .score-circle-wrapper { position: relative; width: 140px; height: 140px; margin: 0 auto 20px auto; }
         .circular-progress { transform: rotate(-90deg); width: 140px; height: 140px; filter: drop-shadow(0 0 10px var(--accent)); transition: filter 0.5s; }
         .circular-progress circle { fill: none; stroke-width: 10; stroke-linecap: round; }
@@ -322,7 +379,7 @@
         .circular-progress .progress { stroke: var(--accent); stroke-dasharray: 339.292; stroke-dashoffset: 339.292; transition: stroke-dashoffset 1s ease-out, stroke 0.5s; }
         .score-text { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 900; color: var(--accent); transition: color 0.5s; }
 
-        .review-box { margin-top: 20px; text-align: left; max-height: 300px; overflow-y: auto; background: rgba(var(--panel-rgb), 0.9); border: 2px solid var(--element-border); padding: 15px; border-radius: 16px; animation: fadeInUp 0.6s ease-out forwards; }
+        .review-box { margin-top: 20px; text-align: left; max-height: 300px; overflow-y: auto; background: rgba(var(--panel-rgb), 0.9); border: 2px solid var(--element-border); padding: 15px; border-radius: 16px; animation: fadeInUp 0.6s ease-out forwards; box-shadow: inset 0 0 15px rgba(0,0,0,0.05); }
 
         .btn-submit-main { background: #00E676 !important; color: #fff !important; font-size: 16px; padding: 10px 25px; box-shadow: 0 5px 20px rgba(0, 230, 118, 0.5) !important; border: 2px solid #fff !important; cursor: pointer; font-weight: 900; transition: 0.2s; }
         .btn-submit-main:active { transform: scale(0.95); }
@@ -331,7 +388,7 @@
             #main-app { padding: calc(max(10px, env(safe-area-inset-top)) + 70px) 10px 20px 10px; }
             .grid-container { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
             .panel { padding: 16px; }
-            .canvas-wrapper { height: 260px; min-height: 260px; }
+            .canvas-wrapper { height: 260px; min-height: 160px; }
             .presets-row { grid-template-columns: repeat(4, 1fr); gap: 4px; }
             .presets-row button { padding: 10px 2px; font-size: 11px; }
             .control-row { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
@@ -344,8 +401,6 @@
             .modal-content { padding: 20px; }
             .test-modes { grid-template-columns: 1fr; }
             .hide-mobile { display: none; }
-            
-            /* Восстановлены кнопки на мобильном для верхней панели (кроме фуллскрина) */
             .btn-reload-styled { display: flex; }
         }
     </style>
@@ -354,6 +409,9 @@
     <div id="bg-layer"></div>
     <div id="sidebar-overlay" onclick="toggleSidebar()"></div>
     <div id="global-tooltip"></div>
+    
+    <!-- КОНТЕЙНЕР ДЛЯ НОВЫХ УВЕДОМЛЕНИЙ -->
+    <div id="toast-container"></div>
 
     <div id="welcome-screen">
         <div class="welcome-bg-grid"></div>
@@ -364,13 +422,13 @@
         </div>
         <h1 class="app-title gradient-text" data-i18n="appTitle" style="margin-top:20px;">HarmoniX</h1>
         <h2 class="app-subtitle" data-i18n="appSubtitle">Интерактивная Лаборатория Волновой Физики</h2>
-        <div style="margin-bottom: 25px; font-size: 13.5px; font-weight: bold; color: var(--accent); background: rgba(var(--panel-rgb), 0.95); padding: 8px 18px; border-radius: var(--wave-btn-radius); border: 2px solid var(--accent); box-shadow: 0 0 15px rgba(156, 39, 176, 0.35);">
-            <span class="emoji-fix">❗️</span> <span data-i18n="hintYellow">Ищите желтые кружки [?] для подсказок!</span>
+        <div style="margin-bottom: 25px; font-size: 13.5px; font-weight: bold; color: var(--accent); background: rgba(var(--panel-rgb), 0.95); padding: 8px 18px; border-radius: var(--wave-btn-radius); border: 2px solid var(--accent); box-shadow: 0 0 25px rgba(156, 39, 176, 0.45);">
+            <span class="emoji-fix">✨</span> <span data-i18n="hintYellow">Версия 21.0 Nova | Максимальный интерактив!</span>
         </div>
         <button class="btn-enter glass-element interactive-hover btn-shine" onclick="startApp()"><span class="emoji-fix">▶</span> <span data-i18n="btnStart">Начать работу</span></button>
     </div>
 
-    <!-- МЕНЮ НАСТРОЕК (ВОССТАНОВЛЕНО 100%) -->
+    <!-- МЕНЮ НАСТРОЕК -->
     <div id="sidebar" class="glass-panel">
         <div class="sidebar-header">
             <h2 class="gradient-text" style="margin:0; font-size: 18px;"><span class="emoji-fix">⚙</span> <span data-i18n="menuSettings">Настройки</span></h2>
@@ -425,7 +483,6 @@
                 <label id="lblThemeSelect" data-i18n="lblThemeSelect">Тема оформления:</label>
                 <select id="themeSelect" class="emoji-fix glass-element" onchange="changeTheme(this.value); playAudioCue('menuClick');"></select>
             </div>
-            <!-- ВОССТАНОВЛЕН БЛОК ОБОЕВ -->
             <div class="setting-block">
                 <label id="lblCustomBg" data-i18n="lblCustomBg">Свои обои:</label>
                 <div class="file-upload-wrapper glass-element">
@@ -440,22 +497,23 @@
             </div>
         </div>
         <div style="flex-grow: 1;"></div>
-        <div style="text-align: center; font-size: 12px; opacity: 0.5;">v19.0 Enterprise Platform</div>
+        <div style="text-align: center; font-size: 12px; opacity: 0.7; font-weight: bold; color: var(--accent);">v21.0 Enterprise Nova</div>
     </div>
 
-    <!-- ВЕРХНЯЯ ПАНЕЛЬ С КНОПКАМИ ОБНОВИТЬ И ФУЛЛСКРИН -->
+    <!-- ВЕРХНЯЯ ПАНЕЛЬ -->
     <div class="top-bar-wrapper" id="main-nav-bar">
         <div class="top-bar glass-panel pop-animation">
             <button class="menu-btn-special interactive-hover" onclick="toggleSidebar(); playAudioCue('glassBell');"><span class="emoji-fix">☰</span> <span class="hide-mobile" data-i18n="btnMenu">Меню</span></button>
             <button class="btn-reload-styled interactive-hover" onclick="location.reload(); playAudioCue('glassBell');"><span class="emoji-fix">🔄</span> <span class="hide-mobile" data-i18n="btnReload">Обновить</span></button>
 
-            <!-- КРУГЛЫЙ ЖИВОЙ ЛОГОТИП -->
             <div class="nav-logo interactive-hover" onclick="window.scrollTo({top: 0, behavior: 'smooth'}); cursor: pointer;">
                 <div class="logo-super-shape small"><div class="logo-inner-content"><span class="emoji-fix" style="font-size:14px;">〽️</span></div></div>
                 <span class="hide-mobile gradient-text">HarmoniX</span>
             </div>
 
-            <button class="btn-test-special interactive-hover" onclick="openTestMenu(); playAudioCue('glassBell');"><span class="emoji-fix">🎓</span> <span data-i18n="btnTest">Тесты</span></button>
+            <div style="position: relative;">
+                <button id="btnMainTestMode" class="btn-test-special interactive-hover" onclick="openTestMenu(); playAudioCue('glassBell');"><span class="emoji-fix">🎓</span> <span data-i18n="btnTest">Тесты</span></button>
+            </div>
             <button class="btn-fullscreen-compact interactive-hover" onclick="toggleFullscreen(); playAudioCue('glassBell');" title="Full Screen"><span class="emoji-fix">🔲</span></button>
         </div>
     </div>
@@ -479,14 +537,18 @@
             <div class="panel glass-panel pop-animation" style="animation-delay: 0.1s;">
                 <div class="panel-header">
                     <h3 style="margin:0; font-size:16px;" data-i18n="pnl3">3. Теорема Фурье (Сумма)</h3>
-                    <button class="btn-download-compact interactive-hover" onclick="downloadGraph('canvas-sum'); playAudioCue('cameraSnap');">
-                        <span class="emoji-fix">📷</span> <span data-i18n="btnSaveCompact">Снимок</span>
-                    </button>
+                    <div style="position: relative; z-index: 100;">
+                        <button id="btnMainSnap" class="btn-camera-snap" onclick="downloadGraph('canvas-sum'); playAudioCue('cameraSnap');">
+                            <span class="emoji-fix">📸</span> <span data-i18n="btnSaveCompact">Снимок</span>
+                        </button>
+                    </div>
                 </div>
                 <div class="canvas-wrapper glass-element" ondblclick="resetCanvasSizes()">
                     <canvas id="canvas-sum"></canvas>
                     <div class="chart-telemetry" id="telemSum">
                         <div class="telemetry-chip"><span data-i18n="telClip">Нелинейное</span>: <span id="telClipStatus" class="val-highlight">Выкл</span></div>
+                        <div class="telemetry-chip" id="telemTHD" style="display:none;"><span data-i18n="telTHD">THD (Искажения)</span>: <span id="telTHDVal" class="val-highlight">0%</span></div>
+                        <div class="telemetry-chip" id="telemLimit" style="display:none;"><span data-i18n="telLimit">Порог среза</span>: <span id="telLimitVal" class="val-highlight">±25%</span></div>
                     </div>
                 </div>
             </div>
@@ -583,13 +645,12 @@
                     <span class="hint-icon" style="background:var(--tzi-color); color:#000; margin: 0;" data-i18n-hint="hintTzi" data-hint="Симуляция технической защиты информации.">?</span>
                 </div>
                 <p style="font-size:15px; margin-bottom:15px; margin-top: 10px; font-weight: bold;" data-i18n="tziDesc">Активация генератора шума для маскировки речевой информации от средств перехвата:</p>
-                <div style="display:flex; justify-content:center;">
-                    <button class="btn btn-tzi interactive-hover" id="btnTziMode" style="width:100%; max-width:400px; padding:14px; font-size:16px; font-weight:900;" onclick="toggleTZI()"><span class="emoji-fix">🔒</span> <span data-i18n="btnTziStart">Активировать маскировку</span></button>
+                <div style="display:flex; justify-content:center; position: relative;">
+                    <button class="btn btn-tzi interactive-hover" id="btnTziMode" style="width:100%; max-width:400px; padding:14px; font-size:16px; font-weight:900; position:relative; z-index:100;" onclick="toggleTZI()"><span class="emoji-fix">🔒</span> <span data-i18n="btnTziStart">Активировать маскировку</span></button>
                 </div>
             </div>
         </div>
 
-        <!-- ВОССТАНОВЛЕНЫ ОБУЧАЮЩИЕ БЛОКИ И РЕСУРСЫ -->
         <div class="site-content glass-panel pop-animation" style="animation-delay: 0.3s;">
             <h2 class="content-header gradient-text" data-i18n="eduHeader">📚 Академия Волновой Механики</h2>
 
@@ -605,7 +666,6 @@
                 </div>
             </div>
 
-            <!-- УМНЫЙ КАЛЬКУЛЯТОР ДЛИНЫ ВОЛНЫ С ВЫПАДАЮЩИМ СПИСКОМ -->
             <div class="calc-grid">
                 <div class="wave-calculator">
                     <h3 style="margin-top:0; color:#fff;" data-i18n="calcTitle"><span class="emoji-fix">🧮</span> Калькулятор длины волны</h3>
@@ -644,7 +704,6 @@
                 </div>
             </div>
 
-            <!-- FAQ И РЕСУРСЫ -->
             <h2 class="content-header gradient-text" style="margin-top:35px;" data-i18n="faqTitle">💬 Динамические вопросы и ответы (FAQ)</h2>
             <div id="dynamic-faq-container"></div>
 
@@ -694,12 +753,12 @@
         </div>
 
         <div class="app-footer">
-            HarmoniX v19.0 Enterprise | Лаборатория Волновой Физики © 2026<br>
+            HarmoniX v21.0 Enterprise Nova | Лаборатория Волновой Физики © 2026<br>
             Интерактивный анализ механических волн, Теория Фурье и Фигуры Лиссажу
         </div>
     </div>
 
-    <!-- ТЕСТИРОВАНИЕ: СЛАЙДЕР ВОПРОСОВ И УМНЫЙ ТАЙМЕР -->
+    <!-- ТЕСТИРОВАНИЕ: СЛАЙДЕР И УМНЫЙ ТАЙМЕР -->
     <div id="test-overlay" class="modal-overlay">
         <div class="modal-content glass-panel" style="z-index: 99999;">
             <span class="close-btn" onclick="closeTest(); playAudioCue('mainPulse');">&times;</span>
@@ -715,7 +774,6 @@
                 </div>
             </div>
 
-            <!-- ИНТЕРФЕЙС ТЕСТА -->
             <div id="quiz-process" style="display: none;">
                 <div class="quiz-timer-pill glass-panel btn-shine" id="quizTimerBar" style="display:none;">
                     <div class="timer-progress-bg">
@@ -746,7 +804,6 @@
                     </button>
                 </div>
 
-                <!-- ЭКРАН РЕЗУЛЬТАТОВ (АНИМАЦИЯ SVG КРУГА) -->
                 <div id="test-result-screen">
                     <div class="score-circle-wrapper">
                         <svg width="140" height="140" viewBox="0 0 120 120" class="circular-progress">
@@ -777,7 +834,6 @@
         <div class="modal-content glass-panel" style="z-index: 99999;">
             <span class="close-btn" onclick="closeInfoModal(); playAudioCue('mainPulse');">&times;</span>
 
-            <!-- ПАПКА ФОРМУЛ С ДОП ССЫЛКАМИ -->
             <div id="modal-formulas" class="info-content" style="display:none;">
                 <h2 class="gradient-text" style="text-align:center;"><span class="emoji-fix">📚</span> <span data-i18n="modalFormulasTitle">Справочник формул</span></h2>
                 <div class="formula-grid">
@@ -812,9 +868,23 @@
                 </div>
             </div>
 
-            <!-- РАСШИРЕННЫЙ РАЗДЕЛ О ПРОЕКТЕ -->
+            <!-- ОБНОВЛЕННЫЙ ЖУРНАЛ ИЗМЕНЕНИЙ И ЗВЕЗДЫ -->
             <div id="modal-about" class="info-content" style="display:none;">
                 <h2 class="gradient-text" style="text-align:center;"><span class="emoji-fix">🚀</span> <span data-i18n="modalAboutTitle">О платформе HarmoniX</span></h2>
+                
+                <!-- РЕЙТИНГ ОБНОВЛЕНИЯ -->
+                <div class="about-section pop-animation" style="text-align: center; border-color: var(--accent); background: rgba(var(--panel-rgb), 0.95); box-shadow: 0 4px 20px var(--btn-glow);">
+                    <h3 style="justify-content: center;"><span class="emoji-fix">🌟</span> Оцените обновление HarmoniX</h3>
+                    <p style="font-size: 13px; opacity: 0.8; margin-bottom: 5px;">Ваша оценка поможет сделать приложение еще лучше!</p>
+                    <div class="star-rating">
+                        <input type="radio" id="star5" name="rating" value="5" onclick="rateApp(5)"><label for="star5">★</label>
+                        <input type="radio" id="star4" name="rating" value="4" onclick="rateApp(4)"><label for="star4">★</label>
+                        <input type="radio" id="star3" name="rating" value="3" onclick="rateApp(3)"><label for="star3">★</label>
+                        <input type="radio" id="star2" name="rating" value="2" onclick="rateApp(2)"><label for="star2">★</label>
+                        <input type="radio" id="star1" name="rating" value="1" onclick="rateApp(1)"><label for="star1">★</label>
+                    </div>
+                </div>
+
                 <div class="about-section pop-animation interactive-hover">
                     <h3 data-i18n="aboutDescTitle"><span class="emoji-fix">ℹ️</span> Философия проекта</h3>
                     <p data-i18n="aboutDescText">HarmoniX — это высокотехнологичная PWA-среда для визуального моделирования волновых процессов, гармонического сложения и анализа спектра Фурье.</p>
@@ -823,19 +893,45 @@
                 <h3 data-i18n="aboutHistoryTitle" style="color: var(--accent); margin-top:20px;">📜 Журнал изменений (Changelog)</h3>
                 <div class="timeline">
                     <div class="timeline-item pop-animation interactive-hover">
-                        <b>v19.0 Enterprise Grand Master:</b> Интерактивный SVG-круг прогресса тестирования с анимацией. "Живые" ссылки на Wikipedia в ответах. Интерактивный логотип. Новые формулы Доплера.
+                        <h4>🌟 v21.0 Nova Update (Текущая):</h4>
+                        <ul>
+                            <li>Добавлены смарт-уведомления (Toasts) при входе.</li>
+                            <li>Внедрена система онбординга (анимированные стрелки-подсказки).</li>
+                            <li>Реализована система оценки проекта по звездам (Rating System).</li>
+                            <li>Полностью переработан и расширен Журнал изменений.</li>
+                        </ul>
                     </div>
                     <div class="timeline-item pop-animation interactive-hover">
-                        <b>v18.5 Enterprise UX Update:</b> Волновая форма кнопок (18px 6px). Умная лента таймера с градиентами. Пошаговый слайдер тестов (без скролла).
+                        <h4>🔥 v20.0 Enterprise Ultimate:</h4>
+                        <ul>
+                            <li>Максимальная интерактивность (Глобальные Ripple-эффекты).</li>
+                            <li>Аппаратный аудио-клиппинг через <code>WaveShaperNode</code>.</li>
+                            <li>Анимация вспышки фото-затвора при сохранении графика.</li>
+                            <li>Умное сглаживание графиков через `requestAnimationFrame`.</li>
+                        </ul>
                     </div>
                     <div class="timeline-item pop-animation interactive-hover">
-                        <b>v18.0 Security Addition:</b> Интеграция модуля ТЗИ (Акустическая маскировка), генератор белого шума. 100% перевод интерфейса (i18n). Умный селектор сред.
+                        <h4>👑 v19.0 Enterprise Grand Master:</h4>
+                        <ul>
+                            <li>Интерактивный SVG-круг прогресса тестирования с анимацией Count-up.</li>
+                            <li>"Живые" ссылки на Wikipedia в ответах.</li>
+                            <li>Интерактивный круглый логотип. Новые формулы Доплера.</li>
+                        </ul>
                     </div>
                     <div class="timeline-item pop-animation interactive-hover">
-                        <b>v16.0 Ultimate:</b> Двуязычная адаптация, раздельный WebAudio, устранение конфликтов canvas, замена SVG на системные эмодзи.
+                        <h4>🔒 v18.0 Security Addition:</h4>
+                        <ul>
+                            <li>Интеграция модуля ТЗИ (Акустическая маскировка), генератор белого шума.</li>
+                            <li>100% перевод интерфейса (i18n). Умный селектор на 30 сред.</li>
+                            <li>Волновая форма кнопок (18px 6px).</li>
+                        </ul>
                     </div>
                     <div class="timeline-item pop-animation interactive-hover">
-                        <b>v1.0 - 12.0:</b> Генератор вопросов, Фигуры Лиссажу, базовый синтезатор Фурье.
+                        <h4>🚀 v1.0 - 16.0 Эволюция:</h4>
+                        <ul>
+                            <li>Двуязычная адаптация, раздельный WebAudio.</li>
+                            <li>Генератор вопросов, Фигуры Лиссажу, базовый синтезатор Фурье.</li>
+                        </ul>
                     </div>
                 </div>
             </div>
@@ -845,7 +941,7 @@
     <script>
         let currentLang = 'ru';
         let currentPreset = 'sine';
-        let waves = [{ f: 440, a: 80, p: 0 }, { f: 880, a: 0, p: 0 }, { f: 1320, a: 0, p: 0 }];
+        let waves = [{ f: 440, a: 80, p: 0, type: 'sine' }, { f: 880, a: 0, p: 0, type: 'sine' }, { f: 1320, a: 0, p: 0, type: 'sine' }];
         let currentWave = 0, freqStep = 100, time = 0, animSpeedMultiplier = 1.0;
         let isClipped = false, isAudioOn = false, isPaused = false;
         let isGlassOn = true, isGlowOn = false, isGridOn = true, isLissajous = false, showLabels = true;
@@ -853,6 +949,65 @@
         let animationFrameId = null, cachedBaseColor = '#2196F3';
         const BASE_ANIM_SPEED = 0.08;
         let isMaskingTZI = false, noiseSource = null;
+        let masterGainNode = null, masterWaveShaper = null;
+
+        // --- УВЕДОМЛЕНИЯ (TOASTS) ---
+        function showToast(title, text, icon, duration = 6000) {
+            const container = document.getElementById('toast-container');
+            if(!container) return;
+            const toast = document.createElement('div');
+            toast.className = 'toast';
+            toast.innerHTML = `<div class="toast-icon emoji-fix">${icon}</div><div class="toast-content"><div class="toast-title">${title}</div><div class="toast-text">${text}</div></div>`;
+            container.appendChild(toast);
+            
+            void toast.offsetWidth; // Reflow
+            toast.classList.add('show');
+            playAudioCue('tick');
+
+            toast.onclick = () => { toast.classList.remove('show'); setTimeout(() => toast.remove(), 500); playAudioCue('click'); };
+            if(duration > 0) {
+                setTimeout(() => {
+                    if(toast.parentElement) { toast.classList.remove('show'); setTimeout(() => toast.remove(), 500); }
+                }, duration);
+            }
+        }
+
+        // --- СТРЕЛОЧКИ ПОДСКАЗОК (ОНБОРДИНГ) ---
+        function showOnboardingPointers() {
+            function attach(targetId, text) {
+                let target = document.getElementById(targetId);
+                if(target && target.style.display !== 'none') {
+                    let hint = document.createElement('div');
+                    hint.className = `onboarding-hint`;
+                    hint.innerHTML = `<div class="onboarding-text">${text}</div><span class="emoji-fix" style="font-size:28px;">⬇️</span>`;
+                    hint.style.top = '-48px'; hint.style.left = '50%'; hint.style.transform = 'translateX(-50%)';
+                    target.appendChild(hint);
+                    target.addEventListener('click', () => { if(hint.parentElement) hint.remove(); }, {once:true});
+                    setTimeout(() => { if(hint.parentElement) hint.remove(); }, 20000); // Автоудаление
+                }
+            }
+            setTimeout(() => attach('btnMainSnap', 'Новая анимация!'), 2000);
+            setTimeout(() => attach('btnTziMode', 'Генератор шума'), 4000);
+            setTimeout(() => attach('btnMainTestMode', 'Геймификация!'), 6000);
+        }
+
+        // --- РЕЙТИНГ ---
+        function rateApp(stars) {
+            let msg = currentLang === 'ru' ? `Спасибо за оценку! Вы поставили ${stars} звезд.` : `Thanks for rating! You gave ${stars} stars.`;
+            showToast("⭐⭐⭐⭐⭐", msg, "🎉", 4000);
+            playAudioCue('glassBell');
+        }
+
+        // --- ГЛОБАЛЬНЫЙ RIPPLE ЭФФЕКТ ДЛЯ МАКСИМАЛЬНОГО ИНТЕРАКТИВА ---
+        document.addEventListener('click', function(e) {
+            if (e.target.tagName === 'INPUT' || e.target.tagName === 'SELECT' || e.target.classList.contains('toast')) return;
+            const ripple = document.createElement('div');
+            ripple.className = 'global-ripple';
+            ripple.style.left = e.clientX + 'px';
+            ripple.style.top = e.clientY + 'px';
+            document.body.appendChild(ripple);
+            setTimeout(() => ripple.remove(), 600);
+        });
 
         const i18n = {
             ru: {
@@ -896,14 +1051,15 @@
                 tziDesc: "Активация генератора шума для маскировки речевой информации от средств перехвата:",
                 btnTziStart: "Активировать маскировку", btnTziStop: "Отключить маскировку",
                 calcAirDesc: "Среда: Воздух (20°C)", calcSpeedLabel: "Скорость (м/с):", calcCycle: "Длительность 1 цикла (Период):",
-                hintYellow: "Ищите кружки [?] для подсказок!", btnPickImg: "📂 Выбрать картинку",
+                hintYellow: "Ищите кружки [?] для подсказок!", btnPickImg: "📂 Выбрать картинку", btnDelBg: "Сбросить фон",
                 testTimeUp: "⏰ Время вышло! Ответы проверены автоматически.",
                 testReviewTitle: "Детальный разбор вопросов:", testSkipped: "Пропущен",
                 testResTitle: "Итоговый результат:", testResOf: "из",
                 testRes90: "🎉 Превосходно! Уровень эксперта.", testRes60: "👍 Хорошо, курс освоен.", testResLow: "😅 Рекомендуем повторить теорию на сайте.",
                 omegaLabel: "Цикл. частота (ω):", radS: "рад/с", lblFreqShort: "ν (Гц)", lblPhaseShort: "Фаза",
                 btnPrev: "Назад", btnNext: "Вперед", qOf: "из", qWord: "Вопрос", wikiLink: "Читать подробнее в Wikipedia", hyperPhysics: "🔗 База знаний HyperPhysics (GSU)",
-                fConst: "⚛️ Фундаментальные константы", c1: "Скорость света (c)", c2: "Скорость звука (v)", c3: "Число Пи (π)", btnPickImg: "📂 Выбрать картинку", btnDelBg: "Сбросить фон"
+                fConst: "⚛️ Фундаментальные константы", c1: "Скорость света (c)", c2: "Скорость звука (v)", c3: "Число Пи (π)",
+                telTHD: "THD (Искажения)", telLimit: "Порог среза", toastWelcome: "👋 Добро пожаловать!", toastWelcomeTxt: "HarmoniX v21.0 успешно запущен. Закройте меня кликом.", toastUpdate: "🚀 Что нового?", toastUpdateTxt: "Добавлены смарт-подсказки, система рейтингов и Ripple-анимации.", toastSec: "🛡️ Модуль ТЗИ", toastSecTxt: "Обязательно попробуйте генератор шума внизу страницы!"
             },
             en: {
                 appTitle: "HarmoniX", appSubtitle: "Interactive Wave Physics Laboratory", btnStart: "Start Analysis",
@@ -953,7 +1109,8 @@
                 testRes90: "🎉 Excellent! Expert level.", testRes60: "👍 Good, solid knowledge.", testResLow: "😅 We recommend reviewing the theory on the site.",
                 omegaLabel: "Angular Freq (ω):", radS: "rad/s", lblFreqShort: "ν (Hz)", lblPhaseShort: "Phase",
                 btnPrev: "Back", btnNext: "Next", qOf: "of", qWord: "Question", wikiLink: "Read more on Wikipedia", hyperPhysics: "🔗 HyperPhysics Database (GSU)",
-                fConst: "⚛️ Fundamental constants", c1: "Speed of light (c)", c2: "Speed of sound (v)", c3: "Pi Number (π)"
+                fConst: "⚛️ Fundamental constants", c1: "Speed of light (c)", c2: "Speed of sound (v)", c3: "Pi Number (π)",
+                telTHD: "THD (Distortion)", telLimit: "Clip Limit", toastWelcome: "👋 Welcome!", toastWelcomeTxt: "HarmoniX v21.0 is online.", toastUpdate: "🚀 What's New?", toastUpdateTxt: "Added smart toasts, star rating and new pointer animations.", toastSec: "🛡️ InfoSec Module", toastSecTxt: "Try the acoustic noise generator below!"
             }
         };
 
@@ -1025,16 +1182,35 @@
 
         function stopNoise() { if (noiseSource) { try { noiseSource.stop(); noiseSource.disconnect(); } catch(e){} noiseSource = null; } }
 
+        function makeDistortionCurve(amount) {
+            let n_samples = 44100;
+            let curve = new Float32Array(n_samples);
+            for (let i = 0; i < n_samples; ++i) {
+                let x = i * 2 / n_samples - 1;
+                curve[i] = x < -0.5 ? -0.5 : (x > 0.5 ? 0.5 : x);
+            }
+            return curve;
+        }
+
         function initAudio() {
             if (!uiCtx) uiCtx = new (window.AudioContext || window.webkitAudioContext)();
             if (uiCtx.state === 'suspended') uiCtx.resume();
             if (!waveCtx) {
                 waveCtx = new (window.AudioContext || window.webkitAudioContext)();
+                
+                masterGainNode = waveCtx.createGain();
+                masterWaveShaper = waveCtx.createWaveShaper();
+                masterWaveShaper.curve = null;
+                masterWaveShaper.oversample = '4x';
+                
+                masterGainNode.connect(masterWaveShaper);
+                masterWaveShaper.connect(waveCtx.destination);
+
                 for (let i = 0; i < 3; i++) {
                     let osc = waveCtx.createOscillator(); let gain = waveCtx.createGain();
                     osc.type = 'sine'; osc.frequency.setValueAtTime(waves[i].f, waveCtx.currentTime);
                     gain.gain.setValueAtTime(0, waveCtx.currentTime); osc.connect(gain);
-                    gain.connect(waveCtx.destination); osc.start(); oscillators.push({ osc: osc, gain: gain });
+                    gain.connect(masterGainNode); osc.start(); oscillators.push({ osc: osc, gain: gain });
                 }
             }
             if (waveCtx.state === 'suspended') waveCtx.resume();
@@ -1062,6 +1238,12 @@
                     try { populateMediumSelect(currentLang); } catch(e){}
                     try { calculateWaveLength(); } catch(e){}
                     try { playAudioCue('glassBell'); } catch(e){}
+                    
+                    // ЗАПУСК СИСТЕМЫ УВЕДОМЛЕНИЙ ПРИ СТАРТЕ
+                    setTimeout(() => showToast(i18n[currentLang].toastWelcome, i18n[currentLang].toastWelcomeTxt, "✨"), 1000);
+                    setTimeout(() => showToast(i18n[currentLang].toastUpdate, i18n[currentLang].toastUpdateTxt, "🔥"), 4500);
+                    setTimeout(() => showToast(i18n[currentLang].toastSec, i18n[currentLang].toastSecTxt, "💡"), 9000);
+                    showOnboardingPointers();
                 }, 50);
             }, 300);
         }
@@ -1201,6 +1383,29 @@
             setGlassState(true); playAudioCue('mainPulse');
         }
 
+        const canvasResizeObserver = new ResizeObserver(entries => {
+            requestAnimationFrame(() => {
+                for (let entry of entries) {
+                    const wrapper = entry.target;
+                    const canvas = wrapper.querySelector('canvas');
+                    if (canvas) {
+                        const w = Math.floor(wrapper.clientWidth);
+                        const h = Math.floor(wrapper.clientHeight);
+                        if (w > 0 && h > 0 && (canvas.width !== w || canvas.height !== h)) {
+                            canvas.width = w;
+                            canvas.height = h;
+                        }
+                    }
+                }
+            });
+        });
+
+        window.addEventListener('DOMContentLoaded', () => {
+            document.querySelectorAll('.canvas-wrapper').forEach(wrapper => {
+                canvasResizeObserver.observe(wrapper);
+            });
+        });
+
         function resizeCanvasElement(canvas) {
             if(!canvas || !canvas.parentElement) return;
             const w = Math.floor(canvas.parentElement.clientWidth); const h = Math.floor(canvas.parentElement.clientHeight);
@@ -1270,17 +1475,21 @@
         
         function setPreset(type) {
             currentPreset = type; document.querySelectorAll('.presets-row button').forEach(b => b.classList.remove('active')); let activeBtn = document.getElementById('pr_' + type); if(activeBtn) activeBtn.classList.add('active');
-            if (type === 'sine') { waves[0] = { f: 440, a: 80, p: 0 }; waves[1] = { f: 880, a: 0, p: 0 }; waves[2] = { f: 1320, a: 0, p: 0 }; isClipped = false; }
-            else if (type === 'square') { waves[0] = { f: 400, a: 100, p: 0 }; waves[1] = { f: 1200, a: 33, p: 0 }; waves[2] = { f: 2000, a: 20, p: 0 }; }
-            else if (type === 'triangle') { waves[0] = { f: 400, a: 100, p: 0 }; waves[1] = { f: 1200, a: 11, p: 180 }; waves[2] = { f: 2000, a: 4, p: 0 }; }
-            else if (type === 'sawtooth') { waves[0] = { f: 400, a: 100, p: 0 }; waves[1] = { f: 800, a: 50, p: 180 }; waves[2] = { f: 1200, a: 33, p: 0 }; }
+            if (type === 'sine') { waves[0] = { f: 440, a: 80, p: 0, type: 'sine' }; waves[1] = { f: 880, a: 0, p: 0, type: 'sine' }; waves[2] = { f: 1320, a: 0, p: 0, type: 'sine' }; isClipped = false; }
+            else if (type === 'square') { waves[0] = { f: 400, a: 100, p: 0, type: 'square' }; waves[1] = { f: 1200, a: 33, p: 0, type: 'square' }; waves[2] = { f: 2000, a: 20, p: 0, type: 'square' }; }
+            else if (type === 'triangle') { waves[0] = { f: 400, a: 100, p: 0, type: 'triangle' }; waves[1] = { f: 1200, a: 11, p: 180, type: 'triangle' }; waves[2] = { f: 2000, a: 4, p: 0, type: 'triangle' }; }
+            else if (type === 'sawtooth') { waves[0] = { f: 400, a: 100, p: 0, type: 'sawtooth' }; waves[1] = { f: 800, a: 50, p: 180, type: 'sawtooth' }; waves[2] = { f: 1200, a: 33, p: 0, type: 'sawtooth' }; }
             updateLabels(); updateDynamicButtons(); updateWaveAudio(); playAudioCue('mainPulse');
         }
 
+        document.querySelectorAll('.presets-row button').forEach(btn => {
+            btn.addEventListener('click', () => { let id = btn.id.replace('pr_', ''); waves[currentWave].type = id; });
+        });
+
         function toggleClip() { isClipped = !isClipped; updateLabels(); updateDynamicButtons(); updateWaveAudio(); playAudioCue('mainPulse'); }
         
         function resetAll() {
-            waves = [{ f: 440, a: 80, p: 0 }, { f: 880, a: 0, p: 0 }, { f: 1320, a: 0, p: 0 }]; isClipped = false; isLissajous = false; clearBackground();
+            waves = [{ f: 440, a: 80, p: 0, type: 'sine' }, { f: 880, a: 0, p: 0, type: 'sine' }, { f: 1320, a: 0, p: 0, type: 'sine' }]; isClipped = false; isLissajous = false; clearBackground();
             let lisBtn = document.getElementById('btnLissajous'); if(lisBtn) { lisBtn.classList.remove('active'); }
             safeSetText('lblLisMode', ""); animSpeedMultiplier = 1.0;
             let elSpeed = document.getElementById('speed'); if(elSpeed) elSpeed.value = 1.0; updateSpeedValue(1.0);
@@ -1288,10 +1497,16 @@
         }
 
         function updateWaveAudio() {
-            if (!waveCtx || oscillators.length === 0) return; const now = waveCtx.currentTime;
+            if (!waveCtx || oscillators.length === 0 || !masterWaveShaper) return; 
+            const now = waveCtx.currentTime;
+
+            if (isClipped) { masterWaveShaper.curve = makeDistortionCurve(400); } 
+            else { masterWaveShaper.curve = null; }
+
             for (let i = 0; i < 3; i++) {
-                oscillators[i].osc.frequency.setTargetAtTime(waves[i].f, now, 0.03); oscillators[i].osc.type = isClipped ? 'square' : 'sine';
-                let targetVol = 0; if (isAudioOn && waves[i].a > 0) { targetVol = (waves[i].a / 100) * 0.12; if (isClipped) targetVol *= 1.4; }
+                oscillators[i].osc.frequency.setTargetAtTime(waves[i].f, now, 0.03); 
+                oscillators[i].osc.type = waves[i].type || 'sine';
+                let targetVol = 0; if (isAudioOn && waves[i].a > 0) { targetVol = (waves[i].a / 100) * 0.12; }
                 oscillators[i].gain.gain.setTargetAtTime(targetVol, now, 0.05);
             }
         }
@@ -1302,19 +1517,46 @@
         function changeFilter(f) { let bl = document.getElementById('bg-layer'); if(bl) bl.style.filter = f; buildSelectOptions(); playAudioCue('click'); }
         function clearBackground() { let bl = document.getElementById('bg-layer'); if(bl) bl.style.backgroundImage = 'none'; let bu = document.getElementById('bgUpload'); if(bu) bu.value = ''; playAudioCue('mainPulse'); }
         function uploadBackground(e) { if (e.target.files[0]) { const r = new FileReader(); r.onload = ev => { let bl = document.getElementById('bg-layer'); if(bl) bl.style.backgroundImage = `url('${ev.target.result}')`; playAudioCue('glassBell'); }; r.readAsDataURL(e.target.files[0]); } }
-        function downloadGraph(id) { const c = document.getElementById(id); if(!c) return; const l = document.createElement('a'); l.download = 'HarmoniX_Graph.png'; const tc = document.createElement('canvas'); tc.width = c.width; tc.height = c.height; const tCtx = tc.getContext('2d'); tCtx.fillStyle = '#ffffff'; tCtx.fillRect(0,0,tc.width,tc.height); tCtx.drawImage(c,0,0); l.href = tc.toDataURL(); l.click(); playAudioCue('cameraSnap'); }
+        
+        function downloadGraph(id) { 
+            const c = document.getElementById(id); if(!c) return; 
+            
+            let btn = document.querySelector('.btn-camera-snap');
+            if (btn) {
+                let flash = document.createElement('div');
+                flash.className = 'camera-flash-overlay';
+                flash.style.animation = 'flashAnim 0.4s ease-out';
+                c.parentElement.appendChild(flash);
+                setTimeout(() => flash.remove(), 400);
+            }
+
+            const l = document.createElement('a'); l.download = 'HarmoniX_Graph.png'; 
+            const tc = document.createElement('canvas'); tc.width = c.width; tc.height = c.height; 
+            const tCtx = tc.getContext('2d'); tCtx.fillStyle = '#ffffff'; tCtx.fillRect(0,0,tc.width,tc.height); 
+            tCtx.drawImage(c,0,0); l.href = tc.toDataURL(); l.click(); 
+        }
+
+        function getWaveValue(type, phase) {
+            switch (type) {
+                case 'square': return Math.sign(Math.sin(phase));
+                case 'sawtooth': return 2 * (phase / (2 * Math.PI) - Math.floor(phase / (2 * Math.PI) + 0.5));
+                case 'triangle': return 1 - 4 * Math.abs(Math.round(phase / (2 * Math.PI)) - phase / (2 * Math.PI));
+                case 'sine':
+                default: return Math.sin(phase);
+            }
+        }
 
         let lastTelemUpdate = 0;
         function draw() {
             if (!isPaused) time += (BASE_ANIM_SPEED * animSpeedMultiplier);
             let c1 = document.getElementById('canvas-single'); let c2 = document.getElementById('canvas-sum'); let c3 = document.getElementById('canvas-spectrum');
-            if(c1) resizeCanvasElement(c1); if(c2) resizeCanvasElement(c2); if(c3) resizeCanvasElement(c3);
+            
             let ctx1 = c1 ? c1.getContext('2d') : null; if(ctx1) ctx1.clearRect(0, 0, c1.width, c1.height);
             let ctx2 = c2 ? c2.getContext('2d') : null; if(ctx2) ctx2.clearRect(0, 0, c2.width, c2.height);
             let ctx3 = c3 ? c3.getContext('2d') : null; if(ctx3) ctx3.clearRect(0, 0, c3.width, c3.height);
 
             let baseColor = cachedBaseColor; let sumColor = "#E91E63"; let gridColor = "rgba(128,128,128,0.22)";
-            const wParams = waves.map(w => ({ vf: (w.f / 200) || 1, pr: w.p * (Math.PI / 180), amp: (w.a / 100) }));
+            const wParams = waves.map(w => ({ vf: (w.f / 200) || 1, pr: w.p * (Math.PI / 180), amp: (w.a / 100), type: w.type || 'sine' }));
             const c1mid = c1 ? c1.height / 2 : 0; const c1amp = c1 ? c1.height / 2.5 : 0;
             const c2mid = c2 ? c2.height / 2 : 0; const c2amp = c2 ? c2.height / 2.5 : 0;
 
@@ -1340,7 +1582,8 @@
                     for (let t = 0; t < Math.PI * 4; t += 0.05) { let lx = c1.width/2 + Math.cos(t * wParams[0].vf - time + wParams[0].pr) * wParams[0].amp * (c1.width/3); let ly = c1mid - Math.sin(t * wParams[1].vf - time + wParams[1].pr) * wParams[1].amp * c1amp; ctx1.lineTo(lx, ly); }
                 } else {
                     for (let x = 0; x < c1.width; x += 2) {
-                        let y = Math.cos(x * 0.02 * wParams[currentWave].vf - time + wParams[currentWave].pr) * wParams[currentWave].amp * c1amp;
+                        let phaseCalc = x * 0.02 * wParams[currentWave].vf - time + wParams[currentWave].pr;
+                        let y = getWaveValue(wParams[currentWave].type, phaseCalc) * wParams[currentWave].amp * c1amp;
                         if (x === 0) { ctx1.moveTo(x, c1mid - y); singleInstantY = y / c1amp; } else ctx1.lineTo(x, c1mid - y);
                     }
                 }
@@ -1352,7 +1595,11 @@
                 let clipLimit = c2.height / 4; ctx2.beginPath(); 
                 ctx2.strokeStyle = isMaskingTZI ? '#00E676' : sumColor; ctx2.lineWidth = isMaskingTZI ? 1.5 : 2.5;
                 for (let x = 0; x < c2.width; x += 2) {
-                    let sumY = 0; for (let i = 0; i < 3; i++) { sumY += Math.cos(x * 0.02 * wParams[i].vf - time + wParams[i].pr) * wParams[i].amp * c2amp; }
+                    let sumY = 0; 
+                    for (let i = 0; i < 3; i++) { 
+                        let phaseCalc = x * 0.02 * wParams[i].vf - time + wParams[i].pr;
+                        sumY += getWaveValue(wParams[i].type, phaseCalc) * wParams[i].amp * c2amp;
+                    }
                     if (isClipped) { if (sumY > clipLimit) sumY = clipLimit; if (sumY < -clipLimit) sumY = -clipLimit; }
                     if (isMaskingTZI) { sumY += (Math.random() * 40 - 20); }
                     if (x === 0) { ctx2.moveTo(x, c2mid - sumY/1.5); sumInstantY = sumY / c2amp; } else ctx2.lineTo(x, c2mid - sumY/1.5);
@@ -1367,6 +1614,16 @@
                 let tSY = document.getElementById('telSumY'); if(tSY) tSY.innerText = (sumInstantY >= 0 ? "+" : "") + sumInstantY.toFixed(2);
                 let activePeaks = waves.filter(item => item.a > 0).length; if (isClipped && waves[0].a > 0) activePeaks += 4;
                 let tSP = document.getElementById('telSpecPeaks'); if(tSP) tSP.innerText = activePeaks;
+
+                let thdEl = document.getElementById('telemTHD');
+                let limitEl = document.getElementById('telemLimit');
+                if (isClipped) {
+                    if(thdEl) { thdEl.style.display = 'inline-flex'; document.getElementById('telTHDVal').innerText = "≈ 43%"; }
+                    if(limitEl) { limitEl.style.display = 'inline-flex'; document.getElementById('telLimitVal').innerText = "± 25%"; }
+                } else {
+                    if(thdEl) thdEl.style.display = 'none';
+                    if(limitEl) limitEl.style.display = 'none';
+                }
             }
 
             if(ctx3 && c3.width > 0) {
@@ -1377,10 +1634,20 @@
                 if (isGlowOn) { ctx3.shadowBlur = 10; ctx3.shadowColor = "#4CAF50"; }
                 for (let i = 0; i < 3; i++) { if (wParams[i].amp > 0) { let xPos = (waves[i].f / 20000) * c3.width; let h = wParams[i].amp * (c3.height - 32); ctx3.fillRect(Math.max(xPos, 5), c3.height - 18 - h, 10, h); } }
 
-                if (isClipped && wParams[0].amp > 0) {
+                if (isClipped) {
                     ctx3.fillStyle = "rgba(255, 87, 34, 0.9)";
                     if (isGlowOn) { ctx3.shadowBlur = 10; ctx3.shadowColor = "rgba(255, 87, 34, 1)"; }
-                    for (let i = 3; i <= 9; i += 2) { let fakeF = waves[0].f * i; if (fakeF > 20000) break; let xPos = (fakeF / 20000) * c3.width; let h = (waves[0].a / (i*2) / 100) * (c3.height - 32); ctx3.fillRect(Math.max(xPos, 5), c3.height - 18 - h, 6, h); }
+                    for (let w = 0; w < 3; w++) {
+                        if (wParams[w].amp > 0) {
+                            for (let i = 3; i <= 15; i += 2) { 
+                                let fakeF = waves[w].f * i; 
+                                if (fakeF > 20000) break; 
+                                let xPos = (fakeF / 20000) * c3.width; 
+                                let h = (waves[w].a / (i*1.5) / 100) * (c3.height - 32); 
+                                ctx3.fillRect(Math.max(xPos, 5), c3.height - 18 - h, 6, h); 
+                            }
+                        }
+                    }
                 }
 
                 if (isMaskingTZI) {
@@ -1392,11 +1659,8 @@
             animationFrameId = requestAnimationFrame(draw);
         }
 
-        /* 
-         * ГЕНЕРАТОР ВОПРОСОВ (С ВИКИ-ССЫЛКАМИ)
-         */
         function generateDynamicQuestion(index) {
-            const freqs = [10, 20, 50, 100, 200, 440, 500, 1000]; const f = freqs[Math.floor(Math.random() * freqs.length)]; const v = [340, 1480, 5900][Math.floor(Math.random() * 3)]; const isRu = currentLang === 'ru';
+            const freqs = [10, 20, 50, 100, 200, 440, 500, 1000]; const f = freqs[index % freqs.length]; const v = [340, 1480, 5900][index % 3]; const isRu = currentLang === 'ru';
             const templates = [
                 () => { let T = (1/f).toFixed(4).replace(/\.?0+$/, ""); return { q: isRu ? `Чему равен период (T) при частоте ${f} Гц?` : `What is the period (T) at frequency ${f} Hz?`, opts: [{t: `${T} ${isRu?'с':'s'}`, c:true}, {t: `${(2/f).toFixed(4)} ${isRu?'с':'s'}`, c:false}, {t: `${(1/(f*2)).toFixed(4)} ${isRu?'с':'s'}`, c:false}], reason: isRu ? `T = 1 / V = 1 / ${f} = ${T} с.` : `T = 1 / V = 1 / ${f} = ${T} s.`, link: isRu ? 'https://ru.wikipedia.org/wiki/Период_колебаний' : 'https://en.wikipedia.org/wiki/Frequency' } },
                 () => { let l = (v/f).toFixed(2); return { q: isRu ? `Скорость звука ${v} м/с. Какова длина волны при ${f} Гц?` : `Sound speed is ${v} m/s. What is the wavelength at ${f} Hz?`, opts: [{t: `${l} ${isRu?'м':'m'}`, c:true}, {t: `${(v*f).toFixed(0)} ${isRu?'м':'m'}`, c:false}, {t: `${(v/(f*2)).toFixed(2)} ${isRu?'м':'m'}`, c:false}], reason: isRu ? `λ = v / V = ${v} / ${f} = ${l} м.` : `λ = v / V = ${v} / ${f} = ${l} m.`, link: isRu ? 'https://ru.wikipedia.org/wiki/Длина_волны' : 'https://en.wikipedia.org/wiki/Wavelength' } },
@@ -1473,7 +1737,10 @@
             quizAnswers = {}; quizQuestionsList = []; currentQuestionIdx = 0;
 
             for (let i = 0; i < n; i++) {
-                const item = generateDynamicQuestion(i); item.opts = shuffle([...item.opts]); quizQuestionsList.push(item);
+                let randomIdx = Math.floor(Math.random() * 1000);
+                const item = generateDynamicQuestion(randomIdx); 
+                item.opts = shuffle([...item.opts]); 
+                quizQuestionsList.push(item);
             }
             renderCurrentQuestion();
 
@@ -1532,9 +1799,6 @@
             playAudioCue('click');
         }
 
-        /* 
-         * АНИМАЦИЯ КРУГА И ПОДСЧЕТА ПРОЦЕНТОВ (COUNT-UP) 
-         */
         function animateScoreCounter(targetPercent, onFinish) {
             const text = document.getElementById('scoreCircleText');
             const circle = document.getElementById('scoreProgress');
@@ -1605,4 +1869,4 @@
 
     </script>
 </body>
-</html>
+</html>