* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #0f172a;
  color: white;
  overflow: hidden;
  font-family: 'Poppins', sans-serif;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* ═══════════════════════════════════════════════════════════
   BEAUTIFUL START SCREEN
   ═══════════════════════════════════════════════════════════ */

#startScreen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  z-index: 100;
  overflow: hidden;
}

/* Animated gradient orbs */
.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.6;
  animation: float-slow 20s infinite ease-in-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent);
  top: -15%;
  left: -10%;
  animation-duration: 25s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 233, 253, 0.7), transparent);
  bottom: -15%;
  right: -10%;
  animation-duration: 30s;
  animation-delay: 5s;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(251, 207, 232, 0.6), transparent);
  top: 50%;
  left: 50%;
  animation-duration: 28s;
  animation-delay: 3s;
}

@keyframes float-slow {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(80px, -100px);
  }
}

/* Floating letters background */
.float-letters {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  pointer-events: none;
  overflow: hidden;
}

.float-letters span {
  font-family: 'Pacifico', cursive;
  font-size: 150px;
  color: rgba(255, 255, 255, 0.08);
  animation: letter-float 8s infinite ease-in-out;
}

.float-letters span:nth-child(1) { animation-delay: 0s; }
.float-letters span:nth-child(2) { animation-delay: 0.5s; }
.float-letters span:nth-child(3) { animation-delay: 1s; }
.float-letters span:nth-child(4) { animation-delay: 1.5s; }
.float-letters span:nth-child(5) { animation-delay: 2s; }

@keyframes letter-float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.08;
  }
  50% {
    transform: translateY(-50px) rotate(5deg);
    opacity: 0.15;
  }
}

/* Main content */
.start-content {
  position: relative;
  z-index: 10;
  text-align: center;
  animation: fade-in-up 1.5s ease-out;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.main-title {
  font-family: 'Pacifico', cursive;
  font-size: 80px;
  font-weight: 400;
  margin: 0 0 10px 0;
  background: linear-gradient(135deg, #fff 0%, #e0f2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 10px 25px rgba(255, 255, 255, 0.3));
  animation: title-pulse 3s ease-in-out infinite;
  letter-spacing: 3px;
}

@keyframes title-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

.game-text {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 20px 0;
}

.divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  margin: 0 auto 20px auto;
}

.creator {
  font-size: 14px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 40px 0;
}

.creator-name {
  font-weight: 600;
  color: #ffd700;
  text-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

/* Play button */
.play-btn {
  position: relative;
  padding: 18px 55px;
  font-size: 17px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  cursor: pointer;
  pointer-events: auto;
  overflow: hidden;
  transition: all 0.4s ease;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.play-btn span {
  position: relative;
  z-index: 2;
}

.btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.6s ease;
}

.play-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.7);
}

.play-btn:hover .btn-shine {
  left: 100%;
}

.play-btn:active {
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
  .main-title {
    font-size: 50px;
  }
  
  .float-letters span {
    font-size: 100px;
  }
  
  .gradient-orb {
    filter: blur(80px);
  }
}

.hidden {
  display: none;
}

/* ═══════════════════════════════════════════════════════════
   GAME UI PANEL
   ═══════════════════════════════════════════════════════════ */

#uiContainer {
  position: fixed;
  top: 20px;
  left: 0;
  display: flex;
  z-index: 4000;
  pointer-events: none;
}

#toggleUI {
  width: 26px;
  height: 60px;
  border-radius: 0 6px 6px 0;
  border: none;
  background: rgba(255, 255, 255, 0.25);
  color: white;
  font-weight: bold;
  cursor: pointer;
  pointer-events: auto;
}

#ui {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  padding: 12px;
  border-radius: 0 10px 10px 0;
  width: 340px;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.ui-hidden #ui {
  transform: translateX(-110%);
}

#ui textarea,
#ui button,
#ui input,
#ui label {
  pointer-events: auto;
}

textarea {
  width: 100%;
  height: 90px;
  padding: 10px;
  font-size: 16px;
  border-radius: 6px;
  border: none;
  resize: none;
  outline: none;
  background: rgba(255, 255, 255, 0.95);
  color: #000;
  touch-action: auto;
}

label {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  cursor: pointer;
}

button {
  margin-top: 8px;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: #38bdf8;
  color: #000;
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  background: #0ea5e9;
}

canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  touch-action: none;
  z-index: 3000;
}