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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2.5em;
    color: #4a5568;
    margin-bottom: 10px;
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.score, .timer, .game-mode {
    background: #4299e1;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1em;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.game-area {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.image-container {
    text-align: center;
}

#gameCanvas {
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    background: #f7fafc;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    margin-top: 15px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    width: 0%;
    transition: width 0.3s ease;
}

.answer-section h3 {
    margin-bottom: 20px;
    color: #2d3748;
    font-size: 1.3em;
}

.options {
    display: grid;
    gap: 12px;
}

.option-btn {
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    text-align: left;
}

.option-btn:hover {
    background: #edf2f7;
    border-color: #4299e1;
    transform: translateY(-2px);
}

.option-btn.correct {
    background: #48bb78;
    color: white;
    border-color: #38a169;
}

.option-btn.incorrect {
    background: #f56565;
    color: white;
    border-color: #e53e3e;
}

.option-btn.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.game-controls {
    text-align: center;
}

.start-btn, .next-btn, .restart-btn, .skip-btn {
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
}

.start-btn, .restart-btn {
    background: #48bb78;
    color: white;
}

.next-btn {
    background: #4299e1;
    color: white;
}

.skip-btn {
    background: #ed8936;
    color: white;
    padding: 10px 20px;
    font-size: 0.9em;
}

.start-btn:hover, .restart-btn:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.next-btn:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

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

.results {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.results h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 2em;
}

.results p {
    font-size: 1.3em;
    margin-bottom: 30px;
    color: #4a5568;
}

footer {
    margin-top: 30px;
    text-align: center;
}

.admin-link, .back-link {
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.admin-link:hover, .back-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Admin Styles */
.login-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    margin: 50px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

#passwordInput {
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1em;
}

#loginBtn {
    padding: 15px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#loginBtn:hover {
    background: #3182ce;
}

.error {
    color: #e53e3e;
    background: #fed7d7;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
}

.admin-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 15px;
}

.tab-btn {
    padding: 12px 25px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.tab-btn.active {
    background: #4299e1;
    color: white;
}

.tab-btn:not(.active):hover {
    background: #edf2f7;
}

.tab-content {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.tab-content.active {
    display: block;
}

.upload-form {
    max-width: 500px;
    margin: 0 auto;
}

.file-input-wrapper {
    margin-bottom: 20px;
    text-align: center;
}

#imageInput {
    display: none;
}

.file-input-label {
    display: inline-block;
    padding: 15px 30px;
    background: #4299e1;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.file-input-label:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

.preview-container {
    text-align: center;
    margin: 20px 0;
}

#previewCanvas {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
}

.options-input {
    margin: 30px 0;
}

.options-input h3 {
    margin-bottom: 15px;
    color: #2d3748;
}

.options-input input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
}

.correct-option {
    border-color: #48bb78 !important;
    background: #f0fff4;
}

.save-btn {
    width: 100%;
    padding: 15px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.images-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.image-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.image-preview {
    width: 100%;
    height: 150px;
    border-radius: 10px;
    object-fit: cover;
    margin-bottom: 15px;
}

.image-options {
    margin-bottom: 15px;
}

.correct-answer {
    font-weight: bold;
    color: #48bb78;
}

.delete-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #c53030;
}

.settings-form {
    max-width: 400px;
    margin: 0 auto;
}

.settings-form label {
    display: block;
    margin-bottom: 20px;
    font-weight: bold;
    color: #2d3748;
}

.settings-form input {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
}

.logout-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 20px;
}

.logout-btn:hover {
    background: #c53030;
}

@media (max-width: 768px) {
    .game-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    #gameCanvas {
        width: 100%;
        height: auto;
    }

    .score-board {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .admin-tabs {
        flex-direction: column;
        gap: 5px;
    }

    h1 {
        font-size: 1.8em;
    }
}