* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pixelify Sans', system-ui, sans-serif;
}

.main-menu {
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.98));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    gap: 20px;
}

.game-title {
    font-size: 72px;
    background: linear-gradient(135deg, #a8e6ff, #7cd9ff);
      -webkit-background-clip: text;
      background-clip: text;
    background-clip: text;
    background-clip: text;
    background-clip: text;
    background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(168,230,255,0.4);
    animation: glow 2s ease-in-out infinite alternate, fadeIn 0.5s ease forwards;
    position: relative;
    opacity: 0;
    animation-delay: 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.menu-btn {
    font-family: 'Pixelify Sans', system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    color: white;
    padding: 15px 40px;
    font-size: 24px;
    border-radius: 8px;
    cursor: pointer;
    min-width: 200px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
    animation-delay: 0.6s;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
    transform: translateY(0);
    transition: all 0.2s;
}

.menu-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 rgba(0,0,0,0.2);
}

.instructions {
    font-family: 'Pixelify Sans', system-ui, sans-serif;
    line-height: 2;
    font-weight: normal;
    color: #fff;
    text-align: center;
    max-width: 600px;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.8);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    letter-spacing: 1px;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
    animation-delay: 0.9s;
}

.level-display {
    font-family: 'Pixelify Sans', system-ui, sans-serif;
    position: fixed;
    top: 20px;
    left: 20px;
    font-size: 24px;
    background: rgba(0,0,0,0.8);
    color: white;
    border: 2px solid rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}

.control-btn {
    font-family: 'Pixelify Sans', system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: rgba(0,0,0,0.8);
    border: 2px solid rgba(255,255,255,0.2);
    color: white;
    padding: 15px 25px;
    font-size: 20px;
    border-radius: 8px;
    cursor: pointer;
    min-width: 80px;
    height: 60px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
    transform: translateY(0);
    transition: all 0.2s;
}

.control-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 rgba(0,0,0,0.2);
}

.skip-btn {
    font-family: 'Pixelify Sans', system-ui, sans-serif;
    position: fixed;
    top: 70px;
    left: 20px;
    background: rgba(0,0,0,0.8);
    border: 2px solid rgba(255,255,255,0.2);
    color: white;
    padding: 10px 25px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
    transform: translateY(0);
    transition: all 0.2s;
    display: none;
}

.skip-btn.show {
    display: block;
}

.skip-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 rgba(0,0,0,0.2);
}

.level-intro {
    font-family: 'Pixelify Sans', system-ui, sans-serif;
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translate(-50%, 0);
    background: rgba(0,0,0,0.95);
    color: white;
    padding: 20px 40px;
    border-radius: 8px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 1px;
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    backdrop-filter: blur(5px);
    pointer-events: none;
    max-width: 80%;
    transform-origin: top center;
    animation: slideInTop 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
               glowPulse 2s infinite alternate;
}

.level-intro.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.level-intro:before {
    content: '★';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px;
    color: white;
    text-shadow: 0 0 5px rgba(255,255,255,0.3);
    animation: star-pulse 2s infinite;
}

@keyframes star-pulse {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2); }
    100% { transform: translateX(-50%) scale(1); }
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px rgba(168,230,255,0.3);
    }
    to {
        text-shadow: 0 0 30px rgba(168,230,255,0.6);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInTop {
    from {
        transform: translate(-50%, -40px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes glowPulse {
    from { box-shadow: 0 0 10px rgba(168,230,255,0.15); }
    to { box-shadow: 0 0 15px rgba(168,230,255,0.3); }
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #1A1A1A;
    background-image: 
        radial-gradient(circle at 25px 25px, rgba(255, 255, 255, 0.1) 2%, transparent 0%),
        radial-gradient(circle at 75px 75px, rgba(255, 255, 255, 0.1) 2%, transparent 0%);
    background-size: 100px 100px;
    transition: background 1s;
}

#gameCanvas {
    background: url('assets/1.png');
    background-size: 100px 100px;
    background-repeat: repeat;
    border: 1px solid rgba(255,255,255,0.1); 
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    border-radius: 10px;
    transform: perspective(1000px) rotateX(2deg);
    transform-style: preserve-3d;
}

.portal-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: portalGlow 2s infinite alternate;
    filter: blur(10px);
    z-index: -1;
}

@keyframes portalGlow {
    from {
        box-shadow: 0 0 20px rgba(168,230,255,0.3);
        opacity: 0.5;
    }
    to {
        box-shadow: 0 0 40px rgba(168,230,255,0.6);
        opacity: 0.8;
    }
}

.boss-health {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 24px;
    background: rgba(0,0,0,0.8);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    overflow: hidden;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
}

.boss-health-inner {
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #a8e6ff, #7cd9ff);
    box-shadow: 0 0 10px rgba(168,230,255,0.5);
    transition: width 0.3s ease-out;
}

.controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 1000;
    pointer-events: auto;
    width: fit-content;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .controls {
        bottom: 40px;
        transform: translateX(-50%) scale(0.9);
    }
    
    .control-btn {
        min-width: 70px;
        height: 50px;
        font-size: 18px;
    }
}

.boss-name {
  position: fixed;
  top: 5px; 
  left: 50%;
  transform: translateX(-50%);
  color: #a8e6ff;
  font-family: 'Pixelify Sans', system-ui, sans-serif;
  font-size: 24px;
  text-shadow: 0 0 10px rgba(168,230,255,0.4);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: none;
  z-index: 1000;
}

.boss-defeat-message {
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #a8e6ff;
    padding: 20px 40px;
    border-radius: 8px;
    font-family: 'Pixelify Sans', system-ui, sans-serif;
    font-size: 32px;
    text-align: center;
    border: 2px solid rgba(168, 230, 255, 0.3);
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 2000;
    pointer-events: none;
}

.boss-defeat-message.show {
    opacity: 1;
}

.victory-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.98));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

.victory-screen.show {
  opacity: 1;
  pointer-events: auto;
}

.victory-title {
  font-size: 72px;
  background: linear-gradient(135deg, #ffd700, #ffa500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(255,215,0,0.4);
  margin-bottom: 40px;
  text-transform: uppercase;
}

.victory-btn {
  font-family: 'Pixelify Sans', system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  color: white;
  padding: 15px 40px;
  font-size: 24px;
  border-radius: 8px;
  cursor: pointer;
  min-width: 200px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.2);
  transform: translateY(0);
  transition: all 0.2s;
}

.victory-btn:hover {
  background: rgba(255,255,255,0.2);
}

.victory-btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 rgba(0,0,0,0.2);
}

.control-btn.changing {
  background: rgba(255,255,255,0.2);
}