:root {
  --bg: #f0fdf4;
  --card: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #16a34a;
  --accent-dark: #15803d;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

.site-header {
  background: linear-gradient(135deg, #15803d, #16a34a 55%, #22c55e);
  color: #fff;
  padding: 28px 0 22px;
}
.brand {
  color: #fff;
  text-decoration: none;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.brand .dot { color: #fde68a; }
.tagline { margin: 4px 0 0; opacity: 0.92; font-size: 15px; }

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-top: 24px;
  padding-bottom: 24px;
  align-items: start;
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.4px; }
.intro { margin: 0 0 18px; color: var(--muted); font-size: 15px; }

.field-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

textarea, select {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { resize: vertical; min-height: 84px; }
textarea:focus, select:focus, input[type="color"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.field { min-width: 0; }

input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 2px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { background: #f3f4f6; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Panel pohon ajaib ---- */

.tree-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 70%);
}

.tree-wrap {
  width: 100%;
  max-width: 300px;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tree-wrap:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 12px;
}
#magic-tree {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.25s ease;
}
.tree-wrap:hover #magic-tree,
.tree-wrap:focus-visible #magic-tree {
  transform: scale(1.03);
}
.tree-wrap.tapped #magic-tree {
  animation: shake 0.45s ease;
}
@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-2.5deg); }
  55% { transform: rotate(2deg); }
  80% { transform: rotate(-1deg); }
}
.foliage {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: sway 4.5s ease-in-out infinite alternate;
}
@keyframes sway {
  from { transform: rotate(-1.6deg); }
  to { transform: rotate(1.6deg); }
}

.tree-hint {
  margin: 2px 0 0;
  display: inline-block;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.qr-card {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 10px 28px rgba(22, 163, 74, 0.16);
}
.qr-card.show {
  animation: grow 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes grow {
  from { opacity: 0; transform: scale(0.7) translateY(14px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
#qr-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}
.status { margin: 10px 0 0; color: var(--muted); font-size: 14px; text-align: center; }
.idle-status { margin-top: 4px; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 0 26px;
  color: var(--muted);
  font-size: 13px;
  background: #fff;
}
.site-footer a { color: var(--accent); }
