:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  background: #0b0f14;
  color: #e6edf3;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

a {
  color: #7ee787;
}

.demo {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.terminal {
  border: 1px solid #30363d;
  border-radius: 12px;
  overflow: hidden;
  background: #161b22;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  background: #21262d;
  color: #9da7b3;
  border-bottom: 1px solid #30363d;
}

.assist-button {
  border: 1px solid #8b949e;
  border-radius: 6px;
  padding: 0.35rem 0.8rem;
  background: #f6f8fa;
  color: #24292f;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.assist-button:hover:not(:disabled) {
  background: #eaeef2;
}

.assist-button:focus-visible {
  outline: 2px solid #58a6ff;
  outline-offset: 2px;
}

.assist-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

#code-window {
  margin: 0;
  min-height: 34rem;
  max-height: 70vh;
  overflow: auto;
  padding: 1rem;
  white-space: pre;
  line-height: 1.35;
  color: #c9d1d9;
  font-size: clamp(0.68rem, 1.8vw, 0.875rem);
}

.assist-status {
  min-height: 1.5em;
  margin: 0;
  color: #9da7b3;
}

.game-link {
  margin: 2rem 0;
  padding: 1.5rem;
  border: 1px solid #39735b;
  border-radius: 12px;
  background: linear-gradient(135deg, #122820, #161b22 70%);
}

.game-link-label {
  color: #7ee787;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.game-link h2 { margin: 0.35rem 0; }
.game-link p { color: #c9d1d9; }
.game-link a { font-weight: 700; }

@media (max-width: 560px) {
  #code-window {
    min-height: 29rem;
  }
}
