:root {
  --bg: #0d0f14;
  --panel: #151822;
  --panel-2: #1b1f2c;
  --border: #262b3a;
  --text: #e9ebf2;
  --muted: #9aa1b5;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --blue: #3b82f6;
  --success: #22c55e;
  --error: #ef4444;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at top, #171a24, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(21, 24, 34, 0.7);
  backdrop-filter: blur(6px);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 18px;
}

.brand span { color: var(--accent); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

.user-chip img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.user-chip a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 8px;
}

.user-chip a:hover { color: var(--text); }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

h1 { font-size: 28px; margin-bottom: 4px; }
.subtitle { color: var(--muted); margin-bottom: 40px; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
  display: block;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card h2 { margin: 0 0 8px; font-size: 20px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.locked-card {
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 28px;
  color: var(--muted);
}

.locked-card h2 { font-size: 20px; margin: 0 0 8px; color: var(--muted); }

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.back-link:hover { color: var(--text); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 18px 0 6px;
}

label:first-child { margin-top: 0; }

input[type="text"],
input[type="url"],
textarea,
input[type="color"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

textarea { resize: vertical; min-height: 90px; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(88, 101, 242, 0.08);
}

.dropzone input { display: none; }

.preview-thumb {
  margin-top: 14px;
  max-width: 100%;
  max-height: 260px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: none;
}

.or-divider {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 18px 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

button.primary {
  margin-top: 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

button.primary:hover { background: var(--accent-hover); }

.msg {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 20px;
}

.msg.success { background: rgba(34, 197, 94, 0.12); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.35); }
.msg.error { background: rgba(239, 68, 68, 0.12); color: var(--error); border: 1px solid rgba(239, 68, 68, 0.35); }

.builder-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

@media (max-width: 800px) {
  .builder-layout { grid-template-columns: 1fr; }
}

.discord-preview {
  background: #313338;
  border-radius: 10px;
  padding: 16px;
  font-family: 'gg sans', -apple-system, sans-serif;
}

.discord-embed {
  border-left: 4px solid var(--accent);
  background: #2b2d31;
  border-radius: 4px;
  padding: 12px 14px;
  max-width: 420px;
  color: #dbdee1;
}

.discord-embed .e-title { font-weight: 700; color: #fff; margin-bottom: 6px; font-size: 15px; }
.discord-embed .e-desc { font-size: 13px; line-height: 1.4; white-space: pre-wrap; }
.discord-embed .e-footer { font-size: 11px; color: #949ba4; margin-top: 10px; }
.discord-embed img.e-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; float: right; margin-left: 10px; }
.discord-embed img.e-image { width: 100%; border-radius: 4px; margin-top: 10px; display: block; }
.discord-mention { color: #f5c400; font-size: 13px; margin-bottom: 8px; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  text-align: center;
  padding: 20px;
}

.login-wrap h1 { margin: 0; }
.login-wrap p { color: var(--muted); max-width: 360px; }

.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}

.discord-btn:hover { background: var(--accent-hover); }
