/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 50%, #0a0a1a 100%);
    min-height: 100vh;
    overflow: hidden;
    color: #fff;
}

/* Animated Stars Background */
.stars,
.stars2,
.stars3 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.stars {
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="white"/></svg>') repeat;
    background-size: 50px 50px;
    animation: animateStars 50s linear infinite;
}

.stars2 {
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="75" r="0.8" fill="%23aaddff"/></svg>') repeat;
    background-size: 100px 100px;
    animation: animateStars 100s linear infinite;
}

.stars3 {
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="75" cy="25" r="1.5" fill="%23ffaadd"/></svg>') repeat;
    background-size: 150px 150px;
    animation: animateStars 150s linear infinite;
}

@keyframes animateStars {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-1000px);
    }
}

/* Screen Layout */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Login Container */
.login-container {
    text-align: center;
    padding: 50px 60px;
    background: rgba(10, 10, 30, 0.85);
    border-radius: 30px;
    border: 2px solid rgba(100, 200, 255, 0.3);
    box-shadow:
        0 0 60px rgba(100, 200, 255, 0.2),
        inset 0 0 60px rgba(100, 200, 255, 0.05);
    backdrop-filter: blur(20px);
    animation: floatIn 1s ease-out;
    max-width: 500px;
    width: 90%;
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.logo-container {
    position: relative;
    margin-bottom: 35px;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(100, 200, 255, 0.4) 0%, transparent 70%);
    filter: blur(30px);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
    }
}

.portal-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #00d4ff 0%, #7b2fbb 50%, #ff006e 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 30px rgba(100, 200, 255, 0.5));
    position: relative;
    letter-spacing: 5px;
}

.subtitle {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 10px;
    margin-top: 8px;
}

.code-section {
    margin: 30px 0;
}

.instruction {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 18px;
    letter-spacing: 1px;
}

.input-wrapper {
    position: relative;
    display: inline-block;
}

.input-wrapper input {
    width: 100%;
    max-width: 320px;
    padding: 16px 25px;
    font-size: 1.2rem;
    font-family: 'Orbitron', sans-serif;
    text-align: center;
    background: rgba(20, 20, 50, 0.8);
    border: 2px solid rgba(100, 200, 255, 0.4);
    border-radius: 15px;
    color: #fff;
    letter-spacing: 4px;
    outline: none;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    border-color: #00d4ff;
    box-shadow:
        0 0 30px rgba(0, 212, 255, 0.4),
        inset 0 0 20px rgba(0, 212, 255, 0.1);
}

.input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 3px;
}

.input-wrapper input.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.error-message {
    font-size: 0.95rem;
    margin-top: 15px;
    height: 22px;
    transition: all 0.3s ease;
}

/* Access Button */
.access-button {
    position: relative;
    padding: 18px 60px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: #fff;
    background: linear-gradient(135deg, #7b2fbb 0%, #00d4ff 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.access-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.access-button:hover::before {
    left: 100%;
}

.access-button:hover {
    transform: scale(1.05);
    box-shadow:
        0 0 40px rgba(123, 47, 187, 0.6),
        0 0 80px rgba(0, 212, 255, 0.4);
}

.access-button:active {
    transform: scale(0.98);
}

.button-text {
    position: relative;
    z-index: 2;
}

.button-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.5s ease;
}

.access-button:hover .button-glow {
    width: 300px;
    height: 300px;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.divider span {
    padding: 0 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

/* Game Button */
.game-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    padding: 15px 30px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #fff;
    background: linear-gradient(135deg, #ff006e 0%, #ffc800 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-button:hover {
    transform: scale(1.05);
    box-shadow:
        0 0 30px rgba(255, 0, 110, 0.5),
        0 0 60px rgba(255, 200, 0, 0.3);
}

.game-button:active {
    transform: scale(0.98);
}

.button-icon {
    font-size: 1.4rem;
}

.game-hint {
    margin-top: 15px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

/* Back Button */
.back-button {
    padding: 10px 20px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Menu Button */
.menu-button {
    padding: 15px 50px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.8);
    background: transparent;
    border: 2px solid rgba(100, 200, 255, 0.4);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.menu-button:hover {
    background: rgba(100, 200, 255, 0.1);
    border-color: #00d4ff;
    color: #fff;
}

/* Game Screen */
#gameScreen {
    flex-direction: column;
    background: transparent;
}

.game-header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    max-width: 800px;
    padding: 15px 30px;
    background: rgba(10, 10, 30, 0.9);
    border-radius: 20px;
    border: 1px solid rgba(100, 200, 255, 0.3);
    margin-bottom: 15px;
    z-index: 100;
}

.score-display,
.lives-display,
.level-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 3px;
}

.value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #00d4ff;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

#gameCanvas {
    border: 3px solid rgba(100, 200, 255, 0.4);
    border-radius: 10px;
    box-shadow:
        0 0 40px rgba(100, 200, 255, 0.2),
        inset 0 0 100px rgba(10, 10, 30, 0.5);
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3e 100%);
}

.game-controls {
    margin-top: 15px;
    padding: 10px 30px;
    background: rgba(10, 10, 30, 0.7);
    border-radius: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
}

/* Game Over Screen */
.gameover-container {
    text-align: center;
    padding: 60px;
    background: rgba(10, 10, 30, 0.95);
    border-radius: 30px;
    border: 2px solid rgba(255, 0, 110, 0.5);
    box-shadow: 0 0 60px rgba(255, 0, 110, 0.3);
    animation: floatIn 0.5s ease-out;
}

.gameover-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    color: #ff006e;
    text-shadow: 0 0 30px rgba(255, 0, 110, 0.5);
    margin-bottom: 30px;
    letter-spacing: 5px;
}

.final-score,
.final-level {
    margin: 20px 0;
}

.final-score p,
.final-level p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
}

.final-score span,
.final-level span {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: #00d4ff;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

/* Pause Screen */
.pause-container {
    text-align: center;
    padding: 60px;
    background: rgba(10, 10, 30, 0.95);
    border-radius: 30px;
    border: 2px solid rgba(255, 200, 0, 0.5);
    box-shadow: 0 0 60px rgba(255, 200, 0, 0.3);
}

.pause-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    color: #ffc800;
    text-shadow: 0 0 30px rgba(255, 200, 0, 0.5);
    margin-bottom: 20px;
    letter-spacing: 5px;
}

.pause-container p {
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .login-container {
        padding: 35px 25px;
        margin: 20px;
    }

    .portal-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.9rem;
        letter-spacing: 6px;
    }

    .input-wrapper input {
        padding: 14px 18px;
        font-size: 1rem;
    }

    .access-button {
        padding: 15px 40px;
        font-size: 1rem;
    }

    .game-header {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .value {
        font-size: 1.3rem;
    }

    .back-button {
        order: -1;
        width: 100%;
        margin-bottom: 10px;
    }
}