:root {
  --grid-size: 50;
  --pixel-border: 1px solid #222;
}

.canvas-wrapper {
  overflow: hidden;
  touch-action: none;
  position: relative;
}

#grid {
  transform-origin: 0 0;
}

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

body {
  margin: 0;
  background: #111;
  color: #eee;
  font-family: system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  padding: 0.5rem;
  background: #181818;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

button {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 6px;
  background: #333;
  color: #eee;
  cursor: pointer;
}

button.active {
  background: #555;
}

button:active {
  transform: scale(0.97);
}

input[type="color"] {
  width: 2.2rem;
  height: 2.2rem;
  border: none;
  border-radius: 4px;
  padding: 0;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
}

.pixel-grid {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(var(--grid-size), 1fr);
  grid-template-rows: repeat(var(--grid-size), 1fr);
  touch-action: none;
}

.pixel {
  background: #111;
  border: var(--pixel-border);
}

.home-container {
  text-align: center;
  padding: 2rem;
  max-width: 600px;
  margin: auto;
}

.description {
  margin: 1rem 0 2rem;
  font-size: 1.1rem;
  opacity: 0.9;
}

.start-btn {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  background: #ff4444;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 1.1rem;
}

.start-btn:active {
  transform: scale(0.97);
}
