@font-face {
  font-family: "ComingSoon";
  src: url("./resource/ComingSoon-Regular.ttf");
}

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

body {
  background: #111 url(./resource/bg2.png);
  background-size: cover;
  background-attachment: fixed;
  color: #ccc;
  font-family: 'Segoe UI', Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 0;
}

.main-layout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  gap: 24px;
  align-items: flex-start;
  justify-content: center;
  max-width: 960px;
  width: 100%;
}

#app {
  background: #1a1a1a;
  padding: 30px 40px;
  border-radius: 12px;
  border: 1px solid #333;
  text-align: center;
  flex-shrink: 0;
}

canvas {
  display: block;
  margin: 0 auto;
  border: 3px solid #000000;
  border-radius: 4px;
  cursor: crosshair;
  background: #fff;
  image-rendering: pixelated;
}

#status {
  margin: 12px 0;
  font-size: 18px;
  min-height: 28px;
  color: #ccc;
}

.btn-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 6px 0;
  flex-wrap: wrap;
}

.btn-row button {
  flex: 1;
  max-width: 80px;
  padding: 6px 12px;
  font-size: 15px;
  border: 1px solid #555;
  border-radius: 4px;
  background: #2a2a2a;
  color: #ccc;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-row button.primary {
  background: #1a5a1a;
  border-color: #2a8a2a;
  color: #0f0;
}

.btn-row button.danger {
  background: #5a1a1a;
  border-color: #8a2a2a;
  color: #f44;
}

#stats {
  margin-top: 12px;
  font-size: 14px;
  color: #888;
  line-height: 1.6;
}

#stats .counts {
  color: #aaa;
  font-family: monospace;
}

#train-label {
  color: #888;
  font-size: 13px;
  margin-top: 10px;
  margin-bottom: 4px;
}

#train-buttons button {
  background: #222;
  border-color: #444;
  color: #ddd;
  font-size: 14px;
}

#inst {
  font-family: "ComingSoon", cursive;
  background: rgba(0, 0, 0, 0.85);
  padding: 24px 32px;
  border-radius: 12px;
  border: 1px solid #333;
  text-align: left;
  max-width: 500px;
  line-height: 1.7;
  color: #eee;
  margin: 30px;
}

#inst h1 {
  font-size: 22px;
  margin-bottom: 14px;
  color: rgb(255, 0, 128);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#inst ol {
  padding-left: 20px;
}

#inst li {
  margin-bottom: 8px;
  font-size: 14px;
}

#inst li strong {
  color: rgb(255, 0, 0);
}

@media (max-width: 750px) {
  .main-layout { flex-direction: column; align-items: center; }
  #app { padding: 20px; max-width: 100%; overflow: hidden; }
  #inst { max-width: 100%; }
  .btn-row button { max-width: 60px; font-size: 13px; padding: 5px 8px; }
  #train-buttons button { max-width: none; flex: 0 0 calc(20% - 5px); font-size: 13px; padding: 8px 0; }
}