:root {
    --primary-hue: 180; /* Cyan */
    --primary-color: #00f0ff;
    --primary-color-hover: #00c0cc;
    --bg-color: #050a15;
    --glass-bg: rgba(5, 15, 30, 0.85);
    --glass-border: rgba(0, 240, 255, 0.2);
    --text-main: #e0ffff;
    --text-muted: #5b8c99;
    --correct-color: #0f0;
    --incorrect-color: #ff003c;
    --option-bg: rgba(0, 240, 255, 0.05);
    --option-hover: rgba(0, 240, 255, 0.15);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
}

/* Watermark */
.watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 15vw;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.02);
    z-index: -1;
    pointer-events: none;
    user-select: none;
    letter-spacing: 0.1em;
    animation: floatWatermark 20s ease-in-out infinite alternate;
}

@keyframes floatWatermark {
    0% { transform: translate(-50%, -50%) rotate(-30deg) scale(1); opacity: 0.8; }
    50% { transform: translate(-48%, -48%) rotate(-28deg) scale(1.05); opacity: 1; }
    100% { transform: translate(-52%, -52%) rotate(-32deg) scale(0.95); opacity: 0.8; }
}

/* Background Animations */
.background-animations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
    perspective: 1000px;
}

/* Parallax Background */
.parallax-layer {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200vw;
    height: 200vh;
    z-index: -2;
    pointer-events: none;
    will-change: transform;
}

#parallax-bg-1 {
    background: radial-gradient(circle at 30% 40%, rgba(124, 58, 237, 0.15) 0%, transparent 40%);
}

#parallax-bg-2 {
    background: radial-gradient(circle at 70% 60%, rgba(0, 240, 255, 0.15) 0%, transparent 40%);
}

#parallax-bg-3 {
    background: radial-gradient(circle at 50% 80%, rgba(255, 0, 128, 0.1) 0%, transparent 50%);
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -3;
    pointer-events: none;
}

/* Glass Container */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 3rem;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.1);
    position: relative;
    z-index: 1;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: containerPulse 4s infinite alternate ease-in-out;
}

@keyframes containerPulse {
    0% { box-shadow: 0 0 20px rgba(0, 240, 255, 0.05); }
    100% { box-shadow: 0 0 40px rgba(0, 240, 255, 0.2); }
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.screen.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); filter: blur(10px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* Typography */
.title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* Form Elements */
.input-group {
    position: relative;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 400px;
    margin-inline: auto;
}

.input-group input {
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(0,0,0,0.2);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
}

.input-group label {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: all 0.3s ease;
    pointer-events: none;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    background: var(--bg-color);
    padding: 0 0.5rem;
    color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s, box-shadow 0.3s;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    will-change: transform;
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.primary-btn:hover {
    background: var(--primary-color-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
}

.primary-btn:active {
    transform: translateY(1px);
}

.secondary-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: white;
}

.secondary-btn:hover {
    background: rgba(124, 58, 237, 0.1);
}

/* Quiz Screen Specifics */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.quiz-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.quiz-meta {
    text-align: right;
}

#user-display {
    color: var(--primary-color);
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.progress-container {
    width: 150px;
}

#question-tracker {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    display: block;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.question-text {
    font-size: 1.4rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    font-weight: 400;
}

.options-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option {
    background: var(--option-bg);
    border: 1px solid var(--glass-border);
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    opacity: 0;
}

.option:hover {
    background: var(--option-hover);
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.option.selected {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--primary-color);
}

.option.correct {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--correct-color);
    color: #fff;
}

.option.incorrect {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--incorrect-color);
}

.option.disabled {
    pointer-events: none;
}

/* Result Screen Specifics */
#result-screen {
    text-align: center;
}

.score-card {
    margin: 3rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.3);
    background: conic-gradient(var(--primary-color) var(--score-deg, 0%), rgba(255,255,255,0.1) 0%);
    transition: --score-deg 1.5s ease-out;
}

@property --score-deg {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}

.score-circle-inner {
    width: calc(100% - 15px);
    height: calc(100% - 15px);
    background: var(--bg-color);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
}

#final-score {
    font-size: 4rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.score-total {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.score-message {
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* Leaderboard */
.leaderboard-container {
    margin-top: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
}

.leaderboard-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 600;
}

.leaderboard-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.leaderboard-list::-webkit-scrollbar {
    width: 6px;
}
.leaderboard-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

.leaderboard-user {
    font-weight: 600;
}

.leaderboard-score {
    color: var(--primary-color);
    font-weight: 800;
}

/* Global Footer */
.global-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 1rem;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    z-index: 10;
    background: linear-gradient(transparent, rgba(5, 10, 21, 0.9));
}

/* Set Selection Screen Specifics */
#set-selection-screen {
    text-align: center;
}

.set-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 3rem 0;
}

.set-card {
    background: var(--option-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    text-align: left;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-style: preserve-3d;
}

.set-icon {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-right: 1rem;
    opacity: 0.5;
    transform: translateZ(30px);
}

.set-info {
    transform: translateZ(20px);
}

.set-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.set-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.active-set {
    cursor: pointer;
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

.active-set:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(0, 240, 255, 0.3);
}

.active-set .set-icon {
    opacity: 1;
    text-shadow: 0 0 10px var(--primary-color);
}

.locked-set {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.lock-icon {
    margin-left: auto;
    font-size: 1.5rem;
    opacity: 0.5;
}

/* Tooltip */
.tooltip {
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-color);
    border: 1px solid var(--primary-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-main);
    width: 200px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 5;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent transparent;
}

.active-set:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 600px) {
    .glass-container {
        padding: 2rem 1.5rem;
    }
    
    .title {
        font-size: 2.2rem;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .quiz-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .quiz-meta {
        text-align: left;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

/* New Section Headings */
.section-heading {
    text-align: left;
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

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

.modal.hidden {
    display: none !important;
}

.modal-content {
    text-align: center;
    max-width: 500px;
    padding: 2.5rem;
    animation: fadeIn 0.3s ease-out;
}

.modal-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-actions .btn {
    width: auto;
    min-width: 120px;
}

/* Leaderboard Tabs */
.leaderboard-header-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
    justify-content: center;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: auto;
    display: inline-block;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(0, 240, 255, 0.05);
}

.tab-btn.active {
    color: #fff;
    background: rgba(0, 240, 255, 0.15);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* Timer Display inside Quiz Screen */
.timer-container {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid var(--glass-border);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
    float: right;
    clear: both;
    transition: all 0.3s ease;
}

.timer-container.warning {
    color: var(--incorrect-color);
    background: rgba(255, 0, 60, 0.12);
    border-color: rgba(255, 0, 60, 0.3);
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.3);
    animation: pulseRed 1s ease-in-out infinite alternate;
}

@keyframes pulseRed {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}
