body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Roboto Condensed', sans-serif;
    min-height: 100vh;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    max-width: 500px;
    width: 90%;
}

.glass-input {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.1);
}

.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Default Option Style */
.glass-input option {
    background: #764ba2;
    color: white;
}

.btn-primary {
    background: #ff0080;
    border: none;
    background: linear-gradient(90deg, #ff0080 0%, #ff8c00 100%);
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: scale(1.05);
    background: linear-gradient(90deg, #ff0080 0%, #ff8c00 100%);
    box-shadow: 0 0 15px rgba(255, 140, 0, 0.5);
}

/* Hide Spinners */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.pulse-button {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 140, 0, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 140, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 140, 0, 0);
    }
}

.game-container {
    max-width: 600px;
    width: 95%;
}

.question-box {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.score-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    color: white;
    font-weight: 600;
}

.timer-bar {
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 20px;
}

.timer-fill {
    height: 100%;
    background: #00ff88;
    width: 100%;
    transition: width 1s linear;
}

/* Results Table */
.table-glass {
    color: white;
}

.table-glass th,
.table-glass td {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Mobile adjustments for keyboard */
@media (max-width: 768px) {
    .container.min-vh-100 {
        min-height: auto !important;
        height: 100vh;
        align-items: flex-start !important;
        padding-top: 10vh;
        overflow-y: auto;
    }

    .glass-panel {
        margin-bottom: 50px;
        /* Space for scrolling */
    }
}

/* Theme: Fire */
body.theme-fire {
    background: linear-gradient(135deg, #ff9966 0%, #ff5e62 100%);
}

body.theme-fire .btn-primary {
    background: linear-gradient(90deg, #ff512f 0%, #dd2476 100%);
}

body.theme-fire .btn-primary:hover {
    background: linear-gradient(90deg, #ff512f 0%, #dd2476 100%);
    box-shadow: 0 0 15px rgba(221, 36, 118, 0.5);
}

/* Fire Theme Text Overrides */
body.theme-fire,
body.theme-fire .text-white,
body.theme-fire .h5,
body.theme-fire .h1,
body.theme-fire .h2,
body.theme-fire .h4,
body.theme-fire .display-4,
body.theme-fire label,
body.theme-fire .form-label {
    color: #212529 !important;
}

body.theme-fire .text-white-50 {
    color: rgba(33, 37, 41, 0.7) !important;
}

body.theme-fire .glass-panel {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

body.theme-fire .glass-input {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: #000;
}

body.theme-fire .glass-input::placeholder {
    color: rgba(0, 0, 0, 0.6);
}

body.theme-fire .question-box {
    color: #000;
    text-shadow: none;
}

body.theme-fire .score-badge {
    color: #000;
    background: rgba(0, 0, 0, 0.1);
}

body.theme-fire .table-glass {
    color: #000;
}

body.theme-fire .table-glass th,
body.theme-fire .table-glass td {
    border-color: rgba(0, 0, 0, 0.2);
}

body.theme-fire .timer-bar {
    background: rgba(0, 0, 0, 0.2);
}

/* Theme-specific Option Colors - Fire */
body.theme-fire .glass-input option {
    background: #ff9966;
    color: #000;
}


/* Theme: Dark */
body.theme-dark {
    background: linear-gradient(135deg, #232526 0%, #414345 100%);
}

body.theme-dark .btn-primary {
    background: linear-gradient(90deg, #00b4db 0%, #0083b0 100%);
}

body.theme-dark .btn-primary:hover {
    background: linear-gradient(90deg, #00b4db 0%, #0083b0 100%);
    box-shadow: 0 0 15px rgba(0, 180, 219, 0.5);
}

body.theme-dark .glass-panel {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Theme-specific Option Colors - Dark */
body.theme-dark .glass-input option {
    background: #232526;
    color: #fff;
}


/* Floating Math Background */
.floating-math {
    position: fixed;
    bottom: -100px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: bold;
    pointer-events: none;
    z-index: -1;
    animation: floatUp linear infinite;
    white-space: nowrap;
}

body.theme-fire .floating-math {
    color: rgba(0, 0, 0, 0.15);
}

body.theme-dark .floating-math {
    color: rgba(255, 255, 255, 0.1);
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        bottom: -100px;
    }

    100% {
        transform: translateY(-120vh) rotate(360deg);
        bottom: 100%;
    }
}

/* Floating Labels Customization */
.form-floating>label {
    color: rgba(255, 255, 255, 0.7);
    background-color: transparent !important;
}

.form-floating>.form-control:focus~label,
.form-floating>.form-control:not(:placeholder-shown)~label,
.form-floating>.form-select~label {
    color: rgba(255, 255, 255, 0.9);
    background-color: transparent !important;
}

.form-floating>.form-control:-webkit-autofill {
    background-color: transparent !important;
    -webkit-box-shadow: 0 0 0 50px rgba(255, 255, 255, 0) inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Fire Theme Floating Labels */
body.theme-fire .form-floating>label {
    color: rgba(0, 0, 0, 0.6);
}

body.theme-fire .form-floating>.form-control:focus~label,
body.theme-fire .form-floating>.form-control:not(:placeholder-shown)~label,
body.theme-fire .form-select~label {
    color: rgba(0, 0, 0, 0.8);
}

body.theme-fire .form-floating>.form-control:-webkit-autofill {
    -webkit-text-fill-color: black !important;
}

/* Fix for Select in Floating Label */
.form-floating>.form-select {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

/* Ensure transparency for all floating label states */
.form-floating>.form-control-plaintext~label::after,
.form-floating>.form-control:focus~label::after,
.form-floating>.form-control:not(:placeholder-shown)~label::after,
.form-floating>.form-select~label::after {
    background-color: transparent !important;
}

/* Icon Button Style */
.icon-btn {
    background: rgba(255, 255, 255, 0.2);
    padding: 0 15px;
    height: 34px;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Fire Theme Overrides for icon-btn */
body.theme-fire .icon-btn {
    color: #000;
    background: rgba(0, 0, 0, 0.1);
}

body.theme-fire .icon-btn:hover {
    background: rgba(0, 0, 0, 0.2);
}