* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  overflow: hidden;
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(180deg, #FFF8E7 0%, #D4EAFF 100%);
  width: 100vw;
  height: 100vh;
  touch-action: none;
}

#scene-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
}

#hud {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 10;
}

#hud > * {
  pointer-events: auto;
}

#top-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 20px;
  gap: 12px;
  position: relative;
}

#title {
  font-family: 'Fredoka One', cursive;
  font-size: 32px;
  color: #E52521;
  text-shadow: 
    3px 3px 0 #fff,
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    0 4px 8px rgba(0,0,0,0.15);
  letter-spacing: 2px;
  transform: rotate(-2deg);
  user-select: none;
}

#help-btn {
  position: absolute;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #E52521;
  background: linear-gradient(180deg, #FFD700, #FFA500);
  color: #1A1A1A;
  font-family: 'Fredoka One', cursive;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  transition: transform 0.15s ease;
}
#help-btn:hover { transform: scale(1.1); }
#help-btn:active { transform: scale(0.95); }

#mode-toggle {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.mode-btn {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 14px;
  padding: 8px 20px;
  border-radius: 25px;
  border: 3px solid #b01c19;
  background: linear-gradient(180deg, #ff4d4a 0%, #E52521 50%, #b01c19 100%);
  color: #FFF5E1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(229,37,33,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: all 0.2s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.mode-btn.active {
  background: linear-gradient(180deg, #FFD700 0%, #FFA500 50%, #e09400 100%);
  border-color: #c07000;
  color: #1A1A1A;
  text-shadow: none;
  box-shadow: 0 4px 12px rgba(255,165,0,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
}
.mode-btn:active { transform: scale(0.95); }

#stats-ribbon {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
  padding: 6px 16px;
}
#stats-ribbon span {
  font-family: 'Fredoka One', cursive;
  font-size: 15px;
  color: #1A1A1A;
  background: rgba(255,245,225,0.85);
  padding: 4px 14px;
  border-radius: 20px;
  border: 2px solid #E52521;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.bottom-controls {
  position: fixed;
  bottom: 40px;
  left: 0; right: 0;
  text-align: center;
}

.action-btn {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 16px;
  padding: 10px 28px;
  border-radius: 25px;
  border: 3px solid #b01c19;
  background: linear-gradient(180deg, #ff4d4a 0%, #E52521 50%, #b01c19 100%);
  color: #FFF5E1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(229,37,33,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: all 0.15s ease;
}
.action-btn:active {
  transform: scale(0.93) translateY(2px);
  box-shadow: 0 1px 4px rgba(229,37,33,0.3);
}

.hint {
  font-size: 12px;
  color: #666;
  margin-top: 10px;
  font-weight: 700;
}

#gamepad {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px;
  padding: 0 20px;
}

#dpad {
  display: flex;
  gap: 4px;
  align-items: center;
}

.dpad-btn {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  border: 3px solid #333;
  background: linear-gradient(180deg, #555 0%, #333 100%);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
}
.dpad-btn:active {
  transform: scale(0.9);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.action-btn-round {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #b01c19;
  background: linear-gradient(180deg, #ff4d4a 0%, #E52521 60%, #a01815 100%);
  color: #FFF5E1;
  font-family: 'Fredoka One', cursive;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(229,37,33,0.4), inset 0 2px 0 rgba(255,255,255,0.3);
  transition: all 0.1s ease;
}
.action-btn-round:active {
  transform: scale(0.88);
  box-shadow: 0 2px 6px rgba(229,37,33,0.3);
}

/* Info Panel */
#info-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,245,225,0.97);
  border-top: 4px solid #E52521;
  border-radius: 20px 20px 0 0;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateY(0);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
}
#info-panel.hidden {
  transform: translateY(100%);
  pointer-events: none;
}

#info-content {
  padding: 20px;
}

.info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.info-header h2 {
  font-family: 'Fredoka One', cursive;
  color: #E52521;
  font-size: 22px;
}

.spec-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.spec-card {
  background: #fff;
  border: 3px solid #E52521;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(229,37,33,0.1);
}
.spec-icon { font-size: 28px; margin-bottom: 4px; }
.spec-label {
  font-weight: 900;
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.spec-value {
  font-family: 'Fredoka One', cursive;
  font-size: 15px;
  color: #1A1A1A;
  margin-top: 2px;
}

/* Easter eggs */
#easter-egg-bubble, #usb-message {
  position: fixed;
  background: #fff;
  border: 3px solid #E52521;
  border-radius: 20px;
  padding: 10px 20px;
  font-family: 'Fredoka One', cursive;
  color: #E52521;
  font-size: 18px;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: opacity 0.3s ease;
  pointer-events: none;
}
#easter-egg-bubble { top: 50%; left: 50%; transform: translate(-50%, -50%); }
#usb-message { top: 60%; left: 50%; transform: translate(-50%, -50%); }
.hidden { opacity: 0; pointer-events: none !important; }

#footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px;
  background: rgba(26,26,26,0.7);
  backdrop-filter: blur(4px);
  z-index: 5;
  font-size: 12px;
  color: #FFF5E1;
}
#footer a {
  color: #FFD700;
  text-decoration: none;
  font-weight: 700;
}
#footer a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  #title { font-size: 24px; }
  .mode-btn { font-size: 12px; padding: 6px 14px; }
  #stats-ribbon span { font-size: 12px; padding: 3px 10px; }
  #gamepad { gap: 40px; }
  .bottom-controls { bottom: 36px; }
}