/* Duette App Styles — matches landing page design language */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --deep: #0a0a12;
  --surface: #12121e;
  --surface2: #1a1a2e;
  --warm: #e8a87c;
  --warmlight: #f5c9a8;
  --warmdark: #c88a5c;
  --cool: #7c8ce8;
  --coollight: #b0b8f5;
  --text: #e8e8f0;
  --muted: #8888a0;
  --glow: rgba(232, 168, 124, 0.15);
  --danger: #e87c7c;
  --success: #7ce8a8;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--deep);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
}

h1, h2, h3 { font-family: 'Syne', sans-serif; }

/* Ambient background */
.ambient {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ambient .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
}
.ambient .orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--warm), transparent 70%);
  top: -200px; left: -150px;
  animation: float1 20s ease-in-out infinite;
}
.ambient .orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--cool), transparent 70%);
  bottom: -100px; right: -100px;
  animation: float2 25s ease-in-out infinite;
}
@keyframes float1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(60px, 40px); } }
@keyframes float2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-40px, -60px); } }

/* App shell */
#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--warm), var(--cool));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}
.app-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.app-user-name {
  font-size: 0.85rem;
  color: var(--muted);
}
.btn-logout {
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }

/* Page container */
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 24px 40px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

/* Auth page */
.auth-container {
  width: 100%;
  max-width: 380px;
  margin-top: 60px;
}
.auth-title {
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.auth-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 36px;
  font-weight: 300;
}
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  background: var(--surface);
  border-radius: 12px;
  padding: 4px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
  font-weight: 500;
  border: none;
  background: none;
}
.auth-tab.active {
  background: var(--surface2);
  color: var(--text);
}
.auth-tab:hover:not(.active) { color: var(--text); }

/* Forms */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.form-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus {
  border-color: var(--warm);
}
.form-input::placeholder {
  color: rgba(136, 136, 160, 0.5);
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--warm), var(--warmdark));
  border: none;
  border-radius: 12px;
  color: var(--deep);
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Syne', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
  letter-spacing: -0.3px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(232, 168, 124, 0.25); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  width: 100%;
  padding: 14px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: rgba(255,255,255,0.2); }

.btn-cool {
  background: linear-gradient(135deg, var(--cool), #5c6cc8);
  color: white;
}

/* Error message */
.error-msg {
  background: rgba(232, 124, 124, 0.1);
  border: 1px solid rgba(232, 124, 124, 0.2);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  text-align: center;
}

/* Pairing page */
.pair-container {
  width: 100%;
  margin-top: 40px;
}
.pair-title {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.pair-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 32px;
  font-weight: 300;
}
.pair-divider {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 28px 0;
  position: relative;
}
.pair-divider::before, .pair-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: rgba(255,255,255,0.06);
}
.pair-divider::before { left: 0; }
.pair-divider::after { right: 0; }

.invite-code-display {
  text-align: center;
  padding: 32px;
  background: var(--surface);
  border-radius: 16px;
  margin-bottom: 16px;
}
.invite-code-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.invite-code {
  font-family: 'Syne', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 8px;
  background: linear-gradient(135deg, var(--warm), var(--cool));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.invite-code-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 12px;
  font-weight: 300;
}
.btn-copy {
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 16px;
  transition: all 0.2s;
}
.btn-copy:hover { border-color: var(--warm); color: var(--warm); }

.waiting-pair {
  text-align: center;
  padding: 24px;
}
.waiting-pair .dot-pulse {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 16px;
}
.waiting-pair .dot-pulse span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--warm);
  animation: dotPulse 1.5s ease-in-out infinite;
}
.waiting-pair .dot-pulse span:nth-child(2) { animation-delay: 0.2s; }
.waiting-pair .dot-pulse span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }

/* Today / daily prompt page */
.today-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.today-date {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.today-greeting {
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 32px;
}
.today-greeting strong {
  color: var(--text);
  font-weight: 500;
}

/* Prompt card */
.prompt-card {
  width: 100%;
  background: var(--surface);
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}
.prompt-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--warm), var(--cool));
}
.prompt-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--cool);
  margin-bottom: 16px;
}
.prompt-text {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.3px;
}

/* Record button */
.record-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}
.record-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--warm), var(--warmdark));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  position: relative;
  box-shadow: 0 8px 32px rgba(232, 168, 124, 0.3);
}
.record-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(232, 168, 124, 0.4);
}
.record-btn:active { transform: scale(0.98); }
.record-btn svg {
  width: 36px;
  height: 36px;
  fill: var(--deep);
}
.record-btn.recording {
  background: linear-gradient(135deg, #e85c5c, #c83c3c);
  box-shadow: 0 8px 32px rgba(232, 92, 92, 0.4);
  animation: recordPulse 1.5s ease-in-out infinite;
}
.record-btn.recording::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(232, 92, 92, 0.3);
  animation: ringPulse 1.5s ease-in-out infinite;
}
@keyframes recordPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes ringPulse { 0%, 100% { transform: scale(1); opacity: 0.4; } 50% { transform: scale(1.15); opacity: 0; } }

.record-label {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 300;
}
.record-timer {
  font-family: 'Syne', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--danger);
  letter-spacing: 2px;
}

/* Live waveform during recording */
.waveform-live {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  margin: 8px 0;
}
.waveform-live .bar {
  width: 3px;
  background: var(--warm);
  border-radius: 2px;
  transition: height 0.1s ease;
  min-height: 4px;
}

/* Waiting for partner */
.waiting-container {
  text-align: center;
  padding: 20px 0;
}
.waiting-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(124, 232, 168, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.8rem;
}
.waiting-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.waiting-text {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 300;
}
.waiting-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}
.waiting-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--warm);
  opacity: 0.3;
  animation: waitDot 2s ease-in-out infinite;
}
.waiting-dots span:nth-child(2) { animation-delay: 0.3s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.6s; }
@keyframes waitDot { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

/* Reveal */
.reveal-container {
  width: 100%;
  text-align: center;
}
.reveal-celebration {
  font-size: 2rem;
  margin-bottom: 12px;
  animation: celebBounce 0.6s ease-out;
}
@keyframes celebBounce { 0% { transform: scale(0); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

.reveal-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.reveal-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 32px;
}

/* Audio player cards */
.audio-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.audio-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.audio-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.audio-card.mine::before { background: var(--warm); }
.audio-card.partner::before { background: var(--cool); }

.audio-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.audio-card.mine .audio-card-label { color: var(--warm); }
.audio-card.partner .audio-card-label { color: var(--cool); }

.audio-player {
  display: flex;
  align-items: center;
  gap: 16px;
}
.play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.audio-card.mine .play-btn { background: rgba(232, 168, 124, 0.15); }
.audio-card.partner .play-btn { background: rgba(124, 140, 232, 0.15); }
.play-btn:hover { transform: scale(1.05); }
.play-btn svg { width: 20px; height: 20px; }
.audio-card.mine .play-btn svg { fill: var(--warm); }
.audio-card.partner .play-btn svg { fill: var(--cool); }

.audio-progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.audio-bar-bg {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}
.audio-bar-fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}
.audio-card.mine .audio-bar-fill { background: var(--warm); }
.audio-card.partner .audio-bar-fill { background: var(--cool); }

.audio-time {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

/* History */
.history-section {
  width: 100%;
  margin-top: 32px;
}
.history-title {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
  text-align: center;
}
.history-item {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 16px;
}
.history-item:hover { background: var(--surface2); }
.history-date {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  min-width: 60px;
}
.history-prompt {
  font-size: 0.9rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-play {
  color: var(--warm);
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Nav bottom */
.nav-bottom {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px 24px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
.nav-btn {
  flex: 1;
  padding: 10px;
  text-align: center;
  background: none;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.nav-btn.active {
  border-color: var(--warm);
  color: var(--warm);
  background: rgba(232, 168, 124, 0.05);
}
.nav-btn:hover:not(.active) { border-color: rgba(255,255,255,0.15); color: var(--text); }

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(232, 168, 124, 0.2);
  border-top-color: var(--warm);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Fade in animation */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 480px) {
  .prompt-text { font-size: 1.2rem; }
  .prompt-card { padding: 28px 20px; }
  .invite-code { font-size: 2rem; letter-spacing: 6px; }
}
