
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

html,body{margin:0;font-family:'Inter', 'Segoe UI', sans-serif;background:url('assets/oboi.png') center/cover no-repeat fixed;color:#2d3a55;transition:background 0.5s ease;min-height:100vh;overflow:hidden;position:fixed;width:100%;height:100%;-webkit-context-menu:none !important;-moz-context-menu:none !important;user-select:none !important;-webkit-user-select:none !important;-moz-user-select:none !important;-ms-user-select:none !important;overscroll-behavior:none;overscroll-behavior-y:none;-webkit-overscroll-behavior:none;-webkit-overscroll-behavior-y:none;touch-action:pan-y;-webkit-overflow-scrolling:touch}

:root{
    --app-surface:rgba(25,35,55,0.92);
    --app-surface-alt:rgba(30,42,65,0.88);
    --header-bg:linear-gradient(135deg,rgba(35,50,75,0.95) 0%,rgba(25,40,65,0.95) 100%);
    --header-border:rgba(100,150,255,0.3);
    --header-shadow:0 8px 32px rgba(0,0,0,0.4);
    --text-primary:#e8f0ff;
    --text-secondary:#b0c5e0;
    --accent:#5a8fff;
    --accent-strong:#4070ff;
    --accent-soft:#3a5a90;
    --card-border:rgba(100,150,255,0.25);
    --card-shadow:0 12px 40px rgba(0,0,0,0.5);
    --teacher-bubble:rgba(40,55,80,0.85);
    --player-bubble:linear-gradient(135deg,#5a8fff 0%,#4070ff 100%);
    --system-bubble:rgba(50,65,90,0.75);
    --dropzone-border:#5a8fff;
    --dropzone-bg:rgba(90,143,255,0.15);
    --success:#50d890;
    --danger:#ff6b6b;
}

/* Disable text selection and context menu (STRICT for п. 1.6.2.7) */
*, *::before, *::after {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Specifically target game container */
#app, #app * {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

/* СТРОГАЯ блокировка контекстного меню */
#app {
    -webkit-context-menu: none !important;
    -moz-context-menu: none !important;
}

/* Allow selection ONLY for Yandex ads */
[id*="yandex"], [id*="yandex"] *,
[class*="yandex"], [class*="yandex"] *,
iframe, iframe *,
[id*="adv"], [id*="adv"] *,
[class*="adv"], [class*="adv"] * {
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    user-select: auto !important;
}

/* Disable context menu - handled by JavaScript */
/* Prevent drag and drop - handled by JavaScript */

/* Lesson-specific themes - используем ту же картинку фона */
body.lesson-1,body.lesson-2,body.lesson-3,body.lesson-4,body.lesson-5,body.lesson-6,body.lesson-7{background:url('assets/oboi.png') center/cover no-repeat fixed !important}
#app{
width:920px;
height:620px;
max-width:calc(100vw - 20px);
max-height:calc(100vh - 20px);
margin:0;
padding:0;
border-radius:24px;
background:var(--app-surface);
box-shadow:var(--card-shadow),0 0 0 1px rgba(100,150,255,0.2) inset;
display:flex;
flex-direction:column;
position:fixed;
top:50%;
left:50%;
transform:translate(-50%,-50%);
overflow:hidden;
border:2px solid var(--card-border);
backdrop-filter:blur(20px) saturate(180%);
box-sizing:border-box;
overscroll-behavior:none;
overscroll-behavior-y:none;
-webkit-overscroll-behavior:none;
-webkit-overscroll-behavior-y:none;
touch-action:pan-y;
animation:appFadeIn 0.6s cubic-bezier(0.16,1,0.3,1);
}

@keyframes appFadeIn{
0%{opacity:0;transform:translate(-50%,-50%) scale(0.95);}
100%{opacity:1;transform:translate(-50%,-50%) scale(1);}
}

/* Desktop responsiveness - предотвращение обрезания элементов */
@media (max-width: 960px) {
    #app {
        width: calc(100vw - 20px);
        max-width: 920px;
        height: calc(100vh - 20px);
        max-height: 620px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #app {
        width: 95vw;
        height: 80vh;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        top: 50%;
        border-radius: 8px;
    }
    
    #chat-header {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .home-button {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        font-size: 22px;
        z-index: 1000;
    }
    
    .chat-title {
        font-size: 14px;
    }
    
    .typing-status {
        font-size: 12px;
    }
    
    .message {
        margin: 8px 0;
    }
    
    .bubble {
        max-width: 80%;
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .avatar {
        width: 28px;
        height: 28px;
    }
    
    #choices {
        padding: 10px 15px;
        min-height: 60px;
    }
    
    .falling-answer {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .drop-zone {
        padding: 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    #app {
        width: calc(100vw - 10px);
        height: calc(100vh - 10px);
        max-width: calc(100vw - 10px);
        max-height: calc(100vh - 10px);
        border-radius: 6px;
    }
    
    #chat-header {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .home-button {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        font-size: 22px;
        z-index: 1000;
    }
    
    .chat-title {
        font-size: 12px;
    }
    
    .typing-status {
        font-size: 10px;
    }
    
    .bubble {
        max-width: 85%;
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .avatar {
        width: 24px;
        height: 24px;
    }
    
    #choices {
        padding: 8px 12px;
        min-height: 50px;
    }
    
    .falling-answer {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .drop-zone {
        padding: 12px;
        font-size: 12px;
    }
}

/* Touch improvements for mobile */
@media (max-width: 768px) {
    .falling-answer {
        touch-action: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    button {
        -webkit-tap-highlight-color: transparent;
        min-height: 44px;
        min-width: 44px;
    }
    
    .context-menu-item {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .side-panel {
        width: 90vw;
        max-width: 350px;
    }
}

/* Background elements container */
#background-elements{
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
pointer-events:none;
z-index:0;
/* БЛОКИРОВКА ПКМ на фоновых элементах для п. 1.6.2.7 */
-webkit-context-menu:none !important;
-moz-context-menu:none !important;
user-select:none !important;
-webkit-user-select:none !important;
-moz-user-select:none !important;
-ms-user-select:none !important;
}

/* Floating objects */
.floating-object{
position:absolute;
border-radius:50%;
opacity:0.1;
animation:float 6s ease-in-out infinite;
}

.floating-object:nth-child(odd){
animation-direction:reverse;
animation-duration:8s;
}

@keyframes float{
0%,100%{transform:translateY(0px) rotate(0deg)}
50%{transform:translateY(-20px) rotate(180deg)}
}

/* Lesson-specific background objects */
body.lesson-1 #background-elements::before{
content:'';
position:absolute;
top:10%;
left:10%;
width:60px;
height:60px;
background:radial-gradient(circle,#4a90e2,#2c5aa0);
border-radius:50%;
animation:float 4s ease-in-out infinite;
opacity:0.15;
}

body.lesson-1 #background-elements::after{
content:'';
position:absolute;
top:70%;
right:15%;
width:40px;
height:40px;
background:radial-gradient(circle,#ff6b6b,#cc5555);
border-radius:50%;
animation:float 6s ease-in-out infinite reverse;
opacity:0.1;
}

body.lesson-2 #background-elements::before{
content:'';
position:absolute;
top:20%;
right:20%;
width:80px;
height:80px;
background:linear-gradient(45deg,#9b59b6,#8e44ad);
border-radius:20px;
animation:float 5s ease-in-out infinite;
opacity:0.12;
}

body.lesson-2 #background-elements::after{
content:'';
position:absolute;
bottom:20%;
left:20%;
width:50px;
height:50px;
background:linear-gradient(45deg,#e74c3c,#c0392b);
border-radius:50%;
animation:float 7s ease-in-out infinite reverse;
opacity:0.08;
}

body.lesson-3 #background-elements::before{
content:'';
position:absolute;
top:30%;
left:30%;
width:70px;
height:70px;
background:linear-gradient(45deg,#f39c12,#e67e22);
border-radius:50%;
animation:float 6s ease-in-out infinite;
opacity:0.1;
}

body.lesson-3 #background-elements::after{
content:'';
position:absolute;
bottom:30%;
right:30%;
width:45px;
height:45px;
background:linear-gradient(45deg,#27ae60,#229954);
border-radius:50%;
animation:float 8s ease-in-out infinite reverse;
opacity:0.12;
}

body.lesson-4 #background-elements::before{
content:'';
position:absolute;
top:15%;
right:25%;
width:65px;
height:65px;
background:linear-gradient(45deg,#2ecc71,#27ae60);
border-radius:50%;
animation:float 5s ease-in-out infinite;
opacity:0.11;
}

body.lesson-4 #background-elements::after{
content:'';
position:absolute;
bottom:15%;
left:25%;
width:55px;
height:55px;
background:linear-gradient(45deg,#3498db,#2980b9);
border-radius:50%;
animation:float 7s ease-in-out infinite reverse;
opacity:0.09;
}

body.lesson-5 #background-elements::before{
content:'';
position:absolute;
top:25%;
left:15%;
width:75px;
height:75px;
background:linear-gradient(45deg,#e74c3c,#c0392b);
border-radius:50%;
animation:float 6s ease-in-out infinite;
opacity:0.13;
}

body.lesson-5 #background-elements::after{
content:'';
position:absolute;
bottom:25%;
right:15%;
width:60px;
height:60px;
background:linear-gradient(45deg,#f39c12,#e67e22);
border-radius:50%;
animation:float 8s ease-in-out infinite reverse;
opacity:0.1;
}

body.lesson-6 #background-elements::before{
content:'';
position:absolute;
top:35%;
right:35%;
width:55px;
height:55px;
background:linear-gradient(45deg,#f1c40f,#f39c12);
border-radius:50%;
animation:float 5s ease-in-out infinite;
opacity:0.12;
}

body.lesson-6 #background-elements::after{
content:'';
position:absolute;
bottom:35%;
left:35%;
width:70px;
height:70px;
background:linear-gradient(45deg,#1abc9c,#16a085);
border-radius:50%;
animation:float 7s ease-in-out infinite reverse;
opacity:0.08;
}

body.lesson-7 #background-elements::before{
content:'';
position:absolute;
top:20%;
left:20%;
width:80px;
height:80px;
background:linear-gradient(45deg,#9b59b6,#8e44ad);
border-radius:50%;
animation:float 6s ease-in-out infinite;
opacity:0.15;
}

body.lesson-7 #background-elements::after{
content:'';
position:absolute;
bottom:20%;
right:20%;
width:50px;
height:50px;
background:linear-gradient(45deg,#34495e,#2c3e50);
border-radius:50%;
animation:float 8s ease-in-out infinite reverse;
opacity:0.1;
}
#chat-header{
background:var(--header-bg);
padding:20px 28px;
border-radius:24px 24px 0 0;
display:flex;
justify-content:space-between;
align-items:center;
border-bottom:1px solid var(--header-border);
position:relative;
z-index:10;
box-shadow:var(--header-shadow);
gap: 16px;
color:var(--text-primary);
backdrop-filter:blur(10px);
}

.home-button {
    background: linear-gradient(135deg,rgba(90,143,255,0.25),rgba(64,112,255,0.2));
    border: 2px solid rgba(90,143,255,0.4);
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
    font-size: 22px;
    color: var(--accent);
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3),0 0 0 1px rgba(90,143,255,0.2) inset;
    -webkit-context-menu: none !important;
    -moz-context-menu: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(90,143,255,0.3) !important;
    position: relative;
    z-index: 100;
    backdrop-filter:blur(10px);
}

.home-button:hover {
    background: linear-gradient(135deg,rgba(90,143,255,0.4),rgba(64,112,255,0.35));
    border-color: rgba(90,143,255,0.6);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 32px rgba(90,143,255,0.4),0 0 0 1px rgba(90,143,255,0.4) inset;
}

.home-button:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.chat-title {
    flex: 1;
    text-align: center;
}


.volume-slider{
width:100%;
height:6px;
background:var(--accent-soft);
border-radius:4px;
outline:none;
-webkit-appearance:none;
appearance:none;
}

.volume-slider::-webkit-slider-thumb{
-webkit-appearance:none;
appearance:none;
width:18px;
height:18px;
background:linear-gradient(135deg,var(--accent),var(--accent-strong));
border-radius:50%;
cursor:pointer;
border:2px solid rgba(126,152,255,0.35);
box-shadow:0 10px 18px rgba(74,124,243,0.25);
}

.volume-slider::-webkit-slider-thumb:hover{
background:linear-gradient(135deg,#5c8dff,#3f6dee);
transform:scale(1.08);
}

.volume-slider::-moz-range-thumb{
width:18px;
height:18px;
background:linear-gradient(135deg,var(--accent),var(--accent-strong));
border-radius:50%;
cursor:pointer;
border:2px solid rgba(126,152,255,0.35);
box-shadow:0 10px 18px rgba(74,124,243,0.25);
}

.volume-display{
color:var(--text-secondary);
font-size:12px;
margin-top:4px;
text-align:right;
}
.chat-title{font-weight:600;font-size:16px;flex:1;text-align:center;color:var(--text-primary)}
.typing-status{font-size:12px;color:var(--text-secondary)}
#messages{flex:1;padding:20px 24px;overflow-y:auto;display:flex;flex-direction:column;scrollbar-width:none;-ms-overflow-style:none;position:relative;z-index:10;-webkit-overflow-scrolling:touch;touch-action:pan-y;will-change:scroll-position;background:var(--app-surface-alt);}
#messages::-webkit-scrollbar{display:none}
#messages.scroll-locked{overflow:hidden;touch-action:none}
/* Разрешаем скроллинг для всех дочерних элементов внутри #messages */
#messages * {touch-action:inherit}
#choices{
padding:20px 28px;
background:linear-gradient(135deg,rgba(30,42,65,0.9) 0%,rgba(25,35,55,0.88) 100%);
border-top:2px solid rgba(100,150,255,0.25);
position:relative;
z-index:1000;
min-height:90px;
display:flex;
align-items:center;
justify-content:center;
box-shadow:0 -8px 24px rgba(0,0,0,0.4);
backdrop-filter:blur(10px);
overflow:visible !important;
}

/* Falling answers system */
.falling-answer{
position:absolute;
top:-100px;
padding:10px 16px;
background:linear-gradient(135deg,#5a8fff,#4070ff);
color:#e8f0ff;
border-radius:12px;
cursor:grab;
user-select:none;
font-size:14px;
font-weight:600;
box-shadow:0 8px 24px rgba(0,0,0,0.5),0 0 0 2px rgba(90,143,255,0.3) inset;
transition:all 0.3s cubic-bezier(0.34,1.56,0.64,1);
z-index:5000;
border:2px solid rgba(90,143,255,0.4);
pointer-events:auto;
touch-action:none;
backdrop-filter:blur(10px);
will-change:transform;
min-width:auto;
max-width:280px;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
display:inline-block;
}

.falling-answer:hover{
transform:translateY(-3px) scale(1.05) rotate(-2deg);
box-shadow:0 12px 32px rgba(90,143,255,0.6),0 0 0 2px rgba(90,143,255,0.5) inset;
}

.falling-answer.dragging{
    cursor:grabbing;
    transform:scale(1.12) rotate(5deg);
    box-shadow:0 16px 48px rgba(90,143,255,0.7),0 0 0 3px rgba(90,143,255,0.6) inset;
    z-index:10000;
    background:linear-gradient(135deg,#4070ff,#3060e0);
    color:#e8f0ff;
    transition:none;
    will-change:transform;
    animation:dragPulse 0.6s ease-in-out infinite;
    pointer-events:auto;
    position:fixed;
    touch-action:none;
}

@keyframes dragPulse{
0%,100%{box-shadow:0 16px 48px rgba(90,143,255,0.7),0 0 0 3px rgba(90,143,255,0.6) inset;}
50%{box-shadow:0 20px 56px rgba(90,143,255,0.9),0 0 0 4px rgba(90,143,255,0.8) inset;}
}

/* Подсветка самого ответа при наведении на drop-zone */
.falling-answer.over-drop-zone{
    background:linear-gradient(135deg,var(--success),#3aa96d) !important;
    border-color:rgba(76,183,130,0.4) !important;
    box-shadow:0 16px 36px rgba(76,183,130,0.35) !important;
}

.falling-answer.correct{
background:linear-gradient(135deg,var(--success),#3aa96d);
border-color:rgba(76,183,130,0.4);
}

.falling-answer.incorrect{
background:linear-gradient(135deg,#ff7676,#f45757);
border-color:rgba(244,87,87,0.4);
}

/* Drop zones */
.drop-zone{
position:absolute;
top:50%;
left:50%;
transform:translate(-50%,-50%);
width:240px;
height:80px;
border:3px dashed var(--dropzone-border);
border-radius:16px;
background:var(--dropzone-bg);
display:flex;
align-items:center;
justify-content:center;
color:var(--accent);
font-size:16px;
font-weight:600;
opacity:0;
transition:all 0.4s cubic-bezier(0.34,1.56,0.64,1);
pointer-events:auto;
box-shadow:0 8px 24px rgba(0,0,0,0.3),0 0 0 1px rgba(90,143,255,0.2) inset;
backdrop-filter:blur(10px);
}

.drop-zone.active{
opacity:1;
animation:dropZonePulse 2s ease-in-out infinite;
}

@keyframes dropZonePulse{
0%,100%{opacity:0.7;transform:translate(-50%,-50%) scale(1);}
50%{opacity:1;transform:translate(-50%,-50%) scale(1.02);}
}

.drop-zone.drag-over{
border-color:var(--success);
background:rgba(80,216,144,0.2);
color:var(--success);
transform:translate(-50%,-50%) scale(1.08);
box-shadow:0 12px 32px rgba(80,216,144,0.5),0 0 0 2px rgba(80,216,144,0.4) inset;
animation:dropZoneGlow 0.6s ease-in-out infinite;
}

@keyframes dropZoneGlow{
0%,100%{box-shadow:0 12px 32px rgba(80,216,144,0.5),0 0 0 2px rgba(80,216,144,0.4) inset;}
50%{box-shadow:0 16px 40px rgba(80,216,144,0.7),0 0 0 3px rgba(80,216,144,0.6) inset;}
}

@keyframes pulse{
0%,100%{opacity:0.7}
50%{opacity:1}
}

/* Physics animation */
@keyframes fall{
0%{
    transform:translateY(-100px) rotate(var(--tilt-angle, 0deg));
    opacity:1;
}
100%{
    /* Долетаем за пределы экрана, без исчезновения по пути */
    transform:translateY(calc(100vh + 140px)) rotate(var(--tilt-angle, 0deg));
    opacity:1;
}
}
.typing{color:var(--text-secondary);font-style:italic}
.dots{animation:typing 1.5s infinite}
@keyframes typing{0%,60%,100%{opacity:0}30%{opacity:1}}

/* Custom context menu */
.custom-context-menu{
position:fixed;
background:linear-gradient(145deg,rgba(25,35,55,0.95),rgba(30,42,65,0.92));
border:2px solid rgba(100,150,255,0.3);
border-radius:16px;
backdrop-filter:blur(20px);
box-shadow:0 18px 40px rgba(120,140,200,0.25);
z-index:10000;
min-width:200px;
padding:10px 0;
display:none;
}

.custom-context-menu.show{
display:block;
}

.context-menu-item{
padding:12px 18px;
color:var(--text-primary);
cursor:pointer;
transition:background 0.2s ease, color 0.2s ease;
font-size:14px;
display:flex;
align-items:center;
gap:10px;
}

.context-menu-item:hover{
background:rgba(74,124,243,0.12);
color:var(--accent-strong);
}

.context-menu-item:first-child{
border-radius:12px 12px 0 0;
}

.context-menu-item:last-child{
border-radius:0 0 12px 12px;
}

.context-menu-separator{
height:1px;
background:rgba(126,152,255,0.25);
margin:6px 0;
}

/* Side panels */
.side-panel{
position:fixed;
top:50%;
width:320px;
height:500px;
background:linear-gradient(145deg,rgba(25,35,55,0.95) 0%,rgba(30,42,65,0.92) 100%);
border:2px solid rgba(100,150,255,0.3);
box-shadow:0 20px 48px rgba(0,0,0,0.6);
z-index:10001;
padding:30px 26px;
overflow:hidden; /* спрячем нативный скролл, используем стрелки */
transform:translate(-100%, -50%);
transition:transform 0.25s ease, opacity 0.25s ease;
border-radius:22px;
}

.side-panel.show{
transform:translate(0, -50%);
}

.side-panel.right{
right:0;
left:auto;
transform:translate(100%, -50%);
}

.side-panel.right.show{
transform:translate(0, -50%);
}

.panel-header{
display:flex;
justify-content:space-between;
align-items:center;
margin-bottom:20px;
padding-bottom:16px;
border-bottom:1px solid rgba(126,152,255,0.25);
}

.panel-title{
font-size:19px;
font-weight:700;
color:var(--text-primary);
margin:0;
}

.panel-close{
background:linear-gradient(135deg,rgba(90,143,255,0.2),rgba(64,112,255,0.15));
border:2px solid rgba(100,150,255,0.3);
color:var(--text-primary);
font-size:18px;
cursor:pointer;
padding:0;
width:34px;
height:34px;
display:flex;
align-items:center;
justify-content:center;
border-radius:50%;
transition:all 0.2s ease;
box-shadow:0 10px 20px rgba(120,140,200,0.2);
}

.panel-close:hover{
background:linear-gradient(135deg,#f5f7ff,#e8edff);
color:var(--text-primary);
}

.panel-content{
color:var(--text-secondary);
line-height:1.65;
 /* даём блоку занять доступную высоту внутри панели */
 flex:1;
 overflow:hidden; /* прокрутка только стрелками */
}

.panel-content h3{
color:var(--text-primary);
margin:18px 0 10px 0;
font-size:16px;
}

.panel-content p{
margin:10px 0;
}

.panel-content ul{
margin:10px 0;
padding-left:20px;
}

.panel-content li{
margin:5px 0;
}

/* БЛОКИРОВКА ПКМ на overlay для п. 1.6.2.7 */
.panel-overlay{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
background:rgba(31,38,79,0.35);
z-index:10000;
opacity:0;
visibility:hidden;
transition:all 0.3s ease;
display:flex;
align-items:center;
justify-content:center;
-webkit-context-menu:none !important;
-moz-context-menu:none !important;
user-select:none !important;
-webkit-user-select:none !important;
-moz-user-select:none !important;
-ms-user-select:none !important;
}

.panel-overlay.show{
opacity:1;
visibility:visible;
}

/* Красивые диалоги */
/* БЛОКИРОВКА ПКМ на dialog-panel для п. 1.6.2.7 */
.dialog-panel {
    position: relative;
    width: 90%;
    max-width: 500px;
    padding: 48px 40px;
    text-align: center;
    background: linear-gradient(145deg, rgba(25,35,55,0.95) 0%, rgba(30,42,65,0.92) 100%);
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 2px rgba(100,150,255,0.3) inset;
    border: 1px solid rgba(126,152,255,0.35);
    animation: dialogFadeIn 0.3s ease-out;
    -webkit-context-menu:none !important;
    -moz-context-menu:none !important;
    user-select:none !important;
    -webkit-user-select:none !important;
    -moz-user-select:none !important;
    -ms-user-select:none !important;
}

@keyframes dialogFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dialog-panel h2 {
    margin: 0 0 24px 0;
    color: var(--accent);
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 6px 12px rgba(74,124,243,0.2);
}

.dialog-panel .dialog-content {
    margin-bottom: 32px;
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 16px;
}

.dialog-panel .dialog-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.dialog-panel button {
    flex: 1;
    min-width: 140px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 12px 24px rgba(120,140,200,0.22);
}

.dialog-panel button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(120,140,200,0.25);
}

.dialog-panel button:active {
    transform: translateY(0);
}

.dialog-panel .btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #e8f0ff;
}

.dialog-panel .btn-secondary {
    background: linear-gradient(135deg, #ff8a8a 0%, #f46c6c 100%);
    color: #e8f0ff;
    border: 2px solid rgba(255,107,107,0.4);
}

/* Custom scrollbar for panels */
/* Полностью скрываем нативный скроллбар у панелей */
.side-panel::-webkit-scrollbar{ width:0; height:0 }
.side-panel{ 
scrollbar-width: none;
display:flex;
flex-direction:column;
}

/* Кнопки стрелок прокрутки */
.panel-scroll-controls{position:absolute;left:0;right:0;bottom:10px;display:flex;gap:10px;justify-content:center;z-index:2}
.panel-scroll-btn{
background:linear-gradient(135deg,rgba(50,70,100,0.8),rgba(40,60,90,0.75));
border:2px solid rgba(100,150,255,0.3);
color:var(--text-primary);
border-radius:12px;
padding:8px 12px;
cursor:pointer;
min-width:40px;
display:flex;
align-items:center;
justify-content:center;
box-shadow:0 8px 20px rgba(0,0,0,0.4);
transition:all 0.3s cubic-bezier(0.34,1.56,0.64,1);
backdrop-filter:blur(10px);
}
.panel-scroll-btn:hover{
background:linear-gradient(135deg,rgba(60,80,110,0.85),rgba(50,70,100,0.8));
transform:translateY(-2px) scale(1.05);
box-shadow:0 10px 24px rgba(100,150,255,0.4);
}
.panel-scroll-btn:active{transform:translateY(1px)}
.panel-content-wrapper{position:relative;max-height:100%;overflow:hidden}
.panel-content-inner{position:relative;left:auto;right:auto;top:auto}
.message{
margin:10px 0;
position:relative;
margin-bottom:44px;
z-index:1;
animation:messageFadeIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes messageFadeIn{
0%{opacity:0;transform:translateY(20px) scale(0.95);}
100%{opacity:1;transform:translateY(0) scale(1);}
}
.message.teacher{text-align:left}
.message.player{text-align:right}
.message.system{text-align:center;font-style:italic}
.message .message-inner{display:flex;align-items:flex-end}
.message.teacher .message-inner{flex-direction:row}
.message.player .message-inner{flex-direction:row-reverse}
.avatar{
width:40px;
height:40px;
border-radius:50%;
overflow:hidden;
background:linear-gradient(135deg,rgba(90,143,255,0.3),rgba(64,112,255,0.2));
display:flex;
align-items:center;
justify-content:center;
margin:0 10px;
flex-shrink:0;
border:2px solid rgba(100,150,255,0.4);
box-shadow:0 6px 20px rgba(0,0,0,0.4);
transition:all 0.3s ease;
}
.avatar:hover{
transform:scale(1.1) rotate(5deg);
box-shadow:0 8px 24px rgba(90,143,255,0.5);
}
.avatar img{width:100%;height:100%;object-fit:cover}
.bubble{
max-width:75%;
padding:16px 20px;
border-radius:16px 16px 16px 4px;
line-height:1.6;
word-wrap:break-word;
position:relative;
font-size:15px;
box-shadow:0 8px 24px rgba(0,0,0,0.3);
transition:all 0.3s cubic-bezier(0.34,1.56,0.64,1);
border:1px solid rgba(100,150,255,0.2);
backdrop-filter:blur(10px);
}

.message.teacher .bubble{
background:var(--teacher-bubble);
border-color:rgba(100,150,255,0.3);
color:var(--text-primary);
border-radius:16px 16px 16px 4px;
}

.message.player .bubble{
background:var(--player-bubble);
border-color:rgba(90,143,255,0.5);
color:#e8f0ff;
border-radius:16px 16px 4px 16px;
}

.message.system .bubble{
background:var(--system-bubble);
margin:0 auto;
font-style:italic;
color:var(--text-secondary);
}

/* Анимация курсора при печати текста */
.bubble.typing-text::after {
    content: '|';
    animation: cursorBlink 0.8s infinite;
    margin-left: 2px;
    opacity: 0.8;
}

@keyframes cursorBlink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

.bubble {
border-radius:12px;
}
.view-photo-btn{
margin-top:12px;
background:linear-gradient(135deg,var(--accent),var(--accent-strong));
border:2px solid rgba(90,143,255,0.4);
color:#e8f0ff;
border-radius:12px;
padding:12px 20px;
cursor:pointer;
font-weight:600;
box-shadow:0 8px 24px rgba(0,0,0,0.4),0 0 0 1px rgba(90,143,255,0.2) inset;
transition:all 0.4s cubic-bezier(0.34,1.56,0.64,1);
backdrop-filter:blur(10px);
}
.view-photo-btn:hover{
background:linear-gradient(135deg,#6a9fff,#5080ff);
transform:translateY(-3px) scale(1.02);
box-shadow:0 12px 32px rgba(90,143,255,0.5),0 0 0 1px rgba(90,143,255,0.4) inset;
}
.skip-photo-btn{
margin-top:12px;
margin-left:8px;
background:linear-gradient(135deg,rgba(50,70,100,0.8),rgba(40,60,90,0.75));
border:2px solid rgba(100,150,255,0.3);
color:var(--text-primary);
border-radius:12px;
padding:12px 20px;
cursor:pointer;
font-weight:600;
box-shadow:0 8px 24px rgba(0,0,0,0.4),0 0 0 1px rgba(100,150,255,0.2) inset;
transition:all 0.4s cubic-bezier(0.34,1.56,0.64,1);
backdrop-filter:blur(10px);
}
.skip-photo-btn:hover{
background:linear-gradient(135deg,rgba(60,80,110,0.85),rgba(50,70,100,0.8));
transform:translateY(-3px) scale(1.02);
box-shadow:0 12px 32px rgba(100,150,255,0.4),0 0 0 1px rgba(100,150,255,0.3) inset;
}
.photo-skip-notice{margin-top:8px;color:var(--text-secondary);font-size:12px}
/* Реакции снизу сообщения (компактные, маленькие) */
.reaction {
    position: absolute;
    bottom: -10px;
    background: linear-gradient(135deg,rgba(35,50,75,0.9) 0%,rgba(30,42,65,0.85) 100%);
    border: 2px solid rgba(100,150,255,0.4);
    border-radius: 10px;
    backdrop-filter:blur(10px);
    padding: 1px 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    animation: reactionPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 6px 14px rgba(120,140,200,0.25);
    z-index: 10;
    min-width: 20px;
    height: 16px;
}

.message.player .bubble .reaction {
    right: 8px;
}

.message.teacher .bubble .reaction {
    left: 8px;
}

.reaction-emoji {
    font-size: 11px;
    line-height: 1;
    display: flex;
    align-items: center;
}

.reaction-count {
    color: var(--text-secondary);
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
}

@keyframes reactionPop {
    0% {
        transform: scale(0) rotate(-10deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.15) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Конфетти анимация */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #f0f;
    opacity: 0;
    pointer-events: none;
}

@keyframes confettiExplode {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx, 0), var(--ty, 100vh)) rotate(720deg) scale(0.3);
    }
}
button{
margin:6px;
padding:12px 20px;
border-radius:12px;
background:linear-gradient(135deg,var(--accent),var(--accent-strong));
color:#e8f0ff;
border:2px solid rgba(90,143,255,0.3);
cursor:pointer;
transition:all 0.4s cubic-bezier(0.34,1.56,0.64,1);
box-shadow:0 8px 24px rgba(0,0,0,0.4),0 0 0 1px rgba(90,143,255,0.2) inset;
font-weight:600;
backdrop-filter:blur(10px);
}
button:hover:not(:disabled){
background:linear-gradient(135deg,#6a9fff,#5080ff);
transform:translateY(-3px) scale(1.02);
box-shadow:0 12px 32px rgba(90,143,255,0.5),0 0 0 1px rgba(90,143,255,0.4) inset;
border-color:rgba(90,143,255,0.5);
}
button:active:not(:disabled){
transform:translateY(-1px) scale(0.98);
}
button:disabled{
cursor:not-allowed;
opacity:0.4;
box-shadow:none;
transform:none;
}

/* Кнопка "Смотреть фото" - зеленая */
button.photo-btn,
.photo-btn,
#choices button.photo-btn,
#choices .photo-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60) !important;
    border-color: rgba(46, 204, 113, 0.5) !important;
    box-shadow: 0 8px 24px rgba(46, 204, 113, 0.3) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}
button.photo-btn:hover:not(:disabled),
.photo-btn:hover:not(:disabled),
#choices button.photo-btn:hover:not(:disabled),
#choices .photo-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #3dd87a, #2ecc71) !important;
    border-color: rgba(46, 204, 113, 0.7) !important;
    box-shadow: 0 12px 32px rgba(46, 204, 113, 0.4) !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* Кнопка "Пропустить" - красная */
button.skip-btn,
.skip-btn,
#choices button.skip-btn,
#choices .skip-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
    border-color: rgba(231, 76, 60, 0.5) !important;
    box-shadow: 0 8px 24px rgba(231, 76, 60, 0.3) !important;
}
button.skip-btn:hover:not(:disabled),
.skip-btn:hover:not(:disabled),
#choices button.skip-btn:hover:not(:disabled),
#choices .skip-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #f05545, #e74c3c) !important;
    border-color: rgba(231, 76, 60, 0.7) !important;
    box-shadow: 0 12px 32px rgba(231, 76, 60, 0.4) !important;
}
img.chat-photo{max-width:300px;max-height:400px;border-radius:8px;margin:5px 0;object-fit:cover}
.photo{
    max-width:280px;
    max-height:320px;
    width:100%;
    height:auto;
    border-radius:8px;
    margin:5px 0;
    object-fit:contain;
    display:block;
    /* СТРОГАЯ блокировка взаимодействия с фото для п. 1.6.2.7 */
    /* Усиленная блокировка специально для Яндекс.Браузера */
    user-select:none !important;
    -webkit-user-select:none !important;
    -moz-user-select:none !important;
    -ms-user-select:none !important;
    -webkit-user-drag:none !important;
    -webkit-touch-callout:none !important;
    -webkit-context-menu:none !important;
    -moz-context-menu:none !important;
    -khtml-user-select:none !important;
    -o-user-select:none !important;
    pointer-events:auto;
    cursor:default !important;
    touch-action:none !important;
    -webkit-tap-highlight-color:transparent !important;
    /* Дополнительная блокировка через CSS для Яндекс.Браузера */
    -moz-user-select:-moz-none !important;
    -webkit-user-drag:none !important;
    border:2px solid rgba(126,152,255,0.5);
    box-shadow:0 8px 16px rgba(120,140,200,0.15);
}

/* Отключаем выделение текста при наведении */
::selection {
    background: transparent;
    color: inherit;
}
::-moz-selection {
    background: transparent;
    color: inherit;
}
.photo-bubble {
    /* СТРОГАЯ блокировка взаимодействия с контейнером фото для п. 1.6.2.7 */
    /* Усиленная блокировка специально для Яндекс.Браузера */
    user-select:none !important;
    -webkit-user-select:none !important;
    -moz-user-select:none !important;
    -ms-user-select:none !important;
    -webkit-context-menu:none !important;
    -moz-context-menu:none !important;
    -khtml-user-select:none !important;
    -o-user-select:none !important;
    pointer-events:auto;
    cursor:default !important;
    touch-action:none !important;
}
.photo-wrapper {
    /* Защитная обертка для фото - блокирует все контекстные меню */
    /* Усиленная блокировка специально для Яндекс.Браузера */
    user-select:none !important;
    -webkit-user-select:none !important;
    -moz-user-select:none !important;
    -ms-user-select:none !important;
    -webkit-context-menu:none !important;
    -moz-context-menu:none !important;
    -khtml-user-select:none !important;
    -o-user-select:none !important;
    pointer-events:auto;
    display:inline-block;
    position:relative;
    cursor:default !important;
    touch-action:none !important;
}

/* Прозрачный overlay поверх фото - перехватывает ВСЕ события */
.photo-overlay {
    position:absolute !important;
    top:0 !important;
    left:0 !important;
    width:100% !important;
    height:100% !important;
    z-index:999999 !important;
    cursor:default !important;
    pointer-events:auto !important;
    background:transparent !important;
    user-select:none !important;
    -webkit-user-select:none !important;
    -moz-user-select:none !important;
    -ms-user-select:none !important;
    -webkit-context-menu:none !important;
    -moz-context-menu:none !important;
    -webkit-touch-callout:none !important;
    -webkit-user-drag:none !important;
    touch-action:none !important;
    -webkit-tap-highlight-color:transparent !important;
}
.photo-message {
    /* СТРОГАЯ блокировка взаимодействия с сообщением фото для п. 1.6.2.7 */
    user-select:none !important;
    -webkit-user-select:none !important;
    -moz-user-select:none !important;
    -ms-user-select:none !important;
    -webkit-context-menu:none !important;
    -moz-context-menu:none !important;
    pointer-events:auto;
}
.photo-caption{font-size:12px;color:var(--text-secondary);text-align:center;margin-top:6px;font-style:italic}
.continue-btn{
background:linear-gradient(135deg,#50d890,#40c080);
color:#e8f0ff;
border:2px solid rgba(80,216,144,0.4);
padding:16px 32px;
border-radius:14px;
font-size:16px;
font-weight:600;
cursor:pointer;
transition:all 0.4s cubic-bezier(0.34,1.56,0.64,1);
margin:16px auto;
display:block;
box-shadow:0 8px 24px rgba(0,0,0,0.4),0 0 0 1px rgba(80,216,144,0.3) inset;
backdrop-filter:blur(10px);
}
.continue-btn:hover{
background:linear-gradient(135deg,#60e8a0,#50d890);
transform:translateY(-3px) scale(1.02);
box-shadow:0 12px 32px rgba(80,216,144,0.5),0 0 0 1px rgba(80,216,144,0.5) inset;
}
.restart-btn{
background:linear-gradient(135deg,#ff6b6b,#f45555);
color:#e8f0ff;
border:2px solid rgba(255,107,107,0.4);
padding:16px 32px;
border-radius:14px;
font-size:16px;
font-weight:600;
cursor:pointer;
transition:all 0.4s cubic-bezier(0.34,1.56,0.64,1);
margin:16px auto;
display:block;
box-shadow:0 8px 24px rgba(0,0,0,0.4),0 0 0 1px rgba(255,107,107,0.3) inset;
backdrop-filter:blur(10px);
}
.restart-btn:hover{
background:linear-gradient(135deg,#ff7b7b,#ff6060);
transform:translateY(-3px) scale(1.02);
box-shadow:0 12px 32px rgba(255,107,107,0.5),0 0 0 1px rgba(255,107,107,0.5) inset;
}

/* Typing indicator */
.typing-indicator {
display: flex;
align-items: center;
gap: 4px;
}

.typing-indicator span {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--accent);
animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
animation-delay: -0.16s;
}

@keyframes typing {
0%, 80%, 100% {
transform: scale(0.8);
opacity: 0.5;
}
40% {
transform: scale(1);
opacity: 1;
}
}

/* Постоянный баннер внизу (floorAd) */
#yandex_rtb_R-A-17525603-40{
position:fixed;
bottom:0;
left:0;
right:0;
width:100%;
z-index:999;
background:rgba(25,35,55,0.92);
border-top:2px solid rgba(100,150,255,0.3);
box-shadow:0 -4px 16px rgba(0,0,0,0.4);
backdrop-filter:blur(20px);
}

/* Hide native media elements to avoid mobile chrome/safari UI overlays */
audio, video {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
}

/* Меню выбора предмета - модальное окно */
.subject-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(31, 38, 79, 0.35);
    backdrop-filter: blur(14px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    -webkit-context-menu: none !important;
    -moz-context-menu: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.subject-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.subject-menu-window {
    background: linear-gradient(145deg, rgba(25,35,55,0.95) 0%, rgba(30,42,65,0.92) 100%);
    border: 1px solid rgba(126,152,255,0.35);
    border-radius: 28px;
    padding: 48px 44px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 38px 90px rgba(120,140,200,0.25), 0 0 0 1px rgba(126,152,255,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: menuFadeIn 0.3s ease-out;
    -webkit-context-menu: none !important;
    -moz-context-menu: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.menu-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 40px;
    text-align: center;
    text-shadow: 0 8px 16px rgba(74,124,243,0.2);
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    width: 100%;
    padding: 20px 0;
}

.subject-card {
    position: relative;
    background: linear-gradient(145deg, rgba(35,50,75,0.9) 0%, rgba(30,42,65,0.85) 100%);
    border: 2px solid rgba(100,150,255,0.3);
    border-radius: 20px;
    padding: 32px 26px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    min-height: 180px;
    backdrop-filter:blur(10px);
    animation:cardFadeIn 0.6s cubic-bezier(0.34,1.56,0.64,1) backwards;
}

.subject-card:nth-child(1){animation-delay:0.1s;}
.subject-card:nth-child(2){animation-delay:0.2s;}
.subject-card:nth-child(3){animation-delay:0.3s;}

@keyframes cardFadeIn{
0%{opacity:0;transform:translateY(30px) scale(0.9);}
100%{opacity:1;transform:translateY(0) scale(1);}
}

@media (max-width: 768px) {
    .subjects-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 10px 0;
    }
    
    .subject-card {
        flex-direction: row;
        padding: 20px 24px;
        min-height: auto;
        height: 80px;
        gap: 20px;
        justify-content: flex-start;
        align-items: center;
        border-radius: 16px;
    }
    
    .subject-icon {
        font-size: 40px;
        flex-shrink: 0;
    }
    
    .subject-name {
        font-size: 18px;
        text-align: left;
        flex: 1;
    }
}

.subject-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(90,143,255,0.6);
    box-shadow: 0 20px 48px rgba(90,143,255,0.5),0 0 0 1px rgba(90,143,255,0.4) inset;
    background: linear-gradient(145deg, rgba(45,65,95,0.95) 0%, rgba(40,55,85,0.9) 100%);
}

.subject-card:active {
    transform: translateY(-2px);
}

.subject-icon {
    font-size: 60px;
    line-height: 1;
    filter: drop-shadow(0 10px 16px rgba(74,124,243,0.18));
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.subject-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.subject-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

/* Стили для заблокированных предметов */
.subject-card.locked {
    opacity: 0.7;
    cursor: pointer;
}

.subject-card.locked:hover {
    opacity: 0.85;
}

.subject-card.locked .subject-icon > img {
    filter: blur(4px) brightness(0.7);
}

.lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    filter: none !important;
    transition: all 0.5s ease-out;
}

/* Анимация разблокировки предмета */
.lock-icon.unlocking {
    animation: unlockAnimation 0.8s ease-out forwards;
}

@keyframes unlockAnimation {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.2) rotate(-10deg);
        opacity: 1;
    }
    60% {
        transform: translate(-50%, -50%) scale(1.3) rotate(10deg);
        opacity: 0.7;
    }
    100% {
        transform: translate(-50%, -50%) scale(0) rotate(180deg);
        opacity: 0;
    }
}

/* Бейдж "NEW" на карточке предмета */
.new-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 60px;
    height: auto;
    z-index: 10;
    pointer-events: none;
    animation: newBadgePulse 2s ease-in-out infinite;
}

@keyframes newBadgePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* Анимация появления разблокированной карточки */
.subject-card.just-unlocked {
    animation: cardUnlocked 0.6s ease-out 0.5s forwards;
}

@keyframes cardUnlocked {
    0% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 30px rgba(46, 204, 113, 0.6);
        border-color: rgba(46, 204, 113, 0.8);
    }
    100% {
        opacity: 1;
        box-shadow: 0 12px 32px rgba(0,0,0,0.25);
        border-color: rgba(100,150,255,0.3);
    }
}

.lock-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6)) !important;
}

@media (max-width: 768px) {
    .subject-menu-window {
        padding: 32px 20px;
        width: 95%;
        max-height: 85vh;
    }
    
    .menu-title {
        font-size: 24px;
        margin-bottom: 24px;
    }
    
    .subjects-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 8px 0;
    }
    
    .subject-card {
        flex-direction: row;
        padding: 18px 20px;
        min-height: auto;
        height: 72px;
        gap: 18px;
        justify-content: flex-start;
        align-items: center;
        border-radius: 14px;
    }
    
    .subject-icon {
        font-size: 36px;
        flex-shrink: 0;
        line-height: 1;
        width: 48px;
        height: 48px;
    }
    
    .subject-name {
        font-size: 17px;
        text-align: left;
        flex: 1;
        font-weight: 600;
    }
    
    /* Бейдж NEW на планшетах - средний размер */
    .new-badge {
        width: 50px;
        top: 7px;
        right: 7px;
    }
}

@media (max-width: 480px) {
    .subject-menu-window {
        padding: 24px 16px;
        width: 98%;
        max-height: 90vh;
    }
    
    .menu-title {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .subjects-grid {
        gap: 10px;
        padding: 4px 0;
    }
    
    .subject-card {
        padding: 16px 18px;
        height: 68px;
        gap: 16px;
        border-radius: 12px;
    }
    
    .subject-icon {
        font-size: 32px;
        width: 42px;
        height: 42px;
    }
    
    .subject-name {
        font-size: 16px;
    }
    
    /* Бейдж NEW на мобильных - меньше размер */
    .new-badge {
        width: 45px;
        top: 6px;
        right: 6px;
    }
}
