:root {
  --bg: #0f172a;
  --bg-light: #1e293b;
  --primary: #4ade80;
  --accent: #38bdf8;
  --text: #f1f5f9;
  --font: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 2rem;
  min-height: 100vh;
}

.app-container {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

header {
  text-align: center;
}

header h1 {
  font-size: 2.4rem;
  color: var(--primary);
  margin: 0;
}

main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Editor Section */
.editor-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

textarea#code {
  width: 100%;
  height: 250px;
  background: var(--bg-light);
  color: var(--text);
  border: 1px solid #334155;
  padding: 1rem;
  font-family: monospace;
  font-size: 1rem;
  border-radius: 6px;
  resize: vertical;
}

.controls {
  display: flex;
  gap: 0.75rem;
}

.controls button {
  background: var(--primary);
  color: #000;
  padding: 0.6rem 1.2rem;
  font-weight: 700;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  user-select: none;
  flex: 1;
}

.controls button:hover {
  background: #22c55e;
}

#log {
  background: #1e1e1e;
  color: var(--accent);
  font-family: monospace;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  height: 100px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Canvas Section */
.canvas-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

#output {
  background: #000;
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 0 12px rgba(58, 193, 196, 0.5);
  max-width: 100%;
}

#canvas {
  display: block;
  width: 100%;
  max-width: 900px;
  height: auto;
  border-radius: 6px;
  border: 2px solid #22c55e;
}

/* Examples below canvas */
.examples {
  width: 100%;
  max-width: 900px;
  background: var(--bg-light);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.4);
}

.examples h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.2rem;
  user-select: none;
}

.example-btn {
  display: block;
  width: 100%;
  background: #334155;
  color: #f8fafc;
  padding: 0.6rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
  user-select: none;
}

.example-btn:hover {
  background: var(--accent);
  color: #000;
}

/* Responsive */
@media (max-width: 700px) {
  .app-container {
    max-width: 100%;
    padding: 1rem;
  }
  
  textarea#code {
    height: 180px;
  }

  #canvas {
    max-width: 100%;
  }

  .examples {
    max-width: 100%;
  }
}
