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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --stage-1: #e74c3c;
    --stage-2: #f39c12;
    --stage-3: #3498db;
    --stage-4: #2ecc71;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.6));
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Lesson Topic Badge */
.lesson-topic-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), #9b59b6);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
    animation: topicPulse 2s ease-in-out infinite;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.lesson-topic-badge .topic-icon {
    font-size: 1.2rem;
    animation: topicIconRotate 3s ease-in-out infinite;
}

.lesson-topic-badge .topic-text {
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.lesson-topic-badge.mobile {
    justify-content: center;
    margin: 0.5rem 0;
}

@keyframes topicPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 6px 25px rgba(155, 89, 182, 0.6);
        transform: scale(1.03);
    }
}

@keyframes topicIconRotate {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-8deg);
    }
    75% {
        transform: rotate(8deg);
    }
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    z-index: 999;
    min-width: 200px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu.active {
    transform: translateX(-1rem);
}

.mobile-link {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s;
}

.mobile-link:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

@media (max-width: 1200px) {
    .lesson-topic-badge .topic-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .lesson-topic-badge {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}

/* Main Content */
.main-content {
    padding: 3rem 0;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.main-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.8));
    }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* Form */
.start-form {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 35px rgba(99, 102, 241, 0.5),
                0 0 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: #e74c3c;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.info-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s;
}

.info-card:hover::before {
    left: 100%;
}

.info-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary-color);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.2);
}

.info-card:hover .card-icon {
    transform: scale(1.2) rotate(10deg);
    transition: transform 0.3s ease;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.info-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.info-card p {
    color: var(--text-secondary);
}

/* Simple students grid - жеке оқушылар */
.students-grid-simple {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

/* Classroom Header */
.classroom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.classroom-header h1 {
    font-size: 2rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Legend */
.legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

/* Groups Container */
.groups-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: start;
}

.group-block {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.group-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    text-align: center;
}

.group-title {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.group-total {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    background: var(--bg-color);
    padding: 0.75rem 1rem;
    border-radius: 2rem;
    border: 2px solid var(--primary-color);
    justify-content: center;
}

.total-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.total-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.total-max {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Students Grid */
.students-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.student-card {
    background: var(--bg-color);
    border-radius: 0.75rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.student-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.3);
    border-color: var(--primary-color);
    background: var(--card-bg);
}

.student-card:hover .student-avatar {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.student-card:active {
    transform: translateX(3px) scale(0.98);
}

.student-card.pulse {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    25% { transform: scale(1.08); }
    50% { transform: scale(0.95); }
    75% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.student-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    flex-shrink: 0;
}

.student-avatar.stage-1 { 
    border-color: var(--stage-1);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5),
                inset 0 0 10px rgba(231, 76, 60, 0.2);
}

.student-avatar.stage-2 { 
    border-color: var(--stage-2);
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.5),
                inset 0 0 10px rgba(243, 156, 18, 0.2);
}

.student-avatar.stage-3 { 
    border-color: var(--stage-3);
    box-shadow: 0 0 25px rgba(52, 152, 219, 0.6),
                inset 0 0 10px rgba(52, 152, 219, 0.2);
}

.student-avatar.stage-4 { 
    border-color: var(--stage-4);
    box-shadow: 0 0 30px rgba(46, 204, 113, 0.8),
                inset 0 0 15px rgba(46, 204, 113, 0.3);
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 30px rgba(46, 204, 113, 0.8),
                    inset 0 0 15px rgba(46, 204, 113, 0.3);
    }
    50% { 
        box-shadow: 0 0 50px rgba(46, 204, 113, 1),
                    inset 0 0 25px rgba(46, 204, 113, 0.5);
    }
}

.student-avatar img {
    width: 80%;
    height: 80%;
    object-fit: cover;
    border-radius: 50%;
    transition: transform 0.5s ease;
}

.student-avatar.stage-transition {
    animation: stageTransition 0.8s ease;
}

@keyframes stageTransition {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(10deg); }
    50% { transform: scale(0.8) rotate(-10deg); }
    75% { transform: scale(1.15) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.student-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.student-name {
    font-size: 1rem;
    margin: 0;
}

.student-points {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
}

.points-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.points-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: all 0.3s;
    border-radius: 3px;
}

.progress-fill.stage-1 { 
    background: linear-gradient(90deg, var(--stage-1), #c0392b);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.progress-fill.stage-2 { 
    background: linear-gradient(90deg, var(--stage-2), #e67e22);
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
}

.progress-fill.stage-3 { 
    background: linear-gradient(90deg, var(--stage-3), #2980b9);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.6);
}

.progress-fill.stage-4 { 
    background: linear-gradient(90deg, var(--stage-4), #27ae60, #2ecc71);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.8);
    animation: progressGlow 1.5s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Settings */
.settings-header {
    text-align: center;
    margin-bottom: 3rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.settings-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.stage-indicator {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stage-indicator.stage-1 { background: var(--stage-1); }
.stage-indicator.stage-2 { background: var(--stage-2); }
.stage-indicator.stage-3 { background: var(--stage-3); }
.stage-indicator.stage-4 { background: var(--stage-4); }

.stage-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.image-preview {
    width: 200px;
    height: 200px;
    margin: 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 1rem;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.settings-info {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.settings-info h3 {
    margin-bottom: 1rem;
}

.settings-info ul {
    list-style-position: inside;
    color: var(--text-secondary);
}

.settings-info li {
    margin-bottom: 0.5rem;
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.tab-link {
    padding: 0.75rem 1.5rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-link:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.tab-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

/* Students Management */
.students-management {
    max-width: 900px;
    margin: 0 auto;
}

.add-student-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    border: 2px solid var(--primary-color);
    margin-bottom: 2rem;
}

.add-student-section h3 {
    margin-bottom: 1rem;
}

.form-inline {
    display: flex;
    gap: 1rem;
}

.form-inline .input-field {
    flex: 1;
}

.students-list-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.students-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.legend-small {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.badge-active {
    background: rgba(46, 204, 113, 0.2);
    color: var(--stage-4);
}

.badge-inactive {
    background: rgba(149, 165, 166, 0.2);
    color: var(--text-secondary);
}

.students-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.student-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 0.75rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.student-list-item:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.student-list-item.inactive {
    opacity: 0.5;
}

.student-drag-handle {
    cursor: grab;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 0 0.5rem;
}

.student-number {
    font-weight: bold;
    color: var(--primary-color);
    min-width: 30px;
    text-align: center;
}

.student-group-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.student-name-display {
    flex: 1;
    font-size: 1.1rem;
}

.name-edit-input {
    margin: 0;
}

.student-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.btn-icon:hover {
    transform: scale(1.1);
}

.btn-icon.btn-active {
    background: rgba(46, 204, 113, 0.2);
    border-color: var(--stage-4);
}

.btn-icon.btn-inactive {
    background: rgba(149, 165, 166, 0.2);
    border-color: var(--text-secondary);
}

.btn-icon.btn-delete:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: var(--stage-1);
}

.info-box {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.info-box h4 {
    margin-bottom: 1rem;
}

.info-box ul {
    list-style-position: inside;
    color: var(--text-secondary);
}

.info-box li {
    margin-bottom: 0.5rem;
}

/* Groups Info Preview */
.groups-info-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    padding: 1.5rem;
    border-radius: 1rem;
    border: 2px solid var(--primary-color);
    margin-bottom: 2rem;
}

.groups-info-box h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.groups-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.group-preview {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.group-preview-title {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.group-preview-names {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Летающие цифры */
.floating-point {
    position: absolute;
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    pointer-events: none;
    z-index: 1000;
    text-shadow: 0 0 10px currentColor,
                 0 0 20px currentColor;
    animation: floatUp 1.5s ease-out forwards;
}

@keyframes floatUp {
    0% {
        transform: translate(0, 0) scale(0.5) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), -150px) scale(1.5) rotate(var(--rotate));
        opacity: 0;
    }
}

/* Конфетти эффект */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    pointer-events: none;
    z-index: 999;
    animation: confettiFall 1s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) rotate(var(--rotate));
        opacity: 0;
    }
}

/* Звездочки для 10 баллов */
.stars {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    animation: starBurst 1s ease-out;
    pointer-events: none;
}

@keyframes starBurst {
    0% {
        transform: translateX(-50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translateX(-50%) scale(1.5);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0;
    }
}

/* Пульсирующий круг при клике */
.click-ripple {
    position: absolute;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    pointer-events: none;
    animation: ripple 0.8s ease-out;
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* Частицы для максимального балла */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    animation: particleExplode 1s ease-out forwards;
}

@keyframes particleExplode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* Mode Selection */
.mode-selection {
    margin-top: 3rem;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.mode-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.mode-card {
    background: var(--card-bg);
    padding: 3rem 2rem;
    border-radius: 1rem;
    border: 2px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s;
}

.mode-card:hover::before {
    left: 100%;
}

.mode-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary-color);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.3);
}

.mode-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.mode-card:hover .mode-icon {
    transform: scale(1.2) rotate(5deg);
}

.mode-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.mode-card p {
    color: var(--text-secondary);
}

.back-link {
    text-align: center;
    margin-top: 2rem;
}

/* Active Session Card */
.active-session-card {
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.session-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.status-icon {
    font-size: 3rem;
}

.status-info h3 {
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.status-info p {
    color: var(--text-secondary);
}

.session-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    position: relative;
    background: var(--bg-color);
    padding: 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Feedback Page */
.feedback-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.qr-section {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.qr-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.qr-card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.qr-code-wrapper {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.qr-code {
    width: 100%;
    max-width: 300px;
    height: auto;
}

.qr-url {
    margin-top: 1rem;
}

.qr-url p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.url-input {
    width: 100%;
    padding: 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.feedbacks-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.feedbacks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.feedback-count {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: bold;
}

.feedbacks-list {
    max-height: 600px;
    overflow-y: auto;
}

.no-feedbacks {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.hint {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.feedback-item {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    animation: slideInFeedback 0.3s ease;
}

@keyframes slideInFeedback {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.feedback-header-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.student-avatar-small {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.feedback-meta {
    flex: 1;
}

.feedback-meta strong {
    display: block;
    margin-bottom: 0.2rem;
}

.feedback-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.rating {
    font-size: 0.9rem;
}

.feedback-message {
    color: var(--text-secondary);
    line-height: 1.6;
}

.feedback-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feedback-section {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 3px solid var(--primary-color);
}

.section-label {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.section-content {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Feedback Form */
.feedback-form-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 2rem 0;
}

.feedback-form-card {
    max-width: 600px;
    width: 100%;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.textarea-field {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.textarea-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

.rating-input {
    display: flex;
    gap: 0.5rem;
    font-size: 2rem;
    margin: 0.5rem 0;
}

.star {
    cursor: pointer;
    transition: all 0.2s;
    filter: grayscale(1);
    opacity: 0.4;
}

.star.hover,
.star.selected {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.2);
}

.btn-large {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.success-message {
    text-align: center;
    padding: 3rem;
}

.success-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

/* Lesson Styles */
.lesson-intro {
    max-width: 1000px;
    margin: 0 auto;
}

.lesson-hero {
    text-align: center;
    margin-bottom: 3rem;
}

.lesson-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.lesson-title {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.lesson-subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.lesson-info-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 3rem;
    margin-bottom: 2rem;
}

.lesson-topic {
    text-align: center;
    margin-bottom: 2rem;
}

.topic-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.topic-title {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lesson-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 2rem 0;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.lesson-objectives-card {
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid var(--primary-color);
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem 0;
}

.lesson-objectives-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.objectives-list {
    list-style: none;
    padding: 0;
}

.objectives-list li {
    padding: 0.75rem 0;
    padding-left: 2rem;
    position: relative;
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 1.05rem;
}

.objectives-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.3rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.lesson-outline {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
}

.outline-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.outline-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 0.75rem;
    border-left: 3px solid var(--primary-color);
}

.outline-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.outline-content h4 {
    margin-bottom: 0.25rem;
}

.outline-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Scene Styles */
.scene-container {
    max-width: 1200px;
    margin: 0 auto;
}

.scene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 0.75rem;
}

.scene-progress {
    font-size: 1.5rem;
    font-weight: bold;
}

.scene-current {
    color: var(--primary-color);
}

.scene-separator {
    color: var(--text-secondary);
    margin: 0 0.5rem;
}

.scene-title-small {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.scene-progress-bar {
    height: 8px;
    background: var(--bg-color);
    border-radius: 4px;
    margin-bottom: 3rem;
    overflow: hidden;
}

.scene-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.scene-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 3rem;
    margin-bottom: 2rem;
    min-height: 500px;
}

.scene-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.scene-main-title {
    font-size: 3rem;
    margin-bottom: 2rem;
    text-align: center;
}

.scene-subtitle {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.scene-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.lead-text {
    font-size: 1.3rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 3rem;
}

.learning-objectives,
.key-concepts,
.scene-notes,
.scene-summary {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--bg-color);
    border-radius: 0.75rem;
}

.learning-objectives h3,
.key-concepts h3,
.scene-notes h4,
.scene-summary h4 {
    margin-bottom: 1rem;
}

.learning-objectives ul,
.scene-notes ul {
    list-style: none;
    padding: 0;
}

.learning-objectives li,
.scene-notes li {
    padding: 0.75rem 0;
    padding-left: 2rem;
    position: relative;
}

.learning-objectives li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.scene-notes li:before {
    content: "•";
    position: absolute;
    left: 0.5rem;
    color: var(--primary-color);
}

.concepts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.concept-card {
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.concept-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.concept-card h4 {
    margin-bottom: 0.25rem;
}

.concept-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.comic-viewer {
    margin: 2rem 0;
    text-align: center;
}

.comic-image {
    max-width: 100%;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.video-player {
    margin: 2rem auto;
    background: var(--bg-color);
    border-radius: 0.75rem;
    overflow: hidden;
    padding: 1rem;
    max-width: 850px;
    text-align: center;
}

.lesson-video {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    display: block;
    margin: 0 auto;
}

.video-placeholder {
    padding: 5rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.video-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.lesson-video {
    width: 100%;
    display: block;
}

.summary-card {
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 0.5rem;
    border-left: 3px solid var(--primary-color);
}

.summary-card ul {
    margin-top: 1rem;
    list-style: none;
    padding: 0;
}

.summary-card li {
    padding: 0.5rem 0;
}

.scene-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-nav {
    min-width: 200px;
}

/* Test Page */
.test-form-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.test-form-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 3rem;
    border: 1px solid var(--border-color);
}

.test-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.test-instruction {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 2rem;
}

.test-question {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.test-question h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.test-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.test-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid var(--border-color);
}

.test-option:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
}

.test-option input[type="radio"] {
    margin-top: 0.25rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.test-option span {
    flex: 1;
    line-height: 1.6;
}

.test-result-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.test-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.result-score {
    display: flex;
    align-items: center;
}

.score-circle {
    display: flex;
    align-items: baseline;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid;
    font-weight: bold;
}

.score-circle.excellent {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.score-circle.good {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.score-circle.average {
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}

.score-circle.poor {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.score-value {
    font-size: 2rem;
}

.score-total {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.result-details {
    margin-top: 1rem;
}

.percentage-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
}

.percentage-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.percentage-fill.excellent {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.percentage-fill.good {
    background: linear-gradient(90deg, #3498db, #2980b9);
}

.percentage-fill.average {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.percentage-fill.poor {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.percentage-text {
    text-align: center;
    margin-top: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.test-score {
    text-align: center;
    margin: 2rem 0;
}

.score-display {
    font-size: 4rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 1rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }
    
    .groups-container {
        grid-template-columns: 1fr;
    }
    
    .students-grid-simple {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .student-card {
        flex-direction: row;
    }
    
    .student-avatar {
        width: 60px;
        height: 60px;
    }
    
    .classroom-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .legend {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .feedback-container {
        grid-template-columns: 1fr;
    }
    
    .qr-section {
        position: relative;
        top: 0;
    }
    
    .group-title {
        font-size: 1.3rem;
    }
    
    .lesson-stats {
        grid-template-columns: 1fr;
    }
    
    .scene-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .scene-content {
        padding: 1.5rem;
    }
    
    .scene-main-title {
        font-size: 2rem;
    }
    
    .concepts-grid {
        grid-template-columns: 1fr;
    }
    
    .scene-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-nav {
        width: 100%;
    }
    
    .lesson-video {
        max-width: 100%;
    }
    
    .video-player {
        padding: 0.5rem;
        max-width: 100%;
    }
    
    .settings-tabs {
        flex-direction: column;
    }
    
    .form-inline {
        flex-direction: column;
    }
    
    .student-list-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .student-name-display {
        flex: 1 1 100%;
        order: 3;
    }
    
    .student-actions {
        order: 4;
        flex: 1 1 100%;
        justify-content: flex-end;
    }
}

