:root {
    --primary-color: #6C63FF;
    --secondary-color: #FF6584;
    --accent-color: #43D9AD;
    --warning-color: #FFB86C;
    --bg-dark: #0F172A;
    --text-light: #F8FAFC;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.15);
    --neon-glow: 0 0 10px rgba(67, 217, 173, 0.5), 0 0 20px rgba(67, 217, 173, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Space Background */
.stars,
.twinkling {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.stars {
    background: #000 url('https://raw.githubusercontent.com/hiteshchoudhary/apirazorpay/master/stars.png') repeat top center;
    z-index: -3;
}

.twinkling {
    background: transparent url('https://raw.githubusercontent.com/hiteshchoudhary/apirazorpay/master/twinkling.png') repeat top center;
    z-index: -2;
    animation: move-twink-back 200s linear infinite;
    opacity: 0.4;
}

.planet {
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle at 30% 30%, #6C63FF, #2A2356);
    border-radius: 50%;
    box-shadow: inset -40px -40px 100px rgba(0, 0, 0, 0.5), 0 0 50px rgba(108, 99, 255, 0.3);
    z-index: -1;
    opacity: 0.6;
    animation: float-planet 20s ease-in-out infinite;
}

@keyframes move-twink-back {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -10000px 5000px;
    }
}

@keyframes float-planet {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-20px, -20px);
    }
}

/* Layout */
.game-container {
    width: 100%;
    max-width: 800px;
    /* Wider for side elements */
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header Stats */
header {
    margin-bottom: 10px;
}

.stats-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 8px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    min-width: 70px;
}

.label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.7;
    margin-bottom: 2px;
}

.value {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(67, 217, 173, 0.3);
}

#high-score {
    color: var(--warning-color);
}

#lives {
    font-size: 1.4rem;
    letter-spacing: 3px;
}

#level {
    color: #fff;
}

/* Screens */
.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.screen.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.95);
}

.screen.active {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

/* Start Screen */
.floating-logo {
    animation: float-logo 4s ease-in-out infinite;
}

@keyframes float-logo {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(67, 217, 173, 0.4));
}

.controls-hint {
    margin-bottom: 30px;
    opacity: 0.7;
    font-size: 1.1rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 18px 45px;
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 25px -5px rgba(108, 99, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 30px -10px rgba(108, 99, 255, 0.6);
}

.btn-primary:hover::after {
    opacity: 1;
}

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

.pulse-anim {
    animation: pulse-btn 2s infinite;
}

@keyframes pulse-btn {
    0% {
        box-shadow: 0 0 0 0 rgba(108, 99, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(108, 99, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(108, 99, 255, 0);
    }
}

/* Game Area Layout */
#game-screen {
    justify-content: space-between;
    padding-bottom: 20px;
    width: 100%;
}

.question-area-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
}

.side-panel {
    width: 150px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.left-panel {
    align-items: flex-end;
    padding-right: 20px;
}

.right-panel {
    align-items: flex-start;
    padding-left: 20px;
}

.question-container {
    flex: 0 0 auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Meteor */
.meteor {
    position: relative;
    animation: float 3s ease-in-out infinite;
    transition: transform 0.1s;
}

.meteor-body {
    width: 160px;
    height: 160px;
    background: radial-gradient(circle at 30% 30%, #FF9A9E, #FECFEF);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow:
        inset -20px -20px 40px rgba(0, 0, 0, 0.2),
        0 0 50px rgba(255, 101, 132, 0.6);
    position: relative;
    z-index: 2;
}

.meteor-body::before {
    content: '';
    position: absolute;
    top: 20%;
    right: 25%;
    width: 25px;
    height: 25px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.2);
}

.meteor-body::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    filter: blur(4px);
}

#question-text {
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
    z-index: 3;
}

/* Mascot */
.mascot-container {
    width: 120px;
    height: 120px;
    transition: transform 0.3s;
}

.mascot-body-group {
    transform-origin: 100px 100px;
    animation: mascot-idle 3s ease-in-out infinite;
}

@keyframes mascot-idle {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-5px) rotate(2deg);
    }
}

.mascot-happy .mascot-body-group {
    animation: mascot-jump 0.5s ease-in-out;
}

@keyframes mascot-jump {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-30px) scale(1.1);
    }
}

.mascot-sad .mascot-body-group {
    animation: mascot-shake 0.5s ease-in-out;
}

@keyframes mascot-shake {

    0%,
    100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

/* Options */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
    margin-top: auto;
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: visible;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

.option-btn:active {
    transform: translateY(2px);
}

.option-btn.correct {
    background: var(--accent-color) !important;
    box-shadow: 0 0 30px var(--accent-color);
    border-color: transparent;
    transform: scale(1.05);
    z-index: 10;
}

.option-btn.wrong {
    background: var(--secondary-color) !important;
    box-shadow: 0 0 30px var(--secondary-color);
    border-color: transparent;
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

/* Floating Combo Text */
.floating-combo {
    position: absolute;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--warning-color);
    text-shadow: 0 0 10px rgba(255, 184, 108, 0.8);
    pointer-events: none;
    z-index: 20;
    animation: float-up-fade 1s forwards;
    white-space: nowrap;
}

@keyframes float-up-fade {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }

    20% {
        transform: translateY(-20px) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translateY(-60px) scale(1);
        opacity: 0;
    }
}

/* Power Up Messages (Left Side) */
.power-up-msg {
    font-size: 1.5rem;
    font-weight: 900;
    color: #FFD700;
    text-shadow: 0 0 20px #FFD700;
    animation: slide-fade-left 2s forwards;
    white-space: nowrap;
    margin-bottom: 10px;
}

@keyframes slide-fade-left {
    0% {
        transform: translateX(-20px);
        opacity: 0;
    }

    20% {
        transform: translateX(0);
        opacity: 1;
    }

    80% {
        transform: translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateX(-20px);
        opacity: 0;
    }
}

/* Level Up Message (Center) */
.level-up-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: 900;
    color: var(--accent-color);
    text-shadow: 0 0 30px var(--accent-color);
    z-index: 50;
    animation: level-up-anim 2s forwards;
    pointer-events: none;
    text-align: center;
    width: 100%;
}

@keyframes level-up-anim {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    20% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }

    80% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Particles */
.particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    animation: fade-out 1s forwards;
}

@keyframes fade-out {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-2px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(4px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-8px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(8px, 0, 0);
    }
}

/* Sound Toggle */
#sound-toggle {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    backdrop-filter: blur(5px);
    transition: all 0.2s;
    z-index: 100;
}

#sound-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.highscore-display {
    margin-top: 10px;
    font-size: 1.2rem;
    color: var(--warning-color);
}

/* Responsive */
@media (max-width: 600px) {
    h1 {
        font-size: 2.5rem;
    }

    .meteor-body {
        width: 120px;
        height: 120px;
    }

    #question-text {
        font-size: 2rem;
    }

    .options-grid {
        gap: 10px;
    }

    .option-btn {
        padding: 15px;
        font-size: 1.5rem;
    }

    .stats-container {
        gap: 5px;
    }

    .glass-panel {
        padding: 5px 10px;
        min-width: 50px;
    }

    .label {
        font-size: 0.5rem;
    }

    .value {
        font-size: 1.1rem;
    }

    /* Adjust layout for mobile */
    .question-area-wrapper {
        flex-direction: column;
    }

    .side-panel {
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: center;
        padding: 0;
        margin: 5px 0;
    }

    .mascot-container {
        width: 80px;
        height: 80px;
    }

    .power-up-msg {
        font-size: 1rem;
    }
}