/* congratulation.me — anonymous flower garden */

:root {
  --bg-1: #f6f3ec;
  --bg-2: #ece7da;
  --ink: #2b251c;
  --muted: #8a7e6b;
  --line: #d9d2c1;
  --yellow-1: #ffd64a;
  --yellow-2: #ffb938;
  --yellow-3: #f59e0b;
  --danger: #b94545;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg-1); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif; }

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

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 24px 80px; }

/* ---------- header ---------- */
.garden-head { text-align: center; margin: 12px 0 24px; }
.site-title { font-size: 32px; font-weight: 700; margin: 0 0 6px;
  background: linear-gradient(90deg, var(--yellow-3), var(--yellow-1));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { color: var(--muted); margin: 0; }

/* ---------- garden canvas ---------- */
.garden { position: relative; min-height: 70vh; }
.garden-bg {
  position: relative;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 214, 74, 0.18), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(255, 185, 56, 0.16), transparent 40%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 70vh;
  overflow: hidden;
}

.empty-garden {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-size: 18px;
}

/* ---------- flower ---------- */
.flower {
  position: absolute;
  width: 36px; height: 36px;
  margin-left: -18px; margin-top: -18px;
  cursor: pointer;
  outline: none;
  transition: transform .15s ease;
}
.flower:hover, .flower:focus { transform: scale(1.15); z-index: 10; }

.petals {
  position: absolute; inset: 0;
}
.petals span {
  position: absolute;
  width: 14px; height: 14px;
  background: radial-gradient(circle at 35% 35%, var(--yellow-1), var(--yellow-2));
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.petals span:nth-child(1) { top: 0;   left: 50%; transform: translateX(-50%); }
.petals span:nth-child(2) { right: 0; top: 50%; transform: translateY(-50%); }
.petals span:nth-child(3) { bottom: 0; left: 50%; transform: translateX(-50%); }
.petals span:nth-child(4) { left: 0;   top: 50%; transform: translateY(-50%); }
.petals span:nth-child(5) { top: 8px; left: 8px; width: 12px; height: 12px; opacity: 0.85; }

.center {
  position: absolute; left: 50%; top: 50%;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  background: radial-gradient(circle at 40% 40%, #b45309, #6b2a05);
  border-radius: 50%;
  z-index: 1;
}

/* tooltip */
.tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: 180px; max-width: 280px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  font-size: 14px; line-height: 1.45;
  color: var(--ink);
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 20;
}
.flower:hover .tip,
.flower:focus .tip { opacity: 1; transform: translateX(-50%) translateY(0); }
.tip-content { white-space: normal; }
.tip-time { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* write button (fixed) */
.write-btn {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--yellow-2);
  color: #fff;
  border: 0;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, background-color .15s ease;
}
.write-btn:hover { background: var(--yellow-3); transform: scale(1.05); }

/* modal */
.modal {
  border: 0; border-radius: 12px;
  padding: 0;
  width: min(92vw, 440px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal::backdrop { background: rgba(0,0,0,0.45); }
.modal-form { padding: 24px 24px 20px; }
.modal-form h2 { margin: 0 0 4px; font-size: 22px; }
.modal-sub { color: var(--muted); margin: 0 0 14px; font-size: 13px; }
.modal-form textarea {
  width: 100%; min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}
.modal-form textarea:focus { outline: 2px solid var(--yellow-1); border-color: var(--yellow-2); }
.honeypot {
  position: absolute; left: -9999px; top: -9999px;
  width: 1px; height: 1px; opacity: 0;
}
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px;
}
.modal-actions button {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font: inherit;
}
.modal-actions button[type="submit"] {
  background: var(--yellow-2); color: #fff; border-color: var(--yellow-2);
}
.modal-actions button[type="submit"]:hover { background: var(--yellow-3); }

/* ---------- flash + error ---------- */
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin: 0 auto 14px;
  max-width: 480px;
  text-align: center;
}
.flash.ok { background: #fff8e1; color: #6b4f00; }
.flash.err { background: #fde7e7; color: var(--danger); }
.err { color: var(--danger); }

/* ---------- admin ---------- */
.topbar { display: flex; align-items: center; gap: 24px; padding: 10px 24px;
  background: #fff; border-bottom: 1px solid var(--line); }
.topbar .brand { font-weight: 600; }
.topbar nav { display: flex; gap: 16px; margin-left: auto; }
.topbar a { color: var(--ink); }
.topbar a:hover { color: var(--yellow-3); }

.card-form { background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px; }
.card-form label { display: block; margin: 12px 0; font-size: 13px; color: #555; }
.card-form input {
  display: block; width: 100%; padding: 8px 10px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 4px; background: #fff;
  font: inherit;
}
.card-form button {
  padding: 10px 16px; margin-top: 8px;
  border: 0; background: var(--yellow-2); color: #fff;
  border-radius: 4px; cursor: pointer; font: inherit; font-weight: 500;
  width: 100%;
}
.card-form button:hover { background: var(--yellow-3); }

.empty { color: var(--muted); padding: 32px 0; text-align: center; }

.admin-table {
  width: 100%; border-collapse: collapse; margin-top: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; vertical-align: top; }
.admin-table thead th { background: var(--bg-2); font-weight: 600; font-size: 13px; color: #555; }
.admin-table tbody tr { border-top: 1px solid var(--line); }
.admin-table tbody tr:hover { background: #fffae6; }
.admin-table .time-cell { white-space: nowrap; font-size: 13px; color: var(--muted); }
.admin-table .pos-cell { color: var(--muted); font-size: 12px; }
.admin-table .msg-cell { word-break: break-word; }
.admin-table .act-cell { white-space: nowrap; }
.admin-table button {
  padding: 5px 10px; font-size: 12px;
  background: var(--danger); color: #fff; border: 0;
  border-radius: 4px; cursor: pointer; font: inherit;
}
.admin-table button:hover { opacity: 0.85; }

.foot { text-align: center; color: var(--muted); padding: 24px 0 12px; font-size: 12px; }