:root {
  --bg: #fff7fb;
  --bg-deep: #eef8ff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-soft: rgba(255, 245, 251, 0.82);
  --text: #2b1d3a;
  --muted: #76637f;
  --line: rgba(197, 122, 173, 0.18);
  --accent: #ff4f93;
  --accent-strong: #ff2f7d;
  --accent-2: #1bb2e9;
  --accent-3: #6d45d7;
  --danger: #d03b62;
  --success: #139a72;
  --shadow: 0 28px 70px rgba(174, 78, 138, 0.16);
  --radius: 28px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 79, 147, 0.16), transparent 28%),
    radial-gradient(circle at 92% 10%, rgba(27, 178, 233, 0.18), transparent 24%),
    linear-gradient(180deg, var(--bg), #ffffff 38%, var(--bg-deep) 100%);
  min-height: 100vh;
}

html.age-gate-active,
html.age-gate-active body {
  overflow: hidden;
}

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

.wrap {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  position: relative;
}

.nav, .nav-links, .actions, .chips, .stat-grid, .profile-grid, .feature-grid, .admin-grid, .match-grid, .message-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nav {
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  margin: 24px 0 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 79, 147, 0.12);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(102, 54, 98, 0.08);
}

.brand {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--accent-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

.nav-links a, .chip, .tag {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.hero, .panel, .auth-card, .profile-card, .message-card, .table-card {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 79, 147, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  padding: 42px;
  margin: 8px 0 32px;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at top right, rgba(27, 178, 233, 0.14), transparent 26%),
    radial-gradient(circle at bottom left, rgba(255, 79, 147, 0.16), transparent 28%),
    linear-gradient(145deg, #ffffff, #fff7fc 58%, #f4fbff);
}

.hero h1, h2, h3 { margin-top: 0; }
.hero h1 {
  font-size: clamp(2.7rem, 5vw, 5.5rem);
  line-height: 0.92;
  margin-bottom: 20px;
  max-width: 11ch;
  color: #2b1841;
}

.lead, .muted { color: var(--muted); line-height: 1.7; }

.btn, button, input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff8f3;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 46px;
  box-shadow: 0 14px 30px rgba(255, 47, 125, 0.22);
}

.btn.alt, button.alt {
  background: linear-gradient(135deg, var(--accent-2), #4f7ef7);
}
.btn.ghost, button.ghost {
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  border: 1px solid rgba(109, 69, 215, 0.18);
  box-shadow: none;
}
.btn.danger, button.danger { background: var(--danger); }

.section { margin: 28px 0; }
.feature-grid > *, .profile-grid > *, .admin-grid > *, .match-grid > *, .message-grid > * { flex: 1 1 260px; }
.panel, .auth-card, .profile-card, .message-card, .table-card { padding: 24px; }
.stat-grid > * { flex: 1 1 140px; }

.stat {
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,251,255,0.9));
  border: 1px solid rgba(27, 178, 233, 0.14);
}

.stat strong {
  display: block;
  font-size: 2rem;
}

form { display: grid; gap: 14px; }
label { display: grid; gap: 8px; font-weight: 700; }

input, textarea, select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(176, 97, 154, 0.18);
  background: #fffdf8;
  color: var(--text);
  font: inherit;
}

textarea { min-height: 110px; resize: vertical; }

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.notice {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 18px;
}

.notice.error { background: rgba(171, 47, 47, 0.1); color: #7d1c1c; }
.notice.success { background: rgba(19, 154, 114, 0.1); color: #0f5c3b; }

.age-gate[hidden] {
  display: none;
}

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.age-gate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(33, 16, 44, 0.58);
  backdrop-filter: blur(10px);
}

.age-gate-card {
  position: relative;
  width: min(100%, 520px);
  padding: 32px;
  border: 1px solid rgba(255, 79, 147, 0.2);
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(27, 178, 233, 0.16), transparent 28%),
    linear-gradient(160deg, rgba(255,255,255,0.98), rgba(255,245,251,0.96));
  box-shadow: 0 30px 80px rgba(29, 9, 39, 0.26);
}

.age-gate-card h2 {
  margin-bottom: 12px;
}

.age-gate-card .actions {
  margin-top: 24px;
}

.eyebrow {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--accent-2);
  font-weight: 700;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 0.92rem;
}

.inline-form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 8px 0;
}

.footer {
  padding: 32px 0 48px;
  color: var(--muted);
}

.avatar {
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 26px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255,255,255,0.5);
  box-shadow: 0 14px 36px rgba(91, 58, 117, 0.18);
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
  background:
    radial-gradient(circle at 28% 24%, rgba(255,79,147,0.22), transparent 34%),
    linear-gradient(140deg, #fff2fb, #eef8ff);
}

.hero .panel {
  display: flex;
  align-items: center;
}

.profile-card {
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,247,251,0.96));
}

.profile-card .avatar {
  max-width: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0;
  margin-bottom: 0;
  box-shadow: none;
}

.profile-card > .eyebrow,
.profile-card > h3,
.profile-card > p,
.profile-card > .chips,
.profile-card > form,
.profile-card > a {
  margin-left: 22px;
  margin-right: 22px;
}

.profile-card > .eyebrow {
  margin-top: 20px;
}

.profile-card > h3 {
  margin-bottom: 10px;
}

.profile-card > p:last-of-type {
  margin-bottom: 18px;
}

.profile-card > form:last-child,
.profile-card > a:last-child {
  margin-bottom: 22px;
}

.auth-card,
.table-card,
.panel,
.message-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(252,247,255,0.96));
}

.table-card {
  overflow: hidden;
}

.table th, .table td {
  border-bottom: 1px solid rgba(205, 143, 192, 0.16);
}

.table th {
  background: rgba(255, 245, 251, 0.65);
}

.message-card .avatar,
.panel .avatar,
.auth-card .avatar {
  max-width: 132px;
}

.actions .btn,
.actions .chip {
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.actions .btn:hover,
button:hover,
.chip:hover {
  transform: translateY(-1px);
}

.brand::after {
  content: " ♥";
  color: var(--accent);
}

.chat-hero {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.chat-shell {
  display: grid;
  gap: 16px;
}

.chat-thread {
  display: grid;
  gap: 14px;
  max-height: 68vh;
  overflow-y: auto;
  padding-right: 4px;
}

.chat-placeholder {
  padding: 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 20px;
}

.chat-bubble {
  max-width: min(78%, 620px);
  padding: 16px 18px;
  border-radius: 24px;
  border: 1px solid rgba(205, 143, 192, 0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(252,247,255,0.96));
  box-shadow: 0 10px 24px rgba(91, 58, 117, 0.08);
}

.chat-bubble.mine {
  margin-left: auto;
  background: linear-gradient(135deg, rgba(255, 79, 147, 0.16), rgba(27, 178, 233, 0.14));
}

.chat-bubble.deleted {
  opacity: 0.76;
  background: rgba(255, 255, 255, 0.72);
}

.chat-bubble-header,
.chat-bubble-meta,
.chat-bubble-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.chat-bubble-header {
  margin-bottom: 8px;
}

.chat-bubble-body {
  margin: 0;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble-meta {
  margin-top: 12px;
}

.chat-bubble-actions {
  justify-content: flex-start;
}

.chat-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  min-height: auto;
}

.chat-status {
  min-height: 24px;
}

.chat-composer {
  gap: 10px;
}

.chat-composer textarea {
  min-height: 124px;
}

@media (max-width: 900px) {
  .hero, .split { grid-template-columns: 1fr; }
  .nav {
    flex-direction: column;
    align-items: flex-start;
    border-radius: 26px;
  }
  .chat-hero {
    grid-template-columns: 1fr;
  }
  .chat-bubble {
    max-width: 100%;
  }
}
