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

:root {
  --bg: #0a0a0f;
  --panel: #12121a;
  --border: #222;
  --text: #e8e8e8;
  --muted: #888;
  --accent: #ff6b35;
}

body {
  font-family: 'Instrument Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'JetBrains Mono', monospace; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; top: -100%; left: 1rem; z-index: 100;
  padding: 0.6rem 1.2rem; background: var(--accent); color: var(--bg);
  font-weight: 600; border-radius: 0 0 6px 6px;
}
.skip-link:focus { top: 0; }

.wrap { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }

/* ── Header ── */
.head { margin-bottom: 2.5rem; }
.head h1 {
  font-size: clamp(2.4rem, 9vw, 4rem);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.02;
}
.tagline {
  margin-top: 0.9rem; color: var(--muted);
  font-size: 1.05rem; font-weight: 300; max-width: 38rem;
}

/* ── Controls ── */
.field-label {
  display: block; font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: #666; margin-bottom: 0.5rem;
}
.input-row { display: flex; gap: 0.6rem; }
.input-row input {
  flex: 1; min-width: 0;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.85rem 1rem;
  color: var(--text); font-size: 1rem; font-family: inherit;
}
.input-row input::placeholder { color: #555; }

button {
  font-family: inherit; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel);
  color: var(--text); border-radius: 8px;
  padding: 0.85rem 1.1rem; font-size: 0.95rem; font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
button:hover { border-color: #444; }
button:active { transform: translateY(1px); }

#generate-btn {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
  white-space: nowrap;
}
#generate-btn:hover { background: #ff8055; }
button:disabled { opacity: 0.5; cursor: progress; }

.hint { margin-top: 0.55rem; font-size: 0.82rem; color: #666; }

.lastfm-btn {
  margin-top: 0.9rem; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  background: var(--panel); color: #ccc; font-weight: 600; font-size: 0.9rem;
}
.lastfm-btn:hover { border-color: #d51007; color: #fff; }
.lf-dot {
  width: 0.6rem; height: 0.6rem; border-radius: 50%;
  background: #d51007; flex: none;
}

.status {
  margin-top: 1rem; min-height: 1.2rem; font-size: 0.9rem;
}
.status.error { color: #ff6b6b; }
.status.busy { color: var(--muted); }
.status.ok { color: #4ade80; }

/* ── Style picker ── */
.styles { border: none; margin-top: 1.8rem; }
.style-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.style-btn { padding: 0.55rem 1rem; font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.style-btn.is-active {
  color: var(--bg); background: var(--text); border-color: var(--text);
}

.toggle {
  display: flex; align-items: center; gap: 0.6rem;
  margin-top: 1.4rem; font-size: 0.92rem; color: #ccc; cursor: pointer;
}
.toggle input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); cursor: pointer; }

/* ── Output ── */
.output { margin-top: 2.5rem; }
.placeholder {
  border: 1px dashed var(--border); border-radius: 12px;
  padding: 4rem 1rem; text-align: center; color: #555;
  aspect-ratio: 9 / 16; max-width: 320px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.canvas-shell { display: flex; justify-content: center; }
#card-canvas {
  width: 100%; max-width: 340px; height: auto;
  border-radius: 12px; box-shadow: 0 12px 48px rgba(0,0,0,0.5);
  background: #000;
}

.actions {
  display: flex; gap: 0.6rem; justify-content: center;
  margin-top: 1.5rem; flex-wrap: wrap;
}
.actions .primary {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
}
.actions .primary:hover { background: #ff8055; }

.universal {
  margin-top: 1rem; text-align: center; font-size: 0.8rem;
  color: #666; word-break: break-all;
}
.universal a { font-family: 'JetBrains Mono', monospace; }

/* ── Footer ── */
.foot {
  margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
  font-size: 0.82rem; color: #666;
}

@media (max-width: 520px) {
  .input-row { flex-direction: column; }
  #generate-btn { width: 100%; }
}
