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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #2c2c2c;
  color: #d4d0c8;
  min-height: 100vh;
  padding: 1.5rem;
}

.back {
  display: inline-block;
  color: #888;
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}
.back:hover { color: #d4d0c8; }

.container {
  max-width: 680px;
  margin: 0 auto;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #e8e4dc;
  margin-bottom: 1.25rem;
}

.demo {
  background: #333;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e8e4dc;
  margin-bottom: 0.3rem;
}

.hint {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.75rem;
}

input[type="text"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: #2c2c2c;
  border: 1px solid #444;
  border-radius: 6px;
  color: #e8e4dc;
  font-size: 0.92rem;
  outline: none;
  margin-bottom: 0.5rem;
}
input[type="text"]:focus { border-color: #666; }

.echo {
  min-height: 1.4rem;
  font-family: monospace;
  font-size: 0.95rem;
  color: #79ff5d;
}

canvas {
  display: block;
  max-width: 100%;
  background: #2c2c2c;
  border-radius: 6px;
  border: 1px solid #3a3a3a;
}

#myCanvas  { cursor: default; }
#myCanvas1 { cursor: crosshair; margin-bottom: 0.75rem; }

.clear-btn {
  padding: 0.35rem 0.9rem;
  background: transparent;
  color: #888;
  border: 1px solid #444;
  border-radius: 5px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.clear-btn:hover { color: #e87070; border-color: #e87070; }
