:root {
  --bg: #0f0b1e;
  --bg2: #171130;
  --card: #1e1740;
  --card2: #262050;
  --accent: #ff4d8d;
  --accent2: #8a5cff;
  --text: #f3eefc;
  --muted: #a99fce;
  --danger: #ff5470;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #2a1b55 0%, var(--bg) 55%) fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Topbar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px;
  background: rgba(20, 14, 45, 0.8);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand { font-weight: 800; font-size: 1.25rem; color: var(--text); }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar nav a { color: var(--muted); font-weight: 600; }
.topbar nav a:hover { color: var(--text); text-decoration: none; }

.container { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 28px 18px; }

/* Buttons */
.btn-primary, .btn-ghost, .btn-danger, .btn-pill {
  display: inline-block; cursor: pointer; border: none;
  padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: 0.95rem;
  transition: transform .08s ease, opacity .15s ease;
}
.btn-primary { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; }
.btn-ghost { background: rgba(255,255,255,0.07); color: var(--text); border: 1px solid rgba(255,255,255,0.12); }
.btn-danger { background: rgba(255, 84, 112, 0.15); color: var(--danger); border: 1px solid rgba(255,84,112,0.3); }
.btn-pill { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; }
.btn-primary:hover, .btn-ghost:hover, .btn-danger:hover, .btn-pill:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary.wide { width: 100%; margin-top: 10px; }
.sm { padding: 7px 13px; font-size: 0.82rem; }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-weight: 600; padding: 0; }
.inline { display: inline; }

/* Hero */
.hero { text-align: center; padding: 20px 0 40px; }
.hero h1 { font-size: 2.4rem; line-height: 1.15; margin-bottom: 16px; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 1.08rem; max-width: 560px; margin: 0 auto 24px; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 36px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.feature { background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius); padding: 18px; }
.feature span { font-size: 1.8rem; }
.feature h3 { margin: 8px 0 4px; font-size: 1rem; }
.feature p { color: var(--muted); font-size: 0.85rem; margin: 0; }

/* Cards */
.card, .auth-card {
  background: var(--card); border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius); padding: 26px;
}
.auth-card { max-width: 420px; margin: 20px auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.big-emoji { font-size: 3rem; }

/* Forms */
input[type=text], input[type=password], input[type=file], textarea, select {
  width: 100%; padding: 11px 13px; margin: 6px 0 4px;
  background: var(--bg2); color: var(--text);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; font-size: 0.95rem;
}
textarea { resize: vertical; }
label { font-weight: 600; font-size: 0.9rem; display: block; margin-top: 12px; }
label.checkbox { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
label.checkbox input { width: auto; margin: 0; }
.form-error, .errorlist { color: var(--danger); font-size: 0.85rem; list-style: none; padding: 0; }
.helptext { color: var(--muted); font-size: 0.78rem; }
form p { margin: 10px 0; }

.upload-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 10px; }
.upload-box { background: var(--bg2); border-radius: 12px; padding: 12px; border: 1px dashed rgba(255,255,255,0.15); }

/* Dashboard */
.dash-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.room-list { display: flex; flex-direction: column; gap: 14px; }
.room-card { background: var(--card); border: 1px solid rgba(255,255,255,0.07); border-radius: var(--radius); padding: 18px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.room-card.inactive { opacity: 0.55; }
.room-mood { font-size: 0.8rem; color: var(--muted); }
.room-card h3 { margin: 4px 0; }
.room-stats { color: var(--muted); font-size: 0.82rem; margin-top: 8px; }
.room-actions { display: flex; gap: 7px; align-items: flex-start; flex-wrap: wrap; }
.empty { text-align: center; padding: 50px 0; color: var(--muted); }

/* Share */
.share-box { display: flex; gap: 8px; margin: 18px 0; }
.share-box input { margin: 0; }
.share-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }

/* QR share code */
.qr-box { display: flex; flex-direction: column; align-items: center; margin: 18px 0 20px; }
.qr-img { width: 180px; height: 180px; background: #fff; padding: 10px; border-radius: 14px; box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.qr-caption { margin-top: 10px; font-size: 0.82rem; }

/* Room / confession */
.room { background: var(--card); border-radius: 20px; padding: 22px; border: 1px solid rgba(255,255,255,0.08); }
.room-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mood-chip, .owner-chip { font-size: 0.78rem; padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,0.08); color: var(--muted); }
.conf-title { font-size: 1.7rem; margin: 8px 0 16px; }
.conf-media { width: 100%; border-radius: 14px; margin: 10px 0; display: block; }
.conf-audio { width: 100%; margin: 12px 0; }
.conf-message { font-size: 1.15rem; line-height: 1.6; white-space: pre-wrap; }

.mood-romantic { box-shadow: 0 0 60px rgba(255,77,141,0.25) inset; }
.mood-angry { box-shadow: 0 0 60px rgba(255,84,112,0.22) inset; }
.mood-funny { box-shadow: 0 0 60px rgba(138,92,255,0.22) inset; }

/* Replies */
.replies { margin-top: 24px; background: var(--card); border-radius: 20px; padding: 22px; border: 1px solid rgba(255,255,255,0.07); }
.reaction-row { display: flex; flex-wrap: wrap; gap: 9px; margin: 14px 0; }
.reaction-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--card2); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 10px 14px; cursor: pointer; color: var(--text); min-width: 72px; transition: transform .08s; }
.reaction-btn:hover { transform: translateY(-2px); }
.reaction-btn.active { border-color: var(--accent); background: rgba(255,77,141,0.18); }
.r-emoji { font-size: 1.4rem; }
.r-label { font-size: 0.74rem; color: var(--muted); }
.selected-reaction { background: rgba(255,77,141,0.12); padding: 8px 12px; border-radius: 10px; margin: 6px 0; font-size: 0.88rem; display: flex; justify-content: space-between; align-items: center; }
.hidden { display: none; }

.comment-list { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.comment { background: var(--bg2); border-radius: 14px; padding: 13px 15px; }
.c-head { display: flex; justify-content: space-between; align-items: baseline; }
.c-nick { color: var(--accent); }
.c-time { color: var(--muted); font-size: 0.75rem; }
.c-reaction { margin-top: 6px; font-weight: 600; }
.c-gif { max-width: 180px; border-radius: 10px; margin-top: 8px; display: block; }
.c-body { margin: 8px 0 0; }

.make-own { margin-top: 26px; color: var(--muted); }

/* Messages */
.messages { max-width: 760px; margin: 10px auto 0; padding: 0 18px; }
.toast { padding: 11px 15px; border-radius: 12px; margin-bottom: 8px; font-size: 0.9rem; background: var(--card2); border: 1px solid rgba(255,255,255,0.1); }
.toast.success { border-color: rgba(99,255,170,0.3); }
.toast.error { border-color: rgba(255,84,112,0.4); }

/* Footer */
.footer { text-align: center; padding: 24px; color: var(--muted); font-size: 0.82rem; }

@media (max-width: 520px) {
  .hero h1 { font-size: 1.8rem; }
  .room-card { flex-direction: column; }
}

/* --- Premium UI --- */
.nav-premium { color: #ffd166 !important; font-weight: 700; }
.premium-pill { font-size: 0.68rem; vertical-align: middle; padding: 3px 9px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; margin-left: 6px; }

.premium-hero { padding: 30px 26px; }
.price-tag { margin: 14px 0 6px; }
.price-amount { font-size: 2.6rem; font-weight: 800; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.price-per { color: var(--muted); font-size: 1rem; }

.perk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 24px 0; }
.perk { background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius); padding: 18px; }
.perk span { font-size: 1.8rem; }
.perk h3 { margin: 8px 0 4px; font-size: 1rem; }
.perk p { color: var(--muted); font-size: 0.85rem; margin: 0; }

.upgrade-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--card2); border: 1px solid rgba(255,209,102,0.25); border-radius: 14px;
  padding: 12px 16px; margin-bottom: 16px; flex-wrap: wrap; }

.btn-ghost.locked { opacity: 0.7; }
.locked-box { opacity: 0.6; }
.locked-box input { cursor: not-allowed; }

/* Analytics */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; margin: 16px 0 22px; }
.stat-box { background: var(--card); border: 1px solid rgba(255,255,255,0.07); border-radius: var(--radius); padding: 18px; text-align: center; }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--text); }
.stat-label { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.bar-list { list-style: none; padding: 0; margin: 10px 0 0; }
.bar-list li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.bar-label { color: var(--text); }
.bar-count { color: var(--accent); font-weight: 700; }

/* Premium room theme: a gold-tinted border + glow exclusive to premium owners */
.room-premium { border: 1px solid rgba(255,209,102,0.4); box-shadow: 0 0 50px rgba(255,209,102,0.15), 0 0 80px rgba(138,92,255,0.1) inset; }
