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

body {
    font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    touch-action: none;
}

/* Screens */
.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Typografie */
h1 {
    font-size: 3em;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

h2 {
    font-size: 1.8em;
    color: #5a67d8;
    margin-bottom: 20px;
}

h3 {
    font-size: 1.4em;
    color: #4a5568;
    margin-bottom: 15px;
    text-align: center;
}

.subtitle {
    font-size: 1.3em;
    color: #f7fafc;
    margin-bottom: 40px;
}

/* Settings Box */
.settings-box {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 500px;
    margin-bottom: 30px;
}

.setting-group {
    margin-bottom: 25px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #4a5568;
}

.setting-group input[type="number"] {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 10px;
}

.setting-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input[type="radio"] {
    margin-right: 8px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 6px 12px rgba(72, 187, 120, 0.4);
}

.btn-small {
    padding: 10px 20px;
    font-size: 0.9em;
}

/* Exercise Screen */
.header {
    background: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.progress-info {
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
}

.exercise-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    flex: 1;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.canvas-wrapper {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    flex: 1;
    min-width: 300px;
    max-width: 450px;
}

/* Template Container */
.template-container {
    width: 400px;
    height: 400px;
    border: 3px dashed #cbd5e0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
}

.template-container img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* Canvas */
#drawCanvas {
    border: 3px solid #667eea;
    border-radius: 10px;
    cursor: crosshair;
    background: white;
    touch-action: none;
    display: block;
}

.canvas-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

/* Feedback Area */
.feedback-area {
    padding: 20px;
    margin: 20px;
    border-radius: 12px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-area.success {
    background: #c6f6d5;
    color: #22543d;
    border: 3px solid #48bb78;
}

.feedback-area.warning {
    background: #fef5e7;
    color: #744210;
    border: 3px solid #f6ad55;
}

.feedback-area.error {
    background: #fed7d7;
    color: #742a2a;
    border: 3px solid #fc8181;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-content h2 {
    margin-bottom: 20px;
}

#resultText {
    font-size: 1.3em;
    margin: 20px 0;
    color: #4a5568;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }
    
    .exercise-container {
        flex-direction: column;
    }
    
    .canvas-wrapper {
        width: 100%;
        max-width: 100%;
    }
    
    .template-container,
    #drawCanvas {
        width: 100%;
        max-width: 350px;
        height: 350px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
