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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.logout-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1.1em;
    backdrop-filter: blur(10px);
}

.stat-label {
    font-weight: bold;
    margin-right: 5px;
}

main {
    padding: 30px;
}

.game-area {
    margin-bottom: 40px;
}

.question-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.change-level-btn {
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: all 0.3s;
}

.change-level-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.level-selector {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 2px solid #667eea;
}

.level-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.level-selector .level-select {
    width: 100%;
    margin-bottom: 10px;
}

.apply-level-btn, .cancel-level-btn {
    padding: 8px 16px;
    margin-right: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.apply-level-btn {
    background: #28a745;
    color: white;
}

.apply-level-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.cancel-level-btn {
    background: #6c757d;
    color: white;
}

.cancel-level-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.difficulty-badge {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.reward-info {
    background: #ffd700;
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.question {
    font-size: 2.5em;
    text-align: center;
    margin: 30px 0;
    color: #333;
    font-weight: bold;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-input-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

#answer-input {
    font-size: 1.5em;
    padding: 15px 20px;
    border: 3px solid #667eea;
    border-radius: 10px;
    width: 200px;
    text-align: center;
    transition: all 0.3s;
}

#answer-input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

#submit-btn {
    font-size: 1.2em;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

#submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#submit-btn:active {
    transform: translateY(0);
}

.feedback {
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.feedback.hidden {
    opacity: 0;
    visibility: hidden;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 15px;
}

.shop-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.shop-section h2 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.shop-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.shop-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.shop-item span:first-child {
    font-size: 2em;
}

.price {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
}

.buy-btn {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    width: 100%;
}

.buy-btn:hover {
    background: #218838;
    transform: scale(1.05);
}

.buy-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.purchased-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    min-height: 60px;
}

.purchased-item {
    font-size: 2em;
    animation: bounceIn 0.5s;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Inloggningsmodal */
.modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    animation: slideIn 0.3s ease;
}

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

.modal-content h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 1.8em;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    color: #666;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-btn:hover {
    color: #667eea;
    background: #f8f9fa;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s;
}

.level-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
    font-size: 0.9em;
}

.level-select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.level-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-form button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.auth-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.auth-form button:active {
    transform: translateY(0);
}

.error-message {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 10px;
    text-align: center;
    min-height: 20px;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .question {
        font-size: 1.8em;
    }
    
    #answer-input {
        width: 100%;
    }
    
    #submit-btn {
        width: 100%;
    }
    
    .stats {
        flex-direction: column;
    }
    
    .modal-content {
        padding: 25px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
    }
}

