:root {
  --bg: #1e0f36;
  --bg-alt: #150a28;
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text: #f3f0ff;
  --text-dim: #b9aed6;
  --success: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 20% -10%, #331a5c 0%, var(--bg) 45%, var(--bg-alt) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

nav.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  box-shadow: 0 0 12px var(--accent);
}

.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { color: var(--text-dim); font-weight: 500; }
.nav-links a:hover { color: var(--text); }

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: white;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.45);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(124, 58, 237, 0.6); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

input, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); }
label { display: block; margin-bottom: 6px; font-size: 0.85rem; color: var(--text-dim); }
.field { margin-bottom: 16px; }

.hero {
  padding: 90px 20px 60px;
  text-align: center;
}
.hero h1 { font-size: 2.6rem; margin-bottom: 14px; line-height: 1.15; }
.hero .accent-text {
  background: linear-gradient(135deg, var(--accent-light), #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { color: var(--text-dim); font-size: 1.15rem; max-width: 620px; margin: 0 auto 30px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
}

.card { padding: 24px; }
.card h3 { margin-top: 0; }
.muted { color: var(--text-dim); }
.section { padding: 50px 0; }
.section-title { text-align: center; font-size: 1.8rem; margin-bottom: 40px; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(124, 58, 237, 0.25);
  color: var(--accent-light);
}
.badge.premium { background: rgba(251, 191, 36, 0.2); color: var(--warn); }

.auth-wrap {
  max-width: 420px;
  margin: 80px auto;
  padding: 32px;
}
.auth-wrap h2 { margin-top: 0; text-align: center; }

.owner-dot {
  position: fixed;
  bottom: 16px;
  left: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.35);
  cursor: pointer;
  z-index: 9999;
  transition: background 0.2s;
}
.owner-dot:hover { background: rgba(124, 58, 237, 0.9); }

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 14px 18px;
  border-radius: 10px;
  z-index: 10000;
  max-width: 320px;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast.error { background: rgba(248, 113, 113, 0.15); border: 1px solid var(--danger); color: #fecaca; }
.toast.success { background: rgba(52, 211, 153, 0.15); border: 1px solid var(--success); color: #bbf7d0; }

footer.site-footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--glass-border);
  margin-top: 40px;
}
footer.site-footer a { color: var(--text-dim); margin: 0 8px; }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-top: 24px; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

.mood-scale { display: flex; gap: 10px; justify-content: center; margin: 18px 0; }
.mood-scale button {
  font-size: 1.8rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
}
.mood-scale button:hover { transform: scale(1.08); border-color: var(--accent); }
.mood-scale button.selected { border-color: var(--accent); background: rgba(124,58,237,0.25); }

.stat-tile { text-align: center; padding: 18px; }
.stat-tile .num { font-size: 2rem; font-weight: 800; color: var(--accent-light); }
.stat-tile .label { color: var(--text-dim); font-size: 0.85rem; }

.game-card { padding: 20px; text-align: center; }
.game-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 340px;
  margin: 20px auto;
}
.game-tile {
  aspect-ratio: 1;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-tile.flipped, .game-tile.matched { background: rgba(124,58,237,0.35); }

.reaction-box {
  width: 100%;
  max-width: 340px;
  height: 220px;
  margin: 20px auto;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.chat-window {
  height: 420px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-bubble { padding: 10px 14px; border-radius: 14px; max-width: 80%; line-height: 1.4; }
.chat-bubble.user { align-self: flex-end; background: linear-gradient(135deg, var(--accent-light), var(--accent)); color: white; }
.chat-bubble.assistant { align-self: flex-start; background: rgba(255,255,255,0.07); border: 1px solid var(--glass-border); }
.chat-input-row { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--glass-border); }
.chat-input-row input { flex: 1; }

.pricing-card { padding: 32px; text-align: center; position: relative; }
.pricing-card .price { font-size: 2.4rem; font-weight: 800; margin: 10px 0; }
.pricing-card .price span { font-size: 1rem; color: var(--text-dim); font-weight: 400; }
.pricing-card ul { list-style: none; padding: 0; text-align: left; margin: 20px 0; }
.pricing-card ul li { padding: 8px 0; color: var(--text-dim); }
.pricing-card ul li::before { content: "✓ "; color: var(--success); font-weight: 700; }

.legal { max-width: 760px; margin: 60px auto; padding: 20px; line-height: 1.7; color: var(--text-dim); }
.legal h1, .legal h2 { color: var(--text); }
