:root {
  --bg-dark: #040806;
  --bg-card: #09120f;
  --bg-subcard: #050a08;
  --border-card: #152720;
  --border-emerald: #10b981;
  --emerald: #10b981;
  --emerald-dark: #064e3b;
  --emerald-light: #34d399;
  --text-white: #ffffff;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --danger: #ef4444;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  box-shadow: none !important;
  text-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.text-emerald {
  color: var(--emerald) !important;
}

.builder-app-container {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Top Header Bar */
.builder-topbar {
  background: #060d0a;
  border: 1px solid #14261f;
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-hex-badge {
  width: 36px;
  height: 36px;
  background: #064e3b;
  border: 1.5px solid #10b981;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.brand-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link-btn {
  background: #091510;
  border: 1px solid #182e25;
  border-radius: 8px;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s ease;
}

.nav-link-btn:hover {
  border-color: var(--emerald);
  color: var(--emerald-light);
}

/* Main Form Cards */
.builder-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.builder-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-num {
  width: 28px;
  height: 28px;
  background: #064e3b;
  border: 1px solid #10b981;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
}

.card-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.builder-input {
  width: 100%;
  background: var(--bg-subcard);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 12px 14px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease;
}

.builder-input:focus {
  border-color: var(--emerald);
}

.builder-input::placeholder {
  color: #475569;
}

.builder-textarea {
  width: 100%;
  background: var(--bg-subcard);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 12px 14px;
  color: #ffffff;
  font-size: 12px;
  font-family: var(--font-mono);
  outline: none;
  resize: vertical;
  line-height: 1.4;
  transition: border-color 0.15s ease;
}

.builder-textarea:focus {
  border-color: var(--emerald);
}

.builder-textarea::placeholder {
  color: #475569;
}

/* Parsed HUD Chips */
.parsed-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.hud-chip {
  background: #07100d;
  border: 1px solid #14221c;
  color: #64748b;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.hud-dot {
  width: 6px;
  height: 6px;
  background: #334155;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.hud-chip.active {
  background: #064e3b;
  border-color: #10b981;
  color: #34d399;
}

.hud-chip.active .hud-dot {
  background: #10b981;
}

/* Build Action Button */
.build-action-row {
  width: 100%;
}

.btn-build-admin {
  width: 100%;
  height: 52px;
  background: #059669;
  border: 1.5px solid #10b981;
  border-radius: 14px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-build-admin:hover {
  background: #10b981;
}

.btn-build-admin:active {
  background: #047857;
}

/* Result Card */
.result-card {
  border-color: #047857;
  background: #081711;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-urls-box {
  background: #040d09;
  border: 1px solid #142e23;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.url-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.url-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-dim);
}

.url-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.url-link {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  word-break: break-all;
}

.url-link:hover {
  text-decoration: underline;
}

.btn-copy {
  background: #064e3b;
  border: 1px solid #10b981;
  border-radius: 6px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-copy:hover {
  background: #059669;
}

.export-box {
  background: #040d09;
  border: 1px solid #142e23;
  border-radius: 12px;
  overflow: hidden;
}

.export-header {
  background: #081611;
  border-bottom: 1px solid #142e23;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  color: var(--emerald);
}

.btn-copy-code {
  background: #064e3b;
  border: 1px solid #10b981;
  border-radius: 6px;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 10px;
  cursor: pointer;
}

.btn-copy-code:hover {
  background: #059669;
}

.code-block {
  padding: 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #34d399;
  line-height: 1.5;
}
