/* ===== Токены ===== */
:root {
  --bg-void: #150F1A;
  --surface: #221A2E;
  --surface-2: #2C2138;
  --surface-3: #382A47;
  --accent: #FF5D73;
  --accent-2: #FFC29B;
  --text: #F5EFEE;
  --text-muted: #B3A8C2;
  --text-dim: #7C7189;
  --fuse-dim: #4A3E58;
  --danger: #FF7A6E;
  --radius: 18px;
  --font-display: "Fraunces", serif;
  --font-body: "Inter", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-void);
  color: var(--text);
  font-family: var(--font-body);
  height: 100%;
  overscroll-behavior-y: none;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

/* ===== Топбар ===== */
.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 18px 20px 10px;
  flex-shrink: 0;
}
.wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.city-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  border: 1px solid var(--surface-3);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ===== Вьюпорт ===== */
.view {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 24px;
  -webkit-overflow-scrolling: touch;
}

/* ===== Таббар ===== */
.tabbar {
  display: flex;
  flex-shrink: 0;
  border-top: 1px solid var(--surface-2);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: var(--bg-void);
}
.tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 10.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  border-radius: 12px;
  transition: color .15s ease;
}
.tab-icon { font-size: 18px; line-height: 1; }
.tab.active { color: var(--accent); }

/* ===== Карточка поста (feed) ===== */
.post-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  margin-bottom: 14px;
  overflow: hidden;
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Фирменный элемент: "фитиль" — полоса, выгорающая по мере истечения поста */
.fuse-track {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--fuse-dim);
}
.fuse-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 1s linear, background-color 1s linear;
}

.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.avatar {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--surface-3);
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-style: italic;
  color: var(--text-muted);
}
.post-who { flex: 1; min-width: 0; }
.post-name { font-weight: 600; font-size: 14.5px; }
.post-meta { font-size: 11.5px; color: var(--text-dim); }
.post-timer {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.post-category {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent-2);
  border: 1px solid rgba(255,194,155,.3);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.post-text {
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  margin: 0 0 14px;
}
.post-actions { display: flex; gap: 8px; }

/* ===== Кнопки ===== */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform .1s ease, opacity .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #1A0E12; flex: 1; }
.btn-ghost { background: var(--surface-2); color: var(--text-muted); }
.btn-full { width: 100%; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(255,122,110,.35); }
.btn:disabled { opacity: .5; cursor: default; }

/* ===== Пустое состояние ===== */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-glyph { font-size: 34px; color: var(--accent); margin-bottom: 10px; display: block; }
.empty-title { font-family: var(--font-display); font-style: italic; font-size: 19px; color: var(--text); margin: 0 0 6px; }
.empty-sub { font-size: 13.5px; line-height: 1.5; max-width: 280px; margin: 0 auto; }

/* ===== Форма создания поста ===== */
.section-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  margin: 10px 0 16px;
}
.field-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 16px 0 8px;
  display: block;
}
textarea, input[type=text], select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--surface-3);
  border-radius: 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
}
textarea { resize: none; min-height: 90px; line-height: 1.4; }
.char-count { text-align: right; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); margin-top: 4px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--surface-3);
  color: var(--text-muted);
  cursor: pointer;
}
.chip.selected { background: var(--accent); border-color: var(--accent); color: #1A0E12; }

/* ===== Профиль ===== */
.profile-head { display: flex; align-items: center; gap: 14px; margin: 8px 0 20px; }
.profile-avatar { width: 64px; height: 64px; border-radius: 18px; object-fit: cover; background: var(--surface-3); }
.profile-name { font-family: var(--font-display); font-style: italic; font-size: 22px; }
.profile-handle { color: var(--text-dim); font-size: 13px; }

.match-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.match-info { flex: 1; }
.match-name { font-weight: 600; font-size: 14.5px; }
.match-sub { font-size: 12px; color: var(--text-dim); }

.responder-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-2);
}
.responder-row:last-child { border-bottom: none; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%; bottom: 90px;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-3);
  color: var(--text);
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 100;
  max-width: 85%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
