@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600&family=Cairo:wght@400;500;600;700&display=swap');

:root {
  --bg: #20222e;
  --surface: #272a38;
  --surface-line: #33364a;
  --divider: #2c2f3d;
  --text: #f2f3f7;
  --muted: #9296a8;
  --faint: #6a6e80;
  --dim: #565a6b;
  --accent: #F0B80B;
  --accent-light: #ffd75e;
  --accent-ink: #20222e;
  --danger: #ff6b6b;
  --success: #5fd3a3;
  --violet: rgba(122, 110, 255, 0.20);
  --display: 'Fredoka', 'Cairo', system-ui, sans-serif;
  --body: 'Cairo', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
button { font-family: var(--body); }
[hidden] { display: none !important; }

/* ---------- page shell ---------- */

.lam-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;          /* avoids the iOS Safari toolbar gap */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(22px, env(safe-area-inset-top)) 0 max(26px, env(safe-area-inset-bottom));
}

/* Organic glows. Pointer-events off so they never eat a tap. */
.lam-glow {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}
.lam-glow--amber {
  top: -110px; left: -90px;
  width: min(300px, 78vw); height: min(300px, 78vw);
  border-radius: 58% 42% 51% 49% / 47% 53% 47% 53%;
  background: radial-gradient(circle at 40% 40%, rgba(240,184,11,0.30), rgba(240,184,11,0) 68%);
}
.lam-glow--violet {
  bottom: -130px; right: -110px;
  width: min(340px, 86vw); height: min(340px, 86vw);
  border-radius: 44% 56% 62% 38% / 55% 41% 59% 45%;
  background: radial-gradient(circle at 55% 45%, var(--violet), rgba(122,110,255,0) 70%);
}
.lam-glow--red {
  background: radial-gradient(circle at 40% 40%, rgba(255,107,107,0.24), rgba(255,107,107,0) 68%);
}
.lam-glow--green {
  top: -110px; right: -100px; left: auto;
  background: radial-gradient(circle at 45% 45%, rgba(95,211,163,0.20), rgba(95,211,163,0) 68%);
}

.lam-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

/* ---------- top bar ---------- */

.lam-topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lam-wordmark {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 13.5px;
}

.lam-icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  border: 1px solid var(--surface-line);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.lam-icon-btn:active { background: rgba(255,255,255,0.07); }

/* ---------- identity ---------- */

@keyframes lam-floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

.lam-avatar-wrap {
  position: relative;
  margin-top: clamp(24px, 6vh, 40px);
  animation: lam-floaty 5.5s ease-in-out infinite;
}

.lam-avatar {
  width: clamp(112px, 34vw, 136px);
  height: clamp(112px, 34vw, 136px);
  border-radius: 50%;
  background: var(--surface);
  border: 5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(240,184,11,0.20);
}
.lam-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lam-avatar svg { width: 43%; height: 43%; }

.lam-sticker {
  position: absolute;
  bottom: 4px;
  right: -8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--display);
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 4px solid var(--bg);
}

.lam-name {
  font-family: var(--display);
  font-size: clamp(22px, 6.5vw, 26px);
  color: var(--text);
  margin-top: 22px;
  text-align: center;
  line-height: 1.25;
}
.lam-handle { font-size: 13px; color: var(--faint); margin-top: 3px; }
.lam-bio {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  margin-top: 15px;
  line-height: 1.6;
  max-width: 300px;
}

/* ---------- record ---------- */

@keyframes lam-ring {
  0% { transform: scale(1); opacity: .55; }
  100% { transform: scale(1.65); opacity: 0; }
}

.lam-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(26px, 5vh, 44px);
}

.lam-rec-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lam-rec-ring {
  position: absolute;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  animation: lam-ring 2.2s ease-out infinite;
  pointer-events: none;
}
.lam-rec-ring--danger { border-color: var(--danger); animation-duration: 1.5s; }

.lam-rec-btn {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(150deg, var(--accent-light), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 18px 36px rgba(240,184,11,0.34);
}
.lam-rec-btn--stop {
  background: var(--surface);
  box-shadow: 0 14px 30px rgba(0,0,0,0.35);
  width: 104px;
  height: 104px;
}

.lam-cta-label { font-family: var(--display); font-size: 18px; color: var(--text); margin-top: 28px; }
.lam-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--surface-line);
  border-radius: 20px;
  padding: 7px 16px;
  margin-top: 11px;
  font-size: 12.5px;
  color: var(--accent);
}
.lam-sub { font-size: 12.5px; color: var(--faint); margin-top: 6px; text-align: center; }

/* countdown */
.lam-count {
  font-family: var(--display);
  font-size: clamp(58px, 17vw, 74px);
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-top: 26px;
}
.lam-count.is-low { color: var(--danger); }

.lam-live {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--danger);
  font-family: var(--display);
  font-size: 13.5px;
}
.lam-live::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

/* waveform */
@keyframes lam-bar {
  0%, 100% { transform: scaleY(0.35); }
  50% { transform: scaleY(1.25); }
}
.lam-wave { display: flex; align-items: center; gap: 5px; height: 78px; margin-top: 34px; }
.lam-wave span { width: 5px; border-radius: 3px; background: var(--accent); display: block; }
.lam-wave--live span { animation: lam-bar .9s ease-in-out infinite; }
.lam-wave--live span:nth-child(2) { animation-delay: .12s; }
.lam-wave--live span:nth-child(3) { animation-delay: .24s; }
.lam-wave--live span:nth-child(4) { animation-delay: .36s; }
.lam-wave--live span:nth-child(5) { animation-delay: .48s; }
.lam-wave--live span:nth-child(6) { animation-delay: .60s; }
.lam-wave--live span:nth-child(7) { animation-delay: .72s; }
.lam-wave--live span:nth-child(8) { animation-delay: .84s; }
.lam-wave--live span:nth-child(9) { animation-delay: .96s; }

/* ---------- review ---------- */

.lam-pill {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: 28px;
  padding: 11px 14px;
}
.lam-pill-play {
  width: 44px; height: 44px; min-width: 44px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.lam-pill-wave { flex: 1; min-width: 0; display: flex; align-items: center; gap: 3px; height: 22px; }
.lam-pill-wave span { width: 3px; border-radius: 2px; background: #4a4e60; display: block; }
.lam-pill-wave.is-playing span { background: var(--accent); animation: lam-bar .9s ease-in-out infinite; }
.lam-pill-wave.is-playing span:nth-child(2) { animation-delay: .1s; }
.lam-pill-wave.is-playing span:nth-child(3) { animation-delay: .2s; }
.lam-pill-wave.is-playing span:nth-child(4) { animation-delay: .3s; }
.lam-pill-wave.is-playing span:nth-child(5) { animation-delay: .4s; }
.lam-pill-wave.is-playing span:nth-child(6) { animation-delay: .5s; }
.lam-pill-wave.is-playing span:nth-child(7) { animation-delay: .6s; }
.lam-pill-wave.is-playing span:nth-child(8) { animation-delay: .7s; }
.lam-dur { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.lam-actions { display: flex; gap: 12px; margin-top: 14px; width: 100%; }

.lam-ghost-btn {
  width: 52px; height: 52px; min-width: 52px;
  border-radius: 26px;
  border: 1px solid var(--surface-line);
  background: transparent;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}

.lam-primary-btn {
  flex: 1;
  height: 52px;
  border-radius: 26px;
  border: none;
  background: linear-gradient(150deg, var(--accent-light), var(--accent));
  color: var(--accent-ink);
  font-family: var(--display);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.lam-primary-btn:disabled { opacity: .6; }
.lam-primary-btn--pill { flex: none; height: 46px; padding: 0 26px; border-radius: 23px; font-size: 15px; }

.lam-text-btn {
  height: 44px;
  padding: 0 20px;
  border-radius: 22px;
  border: 1px solid var(--surface-line);
  background: transparent;
  color: var(--accent);
  font-family: var(--display);
  font-size: 14px;
  cursor: pointer;
}

/* ---------- result states ---------- */

@keyframes lam-pop {
  0% { transform: scale(.55); opacity: 0; }
  65% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes lam-spin { to { transform: rotate(360deg); } }

.lam-badge {
  width: clamp(96px, 28vw, 118px);
  height: clamp(96px, 28vw, 118px);
  border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--surface-line);
  display: flex; align-items: center; justify-content: center;
}
.lam-badge svg { width: 44%; height: 44%; }
.lam-badge--ok { border-color: var(--success); animation: lam-pop .45s ease; }
.lam-badge--err { border-color: var(--danger); }
.lam-badge--accent { border-color: var(--accent); }

.lam-spinner {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 4px solid var(--divider);
  border-top-color: var(--accent);
  animation: lam-spin .85s linear infinite;
}

.lam-title {
  font-family: var(--display);
  font-size: clamp(19px, 5.5vw, 24px);
  color: var(--text);
  margin-top: 18px;
  text-align: center;
  line-height: 1.35;
}
.lam-body {
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
  line-height: 1.6;
  max-width: 300px;
}

/* ---------- listen ---------- */

.lam-orb {
  width: clamp(126px, 38vw, 148px);
  height: clamp(126px, 38vw, 148px);
  border-radius: 50%;
  background: linear-gradient(150deg, var(--accent-light), var(--accent));
  display: flex; align-items: center; justify-content: center; gap: 5px;
  box-shadow: 0 20px 46px rgba(240,184,11,0.26);
}
.lam-orb span { width: 5px; border-radius: 3px; background: var(--accent-ink); display: block; }
.lam-orb.is-playing span { animation: lam-bar 1s ease-in-out infinite; }
.lam-orb.is-playing span:nth-child(2) { animation-delay: .14s; }
.lam-orb.is-playing span:nth-child(3) { animation-delay: .28s; }
.lam-orb.is-playing span:nth-child(4) { animation-delay: .42s; }
.lam-orb.is-playing span:nth-child(5) { animation-delay: .56s; }

.lam-player { width: 100%; margin-top: 34px; display: flex; align-items: center; gap: 15px; }
.lam-play-btn {
  width: 62px; height: 62px; min-width: 62px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(150deg, var(--accent-light), var(--accent));
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  box-shadow: 0 12px 26px rgba(240,184,11,0.30);
}
.lam-track {
  height: 9px;
  border-radius: 5px;
  background: var(--divider);
  overflow: hidden;
}
.lam-fill { height: 100%; width: 0%; border-radius: 5px; background: var(--accent); }
.lam-times {
  display: flex; justify-content: space-between;
  margin-top: 8px;
  font-size: 11.5px; color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.lam-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; justify-content: center; }
.lam-pill-btn {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: 22px;
  border: 1px solid var(--surface-line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-family: var(--display);
  font-size: 14px;
  cursor: pointer;
}

/* ---------- footer ---------- */

.lam-footer { width: 100%; margin-top: auto; padding-top: 34px; display: flex; flex-direction: column; align-items: center; }
.lam-app-btn {
  width: 100%;
  height: 54px;
  border-radius: 27px;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-family: var(--display);
  font-size: 15px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer;
}
.lam-footnote { font-size: 11.5px; color: var(--dim); margin-top: 12px; text-align: center; }

.lam-stats { display: flex; flex-wrap: wrap; width: 100%; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--divider); justify-content: center; gap: 10px 20px; }
.lam-stat { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- misc ---------- */

.lam-404 { font-family: var(--display); font-size: clamp(52px, 16vw, 62px); color: #2f3243; line-height: 1; }

.lam-tooltip {
  position: absolute;
  top: 62px; left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: 14px;
  padding: 12px 15px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  z-index: 5;
}

/* Respect a user's reduced-motion preference: the floating avatar, pulse
   ring and waveform are decorative, and continuous motion is a genuine
   accessibility problem for some people. */
@media (prefers-reduced-motion: reduce) {
  .lam-avatar-wrap,
  .lam-rec-ring,
  .lam-wave span,
  .lam-pill-wave span,
  .lam-orb span,
  .lam-badge--ok {
    animation: none !important;
  }
}

/* Sender consent on the record page. Quiet but legible -- it has to be
   readable to be meaningful, so it is not shrunk into invisibility. */
.lam-consent {
	margin: 14px auto 0;
	max-width: 320px;
	font-size: 12px;
	line-height: 1.55;
	text-align: center;
	color: #8b90a3;
}
.lam-consent a {
	color: #F0B80B;
	text-decoration: underline;
}
