:root {
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --background-color: #f0f9ff;
    --glass-background: rgba(255, 255, 255, 0.25);
    --glass-border: 1px solid rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --gradient-primary: linear-gradient(135deg, #2563eb, #3b82f6);
    --gradient-secondary: linear-gradient(135deg, #60a5fa, #93c5fd);
    --uf-orange: #FA4616;
    --uf-blue: #0021A5;
}

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

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden; 
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, 
        rgba(0, 33, 165, 0.05) 0%, 
        rgba(250, 70, 22, 0.05) 100%
    );
    color: #1a1a1a;
    line-height: 1.6;
    overflow-y: auto;
    min-height: 100vh;
    padding-top: 80px; 
}

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

.container::-webkit-scrollbar {
    display: none;  /* Chrome, Safari and Opera */
}

.game-container {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    background: #000;
    margin: 0;
    padding: 0;
}

.game-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    transform: none; 
    image-rendering: -webkit-optimize-contrast; 
    image-rendering: crisp-edges;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
    perspective: 1000;
    transform-style: preserve-3d;
}

/* Glass morphism components */
.glass-panel {
    background: var(--glass-background);
    backdrop-filter: blur(4px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.glass-button {
    background: var(--glass-background);
    border: var(--glass-border);
    padding: 10px 20px;
    border-radius: 5px;
    color: #1a1a1a;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

.glass-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Game container updates */
.game-container {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #000;
    margin: 0;
}

.game-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    transform: none; 
    image-rendering: -webkit-optimize-contrast; 
    image-rendering: crisp-edges;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
    perspective: 1000;
    transform-style: preserve-3d;
}

.game-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    z-index: 2;
}

.game-loading.hidden {
    display: none;
}

/* File upload improvements */
.upload-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px auto; 
    width: 90%; 
    max-width: 800px; 
    box-sizing: border-box;
}

.upload-box {
    position: relative;
    border: 2px dashed var(--primary-color);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    width: 100%; 
    min-height: 200px; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.upload-box.has-file {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.1);
}

.file-info {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* File upload styling */
.file-upload-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.upload-box {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    border: 2px dashed var(--primary-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-box:hover {
    background: rgba(37, 99, 235, 0.1);
}

.upload-box i {
    font-size: 48px;
    color: var(--primary-color);
}

.file-input {
    display: none;
}

/* Results display */
.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.score-item {
    padding: 15px;
    border-radius: 8px;
    background: var(--glass-background);
    backdrop-filter: blur(4px);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .upload-container {
        grid-template-columns: 1fr;
    }

    .game-container {
        height: 400px;
    }
}

/* Utility classes */
.hidden {
    display: none;
}

.evaluation-section {
    margin: 20px 0;
    width: 100%;
    box-sizing: border-box;
    overflow: visible; 
    text-align: center; 
}

main {
    flex: 1;
    width: 100%;
    max-width: 100%;
}

.evaluation-section button {
    margin: 20px auto; 
    display: block; 
}

.name-input-container {
    width: 90%;
    max-width: 800px;
    margin: 20px auto;
    text-align: center;
}

.name-input-container input {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    margin: 10px auto;
}

.glass-header {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.95), 
        rgba(255, 255, 255, 0.85)
    );
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 15px 30px; 
    margin: 0 0 30px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: space-between; 
    width: 100%;
    padding: 0 20px;
}

.logo-title-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

.uf-logo {
    height: 70px; 
    width: auto;
}

.header-text {
    margin-right: auto; 
}

.header-text h1 {
    color: var(--uf-blue);
    font-size: 1.6em;
    margin: 0;
    white-space: nowrap;
}

.event-link {
    background: linear-gradient(135deg, var(--uf-orange), #ff6b3d);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9em;
    transition: all 0.3s ease;
    white-space: nowrap;
    margin-left: auto; 
    box-shadow: 0 2px 4px rgba(250, 70, 22, 0.2);
}

.event-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(250, 70, 22, 0.3);
    background: linear-gradient(135deg, #ff6b3d, var(--uf-orange));
}

.description {
    display: none;
}

@media (max-width: 1024px) {
    .header-text {
        gap: 20px;
    }
    
    .subtitle {
        font-size: 1em;
    }
}

@media (max-width: 768px) {
    .glass-header {
        padding: 15px;
        margin: 0 10px 20px 10px;
    }

    .logo-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .logo-title-group {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .uf-logo {
        height: 80px;
    }

    .header-text {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .header-text h1 {
        font-size: 1.5em;
        text-align: center;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .description {
        font-size: 1em;
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .header-text h1 {
        font-size: 1.3em;
    }

    .subtitle {
        font-size: 0.9em;
    }
}

.glass-footer {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.9), 
        rgba(255, 255, 255, 0.8)
    );
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    padding: 30px 0;
    margin-top: 60px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body {
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
}

.input-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.input-wrapper input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(37, 99, 235, 0.1);
    border-radius: 12px;
    font-size: 1.1em;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.input-wrapper i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1.2em;
}

.name-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #666;
    margin-top: 10px;
    font-size: 0.9em;
}

.evaluate-button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 30px auto;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.1);
}

.evaluate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(37, 99, 235, 0.2);
}

.evaluate-button:disabled {
    background: linear-gradient(135deg, #94a3b8, #cbd5e1);
    cursor: not-allowed;
    transform: none;
}

.results-container {
    padding: 30px;
    text-align: center;
}

.total-score {
    margin: 30px auto;
    width: 90%;
    max-width: 800px;
}

.progress-container {
    width: 100%;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
    position: relative; 
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 20px;
    transition: width 0.5s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px; 
}

.progress-text {
    color: white;
    font-weight: bold;
    font-size: 1.2em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: absolute; 
    width: 100%;
    text-align: center;
    left: 0;
    z-index: 2;
}

.score-levels {
    display: flex;
    gap: 2px;
    margin: 20px 0;
    background: rgba(0, 0, 0, 0.1);
    padding: 3px;
    border-radius: 15px;
    position: relative;
}

.score-level {
    flex: 1;
    padding: 12px 8px;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.7);
    position: relative;
}

.score-level:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.score-level:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.score-level:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 60%;
    background: rgba(0, 0, 0, 0.1);
}

.score-level.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
    z-index: 1;
}

/* .score-level.active::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: var(--uf-orange);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
} */

/* .score-level:hover {
    background: rgba(255, 255, 255, 0.9);
} */

/* .score-level.active:hover {
    background: var(--gradient-primary);
} */

/* .score-level::after {
    content: attr(data-description);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
} */

/* .score-level:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 10px);
} */

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--gradient-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: white;
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.2);
}

.score-number {
    font-size: 3em;
    font-weight: bold;
}

.score-label {
    font-size: 1em;
    opacity: 0.9;
}

.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.score-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.2));
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    transition: all 0.3s ease;
}

.score-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.15);
}

.score-card h4 {
    color: var(--uf-blue);
    font-size: 1.2em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-card .description {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
    line-height: 1.6;
}

.score-explanation {
    background: linear-gradient(145deg, var(--glass-background), rgba(255, 255, 255, 0.1));
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.current-score {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 10px;
}

.level-description {
    color: #666;
    text-align: center;
    font-size: 1.1em;
}

.logo-container img {
    height: 60px; 
    width: auto;
}

.glass-footer {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.9), 
        rgba(255, 255, 255, 0.8)
    );
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    padding: 30px 0;
    margin-top: 60px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 30px;
    padding: 0 20px;
}

.footer-logo {
    height: 70px; 
    width: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.footer-links a {
    color: var(--uf-blue);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 8px;
}

.footer-links a:hover {
    color: var(--uf-orange);
    background: rgba(250, 70, 22, 0.1);
}

.footer-copyright {
    color: #666;
    font-size: 0.9em;
}

.creativity-rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin: 30px auto;
    padding: 30px;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.4), 
        rgba(255, 255, 255, 0.2)
    );
    border-radius: 25px;
    backdrop-filter: blur(10px);
    max-width: 800px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.level-info {
    flex: 1;
    padding-right: 30px;
    border-right: 2px solid rgba(255, 255, 255, 0.3);
}

.level-name {
    font-size: 1.2em;
    color: var(--uf-blue);
}

.level-name span {
    display: block;
    color: var(--uf-orange);
    font-size: 1.4em;
    font-weight: bold;
    margin-top: 5px;
}

.rating-content {
    display: flex;
    align-items: center;
    gap: 25px;
    padding-left: 30px;
}

.rating-icon {
    font-size: 3.5em;
    background: linear-gradient(135deg, var(--uf-orange), #ff6b3d);
    background-clip: text;          
    -webkit-background-clip: text;  
    color: transparent;             
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(250, 70, 22, 0.3));
}

.rating-text {
    text-align: left;
}

.rating-label {
    font-size: 1em;
    color: #666;
    margin-bottom: 8px;
}

.rating-value {
    font-size: 2em;
    font-weight: bold;
    background: linear-gradient(135deg, var(--uf-blue), #1a4fc8);
    background-clip: text;          
    -webkit-background-clip: text;  
    color: transparent;             
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 33, 165, 0.2);
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .creativity-rating {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }

    .level-info {
        padding-right: 0;
        border-right: none;
        border-bottom: 2px solid rgba(255, 255, 255, 0.3);
        padding-bottom: 20px;
        text-align: center;
    }

    .rating-content {
        padding-left: 0;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .rating-text {
        text-align: center;
    }

    .rating-icon {
        font-size: 3em;
    }

    .rating-value {
        font-size: 1.8em;
    }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    margin: auto;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.95), 
        rgba(255, 255, 255, 0.85)
    );
    border-radius: 20px;
    padding: 0;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--uf-blue);
    margin: 0;
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
}

.close-button:hover {
    color: var(--uf-orange);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.lab-section {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.5), 
        rgba(255, 255, 255, 0.3)
    );
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lab-section h3 {
    color: var(--uf-blue);
    margin-bottom: 15px;
}

.lab-section p {
    color: #444;
    line-height: 1.6;
    margin-bottom: 15px;
}

.director {
    display: flex;
    align-items: center; 
    gap: 10px;
    color: var(--uf-orange);
    font-weight: 500;
    margin-top: 15px;
}

.director i {
    font-size: 24px;
    display: flex; 
    align-items: center;
}

.director p {
    margin: 0; 
    line-height: 24px;
}

body {
    padding-top: 0; 
}

.container {
    padding-top: 10px; 
}

.footer-logo {
    height: 40px; 
    width: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 30px;
    padding: 0 20px;
}

.external-game-link {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    padding: 8px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.external-game-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.external-game-link i {
    font-size: 20px;
}

.external-game-link:hover::after {
    content: "Open in new tab";
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 10px;
    white-space: nowrap;
}

.reload-button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.reload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

.game-loading {
    /* Existing styles... */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.loading-hint {
    color: #666;
    font-size: 0.9em;
    text-align: center;
    margin: 10px 0 20px;
    font-style: italic;
}
