:root {
  --brand: #16a34a;
  --bg: #0f172a;
  --bg2: #1e293b;
  --card: rgba(255, 255, 255, 0.06);
  --card-hover: rgba(255, 255, 255, 0.12);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", Roboto, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--brand) 35%, transparent), transparent 60%),
    linear-gradient(160deg, var(--bg), var(--bg2));
  background-attachment: fixed;
}

.hidden { display: none !important; }

/* ---------- Gate ---------- */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fade-in 0.4s ease;
}
.gate.fade-out { animation: fade-out 0.26s ease forwards; }

.gate-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 40px 28px;
  box-shadow: var(--shadow);
}

.avatar {
  font-size: 56px;
  line-height: 1;
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  border: 2px solid color-mix(in srgb, var(--brand) 45%, transparent);
  overflow: hidden;
}
.avatar.has-img { background: transparent; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Announcement above the avatar */
.announcement {
  display: block;
  max-width: 420px;
  margin: 0 auto 20px;
  padding: 11px 16px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: pre-wrap;
  word-break: break-word;
}
.announcement::before {
  content: "📢 ";
}
.announcement.clickable { cursor: pointer; transition: filter 0.15s ease; }
.announcement.clickable:hover { filter: brightness(1.15); }

.gate-card h1 { font-size: 26px; margin-bottom: 6px; }
.subtitle { color: var(--muted); font-size: 15px; }

.gate-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 28px 0 14px;
}
.gate-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.gate-btn .gate-ico { font-size: 34px; }
.gate-btn:hover { transform: translateY(-3px); background: var(--card-hover); }
.gate-btn.male:hover { border-color: #38bdf8; }
.gate-btn.female:hover { border-color: #f472b6; }

.gate-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  opacity: 0.85;
}

/* ---------- Profile ---------- */
.profile {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 20px 40px;
  animation: fade-in 0.4s ease;
}
.profile-head { text-align: center; margin-bottom: 28px; }
.profile-head h1 { font-size: 24px; margin-bottom: 6px; }

.links { display: flex; flex-direction: column; gap: 14px; }

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
a.link-card:hover {
  transform: translateY(-2px);
  background: var(--card-hover);
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
}

.link-icon {
  font-size: 26px;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
}
.link-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.link-title { font-weight: 600; font-size: 16px; }
.link-desc { color: var(--muted); font-size: 13px; }
.link-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 999px;
}
.link-arrow { color: var(--muted); font-size: 18px; flex: 0 0 auto; }

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

.foot { text-align: center; margin-top: 36px; color: var(--muted); font-size: 12px; opacity: 0.7; }

@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-out { to { opacity: 0; transform: scale(0.98); } }
