* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: 'PushStart';
  src: url('https://fonts.gstatic.com/s/pressstart2p/v15/e3t4euO8T-267oIAQAu6jDQyK3nVivM.woff2') format('woff2');
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #1a1a1a;
  font-family: 'PushStart', Arial, sans-serif;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.game-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, #1488CC, #2B32B2);
  overflow: hidden;
}

canvas {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  z-index: 2;
  display: none;
}

.score {
  font-size: 16px;
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.progress-container {
  position: relative;
  width: 100%;
  height: 30px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 15px;
  overflow: hidden;
  border: 2px solid #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00ffff, #00ff00);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
  transition: width 0.2s;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 14px;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
  z-index: 1;
}

.menu {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  color: white;
}

.menu h1 {
  font-size: 48px;
  margin-bottom: 30px;
  color: #00ffff;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
  letter-spacing: 4px;
  text-transform: uppercase;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 900px;
}

.level-card {
  background: linear-gradient(135deg, #222 0%, #111 100%);
  padding: 20px;
  border-radius: 15px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.level-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
}

.level-card h2 {
  color: #00ffff;
  margin-bottom: 10px;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.level-card p {
  color: #fff;
  margin-bottom: 15px;
  font-size: 14px;
  text-transform: uppercase;
}

.level-card p.feature {
  color: #00ff00;
  font-size: 12px;
  font-style: italic;
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.level-preview {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 15px;
}

.preview-block {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #00ffff, #0088ff);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.back-button {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #00ffff, #0088ff);
  border: none;
  border-radius: 25px;
  color: #000;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 2px;
  font-size: 14px;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.back-button:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

.skin-selector {
  margin-bottom: 40px;
  text-align: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 20px;
  border-radius: 15px;
  border: 2px solid #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.skin-selector h3 {
  color: #00ffff;
  margin-bottom: 20px;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.skin-options {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.skin-option {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  transition: all 0.2s;
  border: 3px solid transparent;
  font-size: 12px;
  text-transform: uppercase;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.skin-option::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

.skin-option:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
}

.skin-option.active {
  transform: scale(1.1);
  border-color: #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.level-creator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  color: white;
  z-index: 10;
  padding: 40px;
  overflow-y: auto;
}

.level-creator h2 {
  color: #00ffff;
  text-align: center;
  font-size: 36px;
  margin-bottom: 30px;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.creator-form {
  max-width: 600px;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.5);
  padding: 30px;
  border-radius: 15px;
  border: 2px solid #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #00ffff;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid #00ffff;
  color: white;
  border-radius: 8px;
  font-family: 'PushStart', Arial, sans-serif;
  font-size: 14px;
}

.form-group input[type="checkbox"] {
  margin-right: 10px;
  width: 20px;
  height: 20px;
  accent-color: #00ffff;
}

.creator-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

.creator-actions button {
  padding: 12px 24px;
  background: linear-gradient(135deg, #00ffff, #0088ff);
  border: none;
  border-radius: 25px;
  color: #000;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 2px;
  font-size: 14px;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.creator-actions button:hover {
  transform: scale(1.1);
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.5);
}

#cancelLevelCreation {
  background: linear-gradient(135deg, #ff0055, #ff5500);
}