*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: linear-gradient(160deg, #f1e7ff, #e6f0ff 50%, #e8f2ff);
  --card-bg: #ffffff;
  --text-main: #111827;
  --text-muted: #4b5563;
  --accent: #7b6bff;
  --accent-strong: #5b4ae6;
  --success: #27ae60;
  --locked: #6b7280;
  --shadow: 0 20px 60px rgba(31, 39, 51, 0.12);
  --radius: 16px;
  --panel: rgba(255, 255, 255, 0.85);
}

body.theme-dusk {
  --bg: linear-gradient(145deg, #2a2740, #4e3d70 50%, #1c1a2e);
  --card-bg: #26233a;
  --text-main: #0b0b0b;
  --text-muted: #2d2d2d;
  --accent: #c7a7ff;
  --accent-strong: #b691ff;
  --success: #7bf0b4;
  --locked: #a8adc7;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --panel: rgba(255, 255, 255, 0.08);
}

body.theme-sea {
  --bg: linear-gradient(170deg, #e4fbff, #c1e8ff 50%, #b4f0e2);
  --card-bg: #ffffff;
  --text-main: #0f2d3b;
  --text-muted: #325668;
  --accent: #0c9bb7;
  --accent-strong: #0b7f97;
  --success: #1caa72;
  --locked: #567685;
  --shadow: 0 20px 60px rgba(15, 45, 59, 0.14);
  --panel: rgba(255, 255, 255, 0.9);
}

body.theme-sunrise {
  --bg: linear-gradient(150deg, #fff1e4, #ffd8c2 50%, #ffe7d4);
  --card-bg: #ffffff;
  --text-main: #3b1f1a;
  --text-muted: #6a4a3f;
  --accent: #ff7b6b;
  --accent-strong: #ff5c45;
  --success: #2bb673;
  --locked: #8a7368;
  --shadow: 0 20px 60px rgba(74, 42, 30, 0.14);
  --panel: rgba(255, 245, 236, 0.9);
}

body.theme-forest {
  --bg: linear-gradient(160deg, #eaf5ed, #c9e4d4 50%, #d9f2e1);
  --card-bg: #fdfefb;
  --text-main: #12281d;
  --text-muted: #47624f;
  --accent: #2d8f5a;
  --accent-strong: #1f7345;
  --success: #2ea55f;
  --locked: #5b6b60;
  --shadow: 0 20px 60px rgba(18, 40, 29, 0.12);
  --panel: rgba(255, 255, 255, 0.88);
}

body.theme-desert {
  --bg: linear-gradient(140deg, #fbe9d7, #f6d6ad 55%, #f2c999);
  --card-bg: #fffaf3;
  --text-main: #3b2a1c;
  --text-muted: #6b5541;
  --accent: #e08b3f;
  --accent-strong: #c7742f;
  --success: #2d9e63;
  --locked: #8c6f55;
  --shadow: 0 20px 60px rgba(59, 42, 28, 0.12);
  --panel: rgba(255, 250, 243, 0.92);
}

body.theme-pastel {
  --bg: linear-gradient(160deg, #ffecec, #ffe1e1 50%, #fff4f4);
  --card-bg: #fffafa;
  --text-main: #0b0b0b;
  --text-muted: #2f2f2f;
  --accent: #f36c6c;
  --accent-strong: #e65050;
  --success: #2bb673;
  --locked: #6c6c6c;
  --shadow: 0 20px 60px rgba(11, 11, 11, 0.12);
  --panel: rgba(255, 250, 250, 0.92);
}

body.theme-mono {
  --bg: linear-gradient(180deg, #f7f7f7, #ededed);
  --card-bg: #fdfdfd;
  --text-main: #111111;
  --text-muted: #2b2b2b;
  --accent: #4b5563;
  --accent-strong: #1f2933;
  --success: #2bb673;
  --locked: #4b5563;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  --panel: rgba(255, 255, 255, 0.92);
}

body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
}

.background {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(123, 107, 255, 0.14), transparent 25%),
              radial-gradient(circle at 80% 15%, rgba(179, 217, 255, 0.22), transparent 24%),
              radial-gradient(circle at 30% 80%, rgba(133, 210, 182, 0.14), transparent 25%);
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

h1, h2, h3 {
  margin: 0;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

.header-card {
  text-align: center;
  padding: 32px 28px;
}

.logo-wrap {
  display: flex;
  justify-content: center;
}

.logo-img {
  max-width: 320px;
  width: 70%;
  height: auto;
  filter: drop-shadow(0 8px 22px rgba(31, 39, 51, 0.18));
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(31, 39, 51, 0.2);
  color: var(--accent-strong);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.link-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(31, 39, 51, 0.12);
}

.unlock-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin: -8px -4px 12px;
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(123, 107, 255, 0.14), rgba(91, 74, 230, 0.16));
  color: var(--text-main);
  border: 1px solid rgba(91, 74, 230, 0.2);
  box-shadow: 0 10px 26px rgba(31, 39, 51, 0.12);
}

.banner-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.theme-row {
  margin-top: 12px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(31, 39, 51, 0.08);
}

.theme-row select {
  border: 1px solid rgba(31, 39, 51, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  background: #ffffff;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.subtitle {
  font-size: 18px;
  color: var(--text-main);
  margin-top: 6px;
}

.description {
  color: var(--text-muted);
  margin-top: 8px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text-main);
}

.pill-soft {
  background: linear-gradient(120deg, #f2efff, #e1f0ff);
  color: var(--accent-strong);
  font-weight: 600;
}

.pill-outline {
  border: 1px solid rgba(31, 39, 51, 0.08);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.6);
}

label {
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
  color: var(--text-main);
}

.form-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

textarea,
input[type="date"] {
  width: 100%;
  border: 1px solid rgba(31, 39, 51, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-main);
  background: #fbfbff;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

textarea:focus,
input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(123, 107, 255, 0.12);
  background: #ffffff;
}

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

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 15px 35px rgba(91, 74, 230, 0.28);
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
  min-width: 160px;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(91, 74, 230, 0.32);
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondary-btn {
  background: #ffffff;
  color: var(--accent-strong);
  border: 1px solid rgba(31, 39, 51, 0.12);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
  box-shadow: 0 10px 20px rgba(31, 39, 51, 0.08);
}

.secondary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(31, 39, 51, 0.12);
}

.ghost-btn {
  background: transparent;
  border: 1px dashed rgba(31, 39, 51, 0.2);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text-muted);
}

.ghost-btn.small {
  font-size: 13px;
}

.delete-btn {
  border-color: rgba(255, 71, 87, 0.4);
  color: #d63031;
}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 14px;
  border-radius: 3px;
  opacity: 0.9;
  animation: confetti-fall 900ms ease-out forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg); }
  100% { transform: translateY(80vh) rotate(360deg); opacity: 0; }
}

.inspiration-card {
  max-width: 1100px;
  margin: 0 auto 60px;
  padding: 28px;
}

.inspiration-card h1 {
  margin-bottom: 8px;
}

.inspiration-card h2 {
  margin-top: 20px;
  margin-bottom: 8px;
}

.inspiration-card h3 {
  margin-top: 14px;
  margin-bottom: 6px;
}

.inspiration-card ul {
  margin: 0 0 12px 18px;
  padding: 0;
  line-height: 1.6;
}

.inspiration-card li {
  margin-bottom: 4px;
}

.inspire-section + .inspire-section {
  margin-top: 18px;
}

.inspiration-card .description {
  margin-bottom: 10px;
}

.paragraph-spaced p {
  margin-bottom: 14px;
}

.paragraph-spaced p:last-child {
  margin-bottom: 0;
}

.top-nav {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 5;
}

.top-nav .nav-inner {
  max-width: 120px;
  width: 110px;
  margin: 0;
  padding: 6px;
  background: var(--panel);
  border: 1px solid rgba(31, 39, 51, 0.08);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(31, 39, 51, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-brand {
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  font-size: 18px;
  display: none;
}

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

.nav-links a {
  display: block;
  padding: 5px 7px;
  border-radius: 12px;
  border: 1px solid rgba(31, 39, 51, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, color 120ms ease;
}

.nav-links a:hover {
  transform: translateX(2px);
  color: var(--accent-strong);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(31, 39, 51, 0.12);
}

.nav-links a[aria-current="page"] {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  border-color: var(--accent-strong);
  box-shadow: 0 14px 32px rgba(91, 74, 230, 0.28);
}

.nav-links a[aria-current="page"]:hover {
  transform: translateX(2px);
}

.inline-alert {
  padding: 12px 14px;
  background: #fff7e6;
  border: 1px solid rgba(255, 171, 64, 0.4);
  color: #8c5a1a;
  border-radius: 12px;
  margin-bottom: 12px;
  font-weight: 600;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-btn.active {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: rgba(123, 107, 255, 0.1);
}

.inspire-block {
  border: 1px dashed rgba(31, 39, 51, 0.12);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.8);
}

.inspire-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.inspire-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quote-display {
  margin-top: 8px;
  font-style: italic;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 10px;
  border: 1px solid rgba(31, 39, 51, 0.06);
}

.shake {
  animation: shake 300ms ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

.helper {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

.word-row {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.notify-row {
  border: 1px dashed rgba(31, 39, 51, 0.12);
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.8);
}

.notify-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-main);
}

.secondary-btn.small {
  padding: 8px 10px;
  font-size: 14px;
}

.auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.session-info {
  margin-top: 12px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 10px 20px rgba(31, 39, 51, 0.08);
}

.session-info span {
  font-weight: 600;
  color: var(--text-main);
}

.messages-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.message-card {
  border: 1px solid rgba(31, 39, 51, 0.06);
  border-radius: 14px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(31, 39, 51, 0.07);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.message-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, rgba(123, 107, 255, 0.05), rgba(179, 217, 255, 0.05));
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.message-card:hover::before {
  opacity: 1;
}

.dates {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}

.status-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-locked {
  background: rgba(138, 143, 154, 0.15);
  color: var(--locked);
}

.badge-unlocked {
  background: rgba(39, 174, 96, 0.12);
  color: var(--success);
}

.message-body {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-main);
  white-space: pre-wrap;
}

.message-body.muted {
  color: var(--text-muted);
  font-style: italic;
}

.text-muted {
  color: var(--text-muted);
  font-size: 14px;
}

.hidden {
  display: none;
}

.media-player {
  width: 100%;
  margin-top: 8px;
  border-radius: 10px;
  background: #000;
}

.empty-state {
  text-align: center;
  padding: 28px;
  border: 1px dashed rgba(31, 39, 51, 0.12);
  border-radius: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.6);
}

.media-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.media-control {
  border: 1px dashed rgba(31, 39, 51, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.media-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

#audio-preview,
#video-preview {
  width: 100%;
  margin-top: 8px;
  border-radius: 10px;
  background: #000;
}

@media (max-width: 640px) {
  .top-nav {
    left: 12px;
    top: 12px;
    padding: 0;
  }

  .top-nav .nav-inner {
    max-width: none;
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 8px;
  }

  .nav-links {
    flex-direction: row;
    gap: 6px;
  }

  .nav-links a {
    padding: 5px 7px;
    font-size: 12px;
  }

  .shell {
    padding: 32px 16px 60px;
  }

  .card {
    padding: 20px;
  }

  .primary-btn {
    width: 100%;
  }

  .form-row {
    flex-direction: column;
    align-items: stretch;
  }
}
