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

body {
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

h1 {
  color: #00ff88;
  font-size: 2.5rem;
  margin-bottom: 15px;
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.score-board {
  display: flex;
  justify-content: space-between;
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 15px;
  padding: 0 10px;
}

.score-board span {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 10px;
}

#score, #highscore {
  color: #00ff88;
  font-weight: bold;
  font-size: 1.3rem;
}

#gameCanvas {
  border: 2px solid #00ff88;
  border-radius: 10px;
  background: #1a1a2e;
  display: block;
  margin: 0 auto;
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.1);
}

.controls {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

#restartBtn {
  background: #00ff88;
  color: #1a1a2e;
  border: none;
  padding: 10px 30px;
  font-size: 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

#restartBtn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.mobile-controls {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.mobile-controls div {
  display: flex;
  gap: 5px;
}

.dir-btn {
  width: 60px;
  height: 60px;
  font-size: 1.5rem;
  border: 2px solid #00ff88;
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.dir-btn:active {
  background: #00ff88;
  color: #1a1a2e;
}

.info {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  margin-top: 15px;
}

@media (max-width: 500px) {
  .container {
    padding: 15px;
  }
  h1 {
    font-size: 1.8rem;
  }
  #gameCanvas {
    width: 300px;
    height: 300px;
  }
  .mobile-controls {
    display: flex;
  }
}