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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

.fullscreen-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#videoElement {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

#canvasElement {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1);
    pointer-events: none;
    z-index: 2;
}

.overlay-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.category-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 30px;
    padding: 40px;
    pointer-events: all;
}

.category-title {
    text-align: center;
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 30px;
    font-weight: bold;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.category-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 15px 20px;
    text-align: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    pointer-events: all;
    position: relative;
    opacity: 0.7;
}

.category-card.highlighted {
    opacity: 1;
    transform: scale(1.08);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
    border: 4px solid #FFD700;
}

.category-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    opacity: 1;
}

.category-card-name {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 10px;
}

.category-card-count {
    font-size: 0.9em;
    opacity: 0.9;
}

.learning-screen {
    width: 100%;
    height: 100%;
}

.flashcard-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 40px;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.flashcard-category {
    font-size: 0.9em;
    color: #666;
    text-align: center;
    font-weight: 600;
}

.flashcard-image {
    width: 180px;
    height: 180px;
    object-fit: contain;
}

.flashcard-text {
    font-size: 2em;
    font-weight: bold;
    color: #333;
    text-align: center;
}

.progress {
    font-size: 1em;
    color: #999;
    font-weight: 600;
}

.top-bar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    align-items: center;
    z-index: 4;
}

.status-badge {
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.gesture-indicator {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.3em;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.help-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    pointer-events: all;
    z-index: 5;
}

.help-toggle:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.help-panel {
    position: absolute;
    top: 80px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    max-width: 350px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    display: none;
    pointer-events: all;
    z-index: 5;
}

.help-panel.show {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.help-panel h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.help-panel ul {
    list-style: none;
    padding: 0;
}

.help-panel li {
    padding: 8px 0;
    color: #333;
    font-size: 0.95em;
}

.help-panel strong {
    color: #764ba2;
}

.back-button {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    pointer-events: all;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .flashcard-overlay {
        min-width: 90%;
        max-width: 90%;
        padding: 30px 20px;
    }

    .category-screen {
        width: 95%;
        padding: 30px 20px;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }
}