:root {
  --bg: #0c1b12;
  --panel: rgba(15, 27, 18, 0.9);
  --panel-border: rgba(255, 255, 255, 0.06);
  --accent: #facc15;
  --accent-2: #34d399;
  --muted: #b4c7b3;
  --text: #e6f2e4;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(52, 211, 153, 0.12), transparent 24%),
    radial-gradient(circle at 82% 12%, rgba(250, 204, 21, 0.12), transparent 22%),
    linear-gradient(160deg, #07150d 0%, #0f2317 50%, #0c1b12 100%);
  color: var(--text);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 12px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(8px);
  background: rgba(7, 18, 12, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.topbar-inner {
  width: min(1100px, calc(100% - 36px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand .seed {
  width: 12px;
  height: 12px;
  background: radial-gradient(circle at 30% 30%, #fff7cc, #facc15);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.45);
}

.nav-links {
  display: flex;
  gap: 14px;
  font-weight: 600;
}

.nav-links a {
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-links a:hover {
  background: rgba(52, 211, 153, 0.1);
  color: #d9f99d;
}

.page {
  width: min(1100px, calc(100% - 36px));
  margin: 28px auto 64px;
  position: relative;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
  margin-bottom: 12px;
}

.intro {
  padding: 12px 0 6px;
}

.eyebrow {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: rgba(52, 211, 153, 0.12);
  color: #bbf7d0;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 0.78rem;
}

.hero h1 {
  margin: 14px 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: 0.5px;
}

.hero p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: #fde68a;
  font-weight: 700;
}

.chip.green {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.35);
  color: #bbf7d0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
  padding: 22px;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.panel::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.15), transparent 60%);
  top: -40px;
  right: -20px;
  filter: blur(2px);
}

.upload-box {
  border: 1px dashed rgba(180, 199, 179, 0.4);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.preview {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  min-height: 320px;
}

canvas#canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}

.status-row .status {
  margin-top: 0;
}

.btn {
  cursor: pointer;
  border: none;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn.primary {
  background: linear-gradient(135deg, #facc15, #fbbf24);
  color: #5a4100;
  box-shadow: 0 12px 30px rgba(250, 204, 21, 0.25);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn:active {
  transform: translateY(1px);
}

.status {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  min-height: 1.2em;
}

.warning {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 12px;
  color: #fde68a;
  font-weight: 700;
  font-size: 0.95rem;
}

.warning::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 8px;
  background: rgba(250, 204, 21, 0.2);
  border: 1px solid rgba(250, 204, 21, 0.4);
}

.loader {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.status.error {
  color: var(--danger);
  font-weight: 700;
}

.result {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: rgba(250, 204, 21, 0.12);
  color: #fde68a;
  border: 1px solid rgba(250, 204, 21, 0.35);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  width: fit-content;
}

.table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
}

.table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 700;
}

.table tr + tr td {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.meta {
  margin: 6px 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.note {
  font-size: 0.9rem;
  color: var(--muted);
}

.hero-visual {
  position: relative;
  min-height: 180px;
  padding-top: 14px;
}

.hero-visual .leaf {
  position: absolute;
  width: 120px;
  height: 28px;
  background: linear-gradient(120deg, rgba(52, 211, 153, 0.25), rgba(52, 211, 153, 0.08));
  border-radius: 999px;
  filter: blur(0.2px);
  animation: sway 6s ease-in-out infinite alternate;
}

.hero-visual .leaf:nth-child(1) {
  top: 12px;
  right: 26px;
  transform: rotate(16deg);
}

.hero-visual .leaf:nth-child(2) {
  top: 48px;
  left: 18px;
  transform: rotate(-18deg);
  animation-delay: 0.8s;
}

.hero-visual .leaf:nth-child(3) {
  bottom: 4px;
  left: 70px;
  transform: rotate(10deg);
  animation-delay: 1.2s;
}

.hero-visual .note {
  margin-top: 44px;
  display: block;
}

.panel-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 8px 12px;
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #c9f7d5;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d9f99d;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 10px;
}

.back-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes sway {
  0% {
    transform: translateY(0) rotate(4deg);
  }
  100% {
    transform: translateY(-6px) rotate(-6deg);
  }
}

@media (max-width: 768px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .nav-links {
    width: 100%;
    justify-content: space-between;
  }
  .panel {
    padding: 18px;
  }
  .upload-box {
    grid-template-columns: 1fr;
  }
}
