@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap");
body {
  font-family: "Poppins", Arial, sans-serif;
  text-align: center;
  background: linear-gradient(135deg, #fafafa, #eaeaea);
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#layout {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#game-wrapper {
  position: relative;
  display: inline-block;
}

canvas {
  background: #222;
  display: block;
  margin: 0 auto;
  width: 80vmin;
  height: 80vmin;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: width 0.2s ease, height 0.2s ease;
}

@media (orientation: portrait) {
  canvas {
    width: 85vmin;
    height: 85vmin;
  }
}

@media (orientation: landscape) {
  canvas {
    width: 80vmin;
    height: 80vmin;
  }
}

button {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(180deg,#5c9ded,#3f7ecb);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
button:hover {
  background: linear-gradient(180deg,#6dacff,#498be5);
  transform: translateY(-2px);
}

#player-name {
  margin-top: 10px;
}

#leaderboard {
  list-style: none;
  padding: 0;
  max-width: 200px;
  margin: 10px auto;
  text-align: left;
  max-height: 320px;
  overflow-y: auto;
}
#clear-scores {
  margin-top: 5px;
}
#leaderboard li {
  margin: 2px 0;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.05);
}

h1 {
  margin-top: 20px;
}

#instructions {
  margin-top: 10px;
  font-style: italic;
}

#game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2em;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 20px;
  border-radius: 5px;
  display: none;
}

#paused {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2em;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 20px;
  border-radius: 5px;
  display: none;
}
# options for theme
#options {
  margin: 10px;
}
#options select {
  margin: 0 5px;
}

#sidebar {
  max-width: 250px;
  margin: 0 auto;
}

#controls {
  max-width: 250px;
  margin: 0 auto;
}

#touch-controls {
  display: grid;
  grid-template-columns: repeat(3, 60px);
  grid-template-rows: repeat(3, 60px);
  gap: 5px;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}

#btn-up {
  grid-column: 2;
  grid-row: 1;
}
#btn-left {
  grid-column: 1;
  grid-row: 2;
}
#btn-down {
  grid-column: 2;
  grid-row: 2;
}
#btn-right {
  grid-column: 3;
  grid-row: 2;
}
#btn-pause {
  grid-column: 2;
  grid-row: 3;
}

@media (min-width: 800px) {
  #touch-controls {
    display: none;
  }
}

@media (min-width: 800px) {
  #layout {
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }
  #sidebar {
    text-align: left;
    order: 1;
    margin-right: 20px;
    margin-left: 0;
  }
  #game-wrapper {
    order: 2;
  }
  #controls {
    text-align: left;
    order: 3;
    margin-left: 20px;
  }
  #leaderboard {
    margin-left: 0;
  }
}

body.dark {
  background: linear-gradient(135deg, #000, #222);
  color: #fff;
}
body.dark canvas {
  background: #111;
}
body.dark #leaderboard li {
  background: rgba(255,255,255,0.1);
}
body.neon {
  background: linear-gradient(135deg, #01012a, #000);
  color: #0ff;
}
body.neon canvas {
  background: #000;
}
body.neon #leaderboard li {
  background: rgba(0,255,255,0.1);
}

@media (max-width: 700px) {
  canvas {
    width: 85vmin;
    height: 85vmin;
  }
}

@media (max-width: 400px) {
  canvas {
    width: 90vmin;
    height: 90vmin;
  }
}

.terminal-log {
  background: #000;
  color: #0f0;
  padding: 10px;
  font-family: monospace;
  max-height: 200px;
  overflow: auto;
  text-align: left;
  width: 90%;
  margin: 10px auto 0 auto;
}
