/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  min-height: 100vh;
}

a { color: #7c8cff; text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- Header ---------- */
header { text-align: center; margin-bottom: 1.5rem; }
header h1 { font-size: 1.8rem; color: #fff; }
.subtitle { font-size: .9rem; color: #888; margin-top: .3rem; }

/* ---------- Cards ---------- */
.card {
  background: #1a1a2e;
  border: 1px solid #2a2a44;
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1rem;
}

/* ---------- Token ---------- */
.token-card { max-width: 600px; margin-left: auto; margin-right: auto; }
.token-row { display: flex; gap: .5rem; }
.token-row input {
  flex: 1;
  padding: .5rem .75rem;
  border: 1px solid #333;
  border-radius: 8px;
  background: #111;
  color: #eee;
  font-size: .95rem;
}
.token-row button {
  background: #222;
  border: 1px solid #333;
  border-radius: 8px;
  color: #ccc;
  cursor: pointer;
  padding: 0 .7rem;
  font-size: 1.1rem;
}
.hint { font-size: .78rem; color: #666; margin-top: .3rem; }

/* ---------- Workspace (side-by-side) ---------- */
.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 760px) {
  .workspace { grid-template-columns: 1fr; }
}

/* ---------- Upload zone ---------- */
.upload-zone {
  border: 2px dashed #444;
  border-radius: 10px;
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s;
}
.upload-zone:hover, .upload-zone.dragover { border-color: #7c8cff; }
.file-label { color: #7c8cff; cursor: pointer; text-decoration: underline; }

/* ---------- Canvas ---------- */
.canvas-wrapper { position: relative; }
.canvas-wrapper canvas {
  display: block;
  width: 100%;
  border-radius: 8px;
  cursor: crosshair;
  background: #000;
}
.brush-controls {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-top: .5rem;
  flex-wrap: wrap;
}
.brush-controls label { font-size: .85rem; }
.brush-controls input[type="range"] { width: 100px; }
.brush-controls button {
  background: #222;
  border: 1px solid #333;
  border-radius: 6px;
  color: #ccc;
  padding: .3rem .7rem;
  cursor: pointer;
  font-size: .82rem;
}
.brush-controls button:hover { background: #333; }

/* ---------- Controls ---------- */
.controls-card h2 { margin-bottom: .7rem; }
.controls-card label { display: block; font-size: .85rem; color: #aaa; margin-top: .6rem; }
.controls-card textarea, .controls-card input[type="text"] {
  width: 100%;
  padding: .5rem .7rem;
  border: 1px solid #333;
  border-radius: 8px;
  background: #111;
  color: #eee;
  font-size: .9rem;
  resize: vertical;
  font-family: inherit;
}
.slider-group { margin-top: .7rem; }
.slider-group label { font-size: .85rem; }
.slider-group input[type="range"] { width: 100%; margin-top: .2rem; }

/* ---------- Generate button ---------- */
.primary-btn {
  display: block;
  width: 100%;
  margin-top: 1.2rem;
  padding: .75rem;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  cursor: pointer;
  transition: opacity .2s;
}
.primary-btn:disabled { opacity: .45; cursor: not-allowed; }
.primary-btn:not(:disabled):hover { opacity: .88; }

/* ---------- Status ---------- */
.status {
  margin-top: .7rem;
  padding: .6rem .8rem;
  border-radius: 8px;
  font-size: .85rem;
  text-align: center;
}
.status.loading { background: #1e293b; color: #93c5fd; }
.status.error   { background: #2d1b1b; color: #f87171; }
.status.success { background: #1b2d1b; color: #6ee7b7; }

/* ---------- Output ---------- */
.output-card { text-align: center; }
.output-card img {
  max-width: 100%;
  border-radius: 10px;
  margin-top: .7rem;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
