* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #09090d;
  --bg-soft: #111118;
  --surface: rgba(22, 22, 30, 0.82);
  --surface-strong: rgba(31, 31, 42, 0.94);
  --surface-hover: rgba(45, 45, 58, 0.9);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f7f4f2;
  --muted: #a8a2a0;
  --faint: #706c6d;
  --accent: #ff2e55;
  --accent-2: #ff7a3a;
  --accent-dark: #b70f2f;
  --danger-bg: rgba(255, 46, 85, 0.14);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --shadow-red: 0 16px 42px rgba(255, 46, 85, 0.26);
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 4%, rgba(255, 46, 85, 0.18), transparent 32rem),
    radial-gradient(circle at 82% 0%, rgba(255, 122, 58, 0.12), transparent 30rem),
    linear-gradient(145deg, #09090d 0%, #121116 48%, #09090d 100%);
  color: var(--text);
  font-family: 'Barlow', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app {
  width: min(1220px, 100%);
  margin: 0 auto;
  min-height: 100vh;
}

.header {
  height: 76px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 13, 0.74);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.logo:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.logo span {
  color: var(--accent);
}

.logo-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(255, 46, 85, 0.28));
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn,
.back-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav-btn:hover,
.nav-btn.active,
.back-btn:hover {
  color: var(--text);
  border-color: rgba(255, 46, 85, 0.5);
  background: rgba(255, 46, 85, 0.13);
  transform: translateY(-1px);
}

.search-bar {
  position: sticky;
  top: 76px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  background: rgba(9, 9, 13, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.search-input,
.form-input,
.form-textarea,
.form-select,
.comment-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.search-input {
  min-height: 44px;
  padding: 0 18px;
}

.search-input::placeholder,
.form-input::placeholder,
.form-textarea::placeholder,
.comment-input::placeholder {
  color: var(--faint);
}

.search-input:focus,
.form-input:focus,
.form-textarea:focus,
.form-select:focus,
.comment-input:focus {
  border-color: rgba(255, 46, 85, 0.72);
  background: rgba(255, 255, 255, 0.078);
  box-shadow: 0 0 0 4px rgba(255, 46, 85, 0.12);
}

.search-clear,
.close-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.search-clear {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.search-clear:hover,
.close-btn:hover {
  color: var(--text);
  background: rgba(255, 46, 85, 0.14);
  transform: translateY(-1px);
}

.layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 24px;
  padding: 28px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-card,
.card,
.auth-card,
.form-card,
.notif-panel,
.user-dropdown,
.profile-hero,
.profile-relic-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar-card {
  border-radius: 24px;
  padding: 18px;
}

.sidebar-title {
  margin-bottom: 10px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.profile-header {
  text-align: center;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.profile-avatar,
.avatar,
.comment-avatar,
.user-avatar,
.profile-hero-avatar {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: var(--shadow-red);
  flex-shrink: 0;
}

.profile-avatar img,
.avatar img,
.comment-avatar img,
.user-avatar img,
.profile-hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  margin: 0 auto 12px;
  font-size: 24px;
}

.profile-avatar-btn,
.avatar-btn,
.username-btn {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.profile-avatar-btn:hover,
.avatar-btn:hover {
  transform: translateY(-1px) scale(1.02);
}

.profile-name {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.profile-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.profile-stats,
.profile-big-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat,
.profile-big-stats div {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  padding: 14px 10px;
  text-align: center;
}

.stat-num,
.profile-big-stats strong {
  display: block;
  color: var(--text);
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.stat-label,
.profile-big-stats span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.chip:hover,
.chip.active {
  color: var(--text);
  border-color: rgba(255, 46, 85, 0.62);
  background: linear-gradient(135deg, rgba(255, 46, 85, 0.22), rgba(255, 122, 58, 0.12));
  transform: translateY(-1px);
}

.main,
.feed {
  min-width: 0;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.publish-btn,
.form-submit-btn,
.comment-send-btn,
.login-sidebar-btn,
.profile-edit-btn {
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  box-shadow: var(--shadow-red);
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.publish-btn {
  min-height: 56px;
  border-radius: 18px;
  font-size: 16px;
}

.publish-btn:hover,
.form-submit-btn:hover,
.comment-send-btn:hover,
.login-sidebar-btn:hover,
.profile-edit-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 18px 48px rgba(255, 46, 85, 0.34);
}

.publish-btn:disabled,
.form-submit-btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.no-results,
.profile-loading,
.profile-empty {
  padding: 54px 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.035);
}

.card {
  border-radius: 24px;
  overflow: visible;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.card-highlighted {
  border-color: rgba(255, 46, 85, 0.8);
  box-shadow: 0 0 0 4px rgba(255, 46, 85, 0.14), var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  font-size: 14px;
}

.card-user {
  flex: 1;
  min-width: 0;
}

.username {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.username-btn {
  display: inline;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
}

.username-btn:hover {
  color: var(--accent-2);
}

.meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  border: 1px solid rgba(255, 46, 85, 0.32);
  border-radius: 999px;
  background: rgba(255, 46, 85, 0.12);
  color: #ffd0d9;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.post-owner-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  flex-shrink: 0;
}

.post-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.post-delete-inline {
  min-height: 38px;
  border: 1px solid rgba(255, 46, 85, 0.42);
  border-radius: 12px;
  background: rgba(255, 46, 85, 0.14);
  color: #ffd1da;
  cursor: pointer;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
}

.post-delete-inline:hover {
  border-color: rgba(255, 46, 85, 0.74);
  background: rgba(255, 46, 85, 0.22);
}

.post-menu-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.post-menu-btn:hover {
  background: rgba(255, 46, 85, 0.14);
  border-color: rgba(255, 46, 85, 0.42);
  transform: translateY(-1px);
}

.post-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 260;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.post-menu-item {
  width: 100%;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 10px 11px;
  text-align: left;
  font-weight: 800;
  display: block;
}

.post-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.post-menu-danger {
  color: #ff8b9f;
}

.post-menu-danger:hover {
  background: var(--danger-bg);
  color: #ffd1da;
}

.badge-pinned {
  background: rgba(255, 210, 90, 0.16);
  border-color: rgba(255, 210, 90, 0.4);
  color: #ffe6a3;
}

.profile-pinned-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  background: rgba(255, 210, 90, 0.9);
  color: #201400;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.owner-delete-strip {
  display: flex;
  justify-content: flex-end;
  padding: 0 18px 10px;
}

.post-delete-primary {
  min-height: 46px;
  border: 1px solid rgba(255, 46, 85, 0.72);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 46, 85, 0.28), rgba(255, 122, 58, 0.18));
  color: #fff3f5;
  cursor: pointer;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(255, 46, 85, 0.2);
}

.post-delete-primary:hover {
  background: linear-gradient(135deg, rgba(255, 46, 85, 0.38), rgba(255, 122, 58, 0.24));
  transform: translateY(-1px);
}

.carousel {
  position: relative;
  background: #060609;
}

.card-img {
  display: block;
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  background: #050506;
  cursor: zoom-in;
}

.photo-placeholder,
.profile-relic-placeholder {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0 10px, rgba(255, 255, 255, 0.02) 10px 20px);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

.carousel-btn.left { left: 14px; }
.carousel-btn.right { right: 14px; }

.carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  display: flex;
  gap: 7px;
  transform: translateX(-50%);
}

.dot {
  width: 8px;
  height: 8px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.dot.active {
  width: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.card-body {
  padding: 16px 18px 10px;
}

.card-title {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.22;
}

.card-desc {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.card-footer {
  display: flex;
  gap: 8px;
  padding: 12px 14px 16px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 0 13px;
  cursor: pointer;
  font-weight: 700;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.action-btn:hover,
.action-btn.liked,
.active-comment {
  color: var(--text);
  border-color: rgba(255, 46, 85, 0.5);
  background: rgba(255, 46, 85, 0.13);
}

.comments-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.comment {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 11px;
}

.comment-menu-wrap {
  align-self: center;
}

.comment-menu-btn {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-size: 12px;
  opacity: 0.7;
}

.comment-menu-btn:hover {
  opacity: 1;
}

.comment-content {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  padding: 9px 12px;
}

.comment-username {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.comment-text,
.comment-empty,
.comment-loading {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.comment-empty,
.comment-loading {
  text-align: center;
  padding: 8px;
}

.comment-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-input {
  min-height: 40px;
  padding: 0 14px;
}

.comment-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  flex-shrink: 0;
}

.form-overlay,
.image-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(14px);
}

.form-card {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 26px;
  padding: 24px;
}

.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.form-header h2,
.auth-card h2 {
  color: var(--text);
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.close-btn {
  width: 38px;
  height: 38px;
  border-radius: 13px;
}

.form-card label,
.auth-card label {
  display: block;
  margin: 11px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input,
.form-select {
  min-height: 46px;
  padding: 0 14px;
}

.form-select option {
  background: #14141c;
  color: var(--text);
}

.form-textarea {
  min-height: 112px;
  padding: 12px 14px;
  resize: vertical;
}

.form-submit-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border-radius: 15px;
}

.photo-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.photo-upload-btn:hover {
  color: var(--text);
  border-color: rgba(255, 46, 85, 0.65);
  background: rgba(255, 46, 85, 0.1);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.preview-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 13px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.auth-card {
  width: min(430px, calc(100% - 32px));
  margin: 78px auto;
  border-radius: 28px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-card p {
  color: var(--muted);
  line-height: 1.5;
}

.auth-error {
  border: 1px solid rgba(255, 46, 85, 0.34);
  border-radius: 14px;
  background: var(--danger-bg);
  color: #ffd1da;
  padding: 11px 13px;
  font-size: 14px;
}

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

.auth-link,
.user-dropdown-btn {
  border: none;
  background: none;
  color: #ff8b9f;
  cursor: pointer;
  font-weight: 800;
}

.login-sidebar-btn {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  margin-top: 8px;
}

.user-menu,
.notif-wrapper {
  position: relative;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  cursor: pointer;
}

.user-dropdown,
.notif-panel {
  position: absolute;
  right: 0;
  top: 52px;
  z-index: 210;
  border-radius: 20px;
}

.user-dropdown {
  min-width: 190px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-dropdown-name {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
}

.user-dropdown-btn {
  text-align: left;
  padding: 6px 2px;
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #09090d;
  background: var(--accent);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
}

.notif-panel {
  width: min(340px, calc(100vw - 28px));
  max-height: 430px;
  overflow-y: auto;
}

.notif-header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 20, 28, 0.94);
  backdrop-filter: blur(14px);
}

.notif-title {
  color: var(--text);
  font-weight: 900;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.notif-clickable {
  cursor: pointer;
}

.notif-clickable:hover,
.notif-unread {
  background: rgba(255, 46, 85, 0.09);
}

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.065);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.notif-from {
  color: var(--text);
  font-weight: 800;
}

.notif-post-title,
.notif-empty {
  color: var(--faint);
  font-size: 12px;
  margin-top: 3px;
}

.notif-empty {
  padding: 28px;
  text-align: center;
}

.image-overlay {
  z-index: 300;
  cursor: zoom-out;
}

.image-overlay-content {
  position: relative;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
}

.image-fullscreen {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 22px;
  object-fit: contain;
  box-shadow: var(--shadow);
}

.image-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Profile page */
.profile-app {
  width: min(1280px, 100%);
}

.profile-page {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-hero {
  border-radius: 30px;
  overflow: hidden;
}

.profile-cover {
  height: clamp(190px, 26vw, 330px);
  background: linear-gradient(135deg, rgba(255, 46, 85, 0.42), rgba(255, 122, 58, 0.2)), #14141c;
  position: relative;
}

.profile-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9, 9, 13, 0.84), transparent 58%);
}

.profile-cover img,
.profile-cover-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-cover-fallback {
  background:
    radial-gradient(circle at 25% 35%, rgba(255, 255, 255, 0.18), transparent 12rem),
    linear-gradient(135deg, rgba(255, 46, 85, 0.46), rgba(255, 122, 58, 0.18) 42%, rgba(255, 255, 255, 0.04));
}

.profile-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  padding: 0 28px 24px;
  margin-top: -68px;
  position: relative;
  z-index: 2;
}

.profile-hero-avatar {
  width: 136px;
  height: 136px;
  border-radius: 34px;
  border: 4px solid rgba(9, 9, 13, 0.94);
  font-size: 48px;
}

.profile-copy {
  min-width: 0;
}

.profile-kicker {
  color: #ffb4c1;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.profile-copy h1 {
  color: var(--text);
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: clamp(44px, 7vw, 84px);
  line-height: 0.9;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.profile-bio {
  max-width: 680px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.profile-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.profile-meta-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 700;
}

.profile-edit-btn {
  min-height: 46px;
  border-radius: 15px;
  padding: 0 18px;
  white-space: nowrap;
}

.profile-big-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 28px 28px;
}

.profile-big-stats strong {
  font-size: 42px;
}

.profile-relics {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  color: var(--text);
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

.section-heading span {
  color: var(--muted);
  font-weight: 800;
}

.profile-post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.profile-relic-card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
}

.profile-post-menu-wrap {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
}

.profile-post-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
}

.profile-post-actions .profile-post-menu-wrap {
  position: relative;
  top: auto;
  right: auto;
}

.profile-delete-inline {
  background: rgba(9, 9, 13, 0.82);
  backdrop-filter: blur(12px);
}

.profile-relic-img,
.profile-relic-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.profile-relic-body {
  padding: 14px;
}

.profile-relic-body span {
  color: #ffb4c1;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.profile-relic-body h3 {
  margin-top: 5px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.15;
}

.profile-relic-body p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 940px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .profile-post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-identity {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-edit-btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .header {
    height: 68px;
    padding: 0 14px;
  }

  .logo {
    font-size: 30px;
  }

  .logo-img {
    width: 38px;
    height: 38px;
  }

  .layout,
  .profile-page {
    padding: 16px;
  }

  .search-bar {
    top: 68px;
    padding: 12px 16px;
  }

  .card-header,
  .card-body,
  .comments-section {
    padding-left: 14px;
    padding-right: 14px;
  }

  .card-header {
    flex-wrap: wrap;
  }

  .post-owner-actions {
    margin-left: auto;
  }

  .owner-delete-strip {
    justify-content: stretch;
    padding-left: 14px;
    padding-right: 14px;
  }

  .post-delete-primary {
    width: 100%;
  }

  .profile-identity {
    grid-template-columns: 1fr;
    margin-top: -56px;
    padding: 0 18px 20px;
  }

  .profile-hero-avatar {
    width: 112px;
    height: 112px;
    border-radius: 28px;
  }

  .profile-copy h1 {
    font-size: 50px;
  }

  .profile-big-stats,
  .profile-post-grid {
    grid-template-columns: 1fr;
  }

  .profile-big-stats {
    padding: 0 18px 20px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-overlay,
  .image-overlay {
    padding: 12px;
  }
}