:root {
  --bg: #17151c;
  --card: #3a2430;
  --accent: #f0997b;
  --accent-dim: #c97a61;
  --text: #f5ece7;
  --text-dim: #b9a8a8;
  --danger: #e2645a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px calc(24px + var(--safe-bottom));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
}

p {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.5;
}

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.card-accent {
  border: 1px solid rgba(240, 153, 123, 0.35);
}

.stat-row {
  display: flex;
  gap: 12px;
}

.stat-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border-radius: 16px;
  padding: 12px 14px;
}

.stat-pill .icon {
  font-size: 20px;
}

.stat-pill .value {
  font-size: 18px;
  font-weight: 700;
}

.stat-pill .label {
  font-size: 11px;
  color: var(--text-dim);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

.btn {
  background: var(--accent);
  color: #24141a;
  font-weight: 700;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 15px;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(245, 236, 231, 0.2);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
}

.option-btn {
  background: rgba(245, 236, 231, 0.06);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 10px;
  font-size: 14px;
  text-align: center;
  border: 1px solid transparent;
}

.option-btn.selected {
  border-color: var(--accent);
  background: rgba(240, 153, 123, 0.15);
}

.option-btn:disabled {
  opacity: 0.35;
}

.mood-hero {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 20px;
  margin: 0 auto;
}

.mood-option-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 14px;
  margin: 0 auto;
  display: block;
}

.mood-thumb {
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 6px;
}

.timeline-who {
  display: flex;
  align-items: center;
}

nav.tabbar {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  background: rgba(58, 36, 48, 0.92);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 10px 6px calc(10px + var(--safe-bottom));
  margin-top: auto;
}

nav.tabbar button {
  background: none;
  color: var(--text-dim);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 10px;
}

nav.tabbar button .icon {
  font-size: 20px;
}

nav.tabbar button.active {
  color: var(--accent);
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 8px 0 20px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--text-dim);
}

.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.pin-pad button {
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(245, 236, 231, 0.06);
  color: var(--text);
  font-size: 20px;
}

.pin-pad button:active {
  background: rgba(245, 236, 231, 0.15);
}

textarea, input[type="text"] {
  width: 100%;
  background: rgba(245, 236, 231, 0.06);
  border: 1px solid rgba(245, 236, 231, 0.15);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
}

.center-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
}

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

.week-strip {
  display: flex;
  justify-content: space-between;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
}

.week-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(245, 236, 231, 0.15);
}

.week-dot.active {
  background: var(--accent);
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(245, 236, 231, 0.08);
  font-size: 13px;
}

.timeline-item:last-child {
  border-bottom: none;
}

.reveal-locked {
  text-align: center;
  padding: 24px 0;
}

.reveal-locked .big-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
}

.answer-block {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(245, 236, 231, 0.06);
}

.answer-block .who {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 4px;
}

.hidden {
  display: none !important;
}
