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

body {
  background: #0a0a1a;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Courier New', monospace;
  color: #fff;
  user-select: none;
}

#app {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* --- Sidebar --- */
#sidebar {
  width: 130px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#title {
  font-size: 22px;
  letter-spacing: 5px;
  text-align: center;
  color: #0ff;
  text-shadow: 0 0 12px #0ff8;
}

.panel {
  background: #12121e;
  border: 1px solid #2a2a44;
  border-radius: 4px;
  padding: 8px 10px;
}

.panel-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: #555;
  margin-bottom: 4px;
}

.panel-value {
  font-size: 20px;
  font-weight: bold;
  color: #eee;
}

#nextCanvas {
  display: block;
  margin-top: 4px;
}

/* --- Controls hint --- */
#controls {
  font-size: 10px;
  color: #444;
  line-height: 1.9;
}

#controls span {
  color: #666;
}

/* --- Game board --- */
#board-wrap {
  border: 2px solid #2a2a44;
  border-radius: 2px;
  line-height: 0;
  box-shadow: 0 0 30px #0003;
}

#gameCanvas {
  display: block;
}

/* --- Mobile layout --- */
@media (max-width: 500px) {
  body {
    align-items: flex-start;
    padding: 12px;
  }

  #app {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  #sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  #sidebar #title {
    width: 100%;
  }

  .panel {
    min-width: 80px;
    text-align: center;
  }

  #controls {
    display: none;
  }
}
