* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-dark: #0a0a0a;
  --bg-red: #4a0000;
  --btn-bg: rgba(20, 0, 0, 0.8);
  --border-red: #8b0000;
  --glow-red: #5c0000;
  --text-main: #f0f0f0;
  --text-muted: #a0a0a0;
  --online: #00ff88;
  --offline: #888888;
}

body {
  font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-main);
  background: linear-gradient(to bottom, var(--bg-red) 0%, var(--bg-dark) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  padding: 16px;
  overflow-x: hidden;
}

.app {
  max-width: 600px;
  margin: 0 auto;
}

/* ═══════ PROFILE ═══════ */
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--btn-bg);
  border: 1.5px solid var(--border-red);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 0 12px var(--glow-red);
  margin-bottom: 16px;
}

.avatar-ring {
  padding: 3px;
  border-radius: 50%;
  border: 2px solid var(--border-red);
  box-shadow: 0 0 10px var(--border-red);
  flex-shrink: 0;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.profile-info { flex: 1; min-width: 0; }

.nickname-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nickname {
  font-size: 22px;
  font-weight: 700;
  transition: color 0.3s;
}

.nickname.online { color: var(--online); text-shadow: 0 0 8px var(--online); }
.nickname.offline { color: var(--offline); }

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online { background: var(--online); box-shadow: 0 0 8px var(--online); }
.status-dot.offline { background: var(--offline); }

.tg-handle { color: var(--text-muted); font-size: 14px; margin-top: 2px; }
.bio { color: var(--text-muted); font-size: 13px; margin-top: 6px; line-height: 1.4; }

/* ═══════ MENU ═══════ */
.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.menu-btn {
  flex: 1 1 calc(50% - 8px);
  min-width: 130px;
  background: var(--btn-bg);
  color: var(--text-main);
  border: 1.5px solid var(--border-red);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 8px var(--glow-red), 0 0 15px rgba(92, 0, 0, 0.5);
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

.menu-btn:hover, .menu-btn.active {
  background: rgba(60, 0, 0, 0.9);
  box-shadow: 0 0 15px var(--border-red), 0 0 25px rgba(139, 0, 0, 0.8);
  transform: translateY(-1px);
}

.admin-btn {
  flex: 1 1 100%;
  border-color: #ffcc00;
  box-shadow: 0 0 8px #ffcc00;
  color: #ffcc00;
}

/* ═══════ SECTIONS ═══════ */
.section {
  background: rgba(10, 0, 0, 0.6);
  border: 1.5px solid var(--border-red);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 0 12px var(--glow-red);
  animation: fadeIn 0.3s ease;
}

.section h2 {
  margin-bottom: 16px;
  font-size: 20px;
  color: #ff6666;
  text-shadow: 0 0 6px var(--glow-red);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.text-block {
  color: var(--text-main);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ═══════ CARDS ═══════ */
.cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: rgba(20, 0, 0, 0.7);
  border: 1px solid rgba(139, 0, 0, 0.5);
  border-radius: 12px;
  padding: 12px;
}

.card.pinned { border-color: #ffcc00; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 8px;
}

.card-title { font-weight: 600; font-size: 15px; color: #ff8888; }
.card-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.card-text { font-size: 14px; line-height: 1.5; color: #ddd; }
.card-meta { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.small-btn {
  background: var(--btn-bg);
  color: var(--text-main);
  border: 1px solid var(--border-red);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.small-btn:hover { background: rgba(60, 0, 0, 0.9); box-shadow: 0 0 6px var(--border-red); }
.small-btn.danger { border-color: #ff4444; color: #ff8888; }
.small-btn.liked { background: var(--border-red); }

/* ═══════ STREAM BADGES ═══════ */
.stream-live {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}
.stream-live.on { background: #ff0033; color: white; animation: pulse 1.5s infinite; }
.stream-live.off { background: #555; color: #ccc; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

.stream-link {
  display: inline-block;
  margin-top: 8px;
  color: #ff8888;
  text-decoration: none;
  font-size: 13px;
}
.stream-link:hover { text-decoration: underline; }

/* ═══════ FORMS ═══════ */
.suggest-form, .admin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

textarea, input {
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-main);
  border: 1px solid var(--border-red);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

textarea:focus, input:focus {
  outline: none;
  border-color: #ff4444;
  box-shadow: 0 0 8px var(--border-red);
}

textarea { min-height: 80px; }

/* ═══════ ADMIN TABS ═══════ */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tab {
  flex: 1;
  min-width: 80px;
  padding: 8px;
  background: var(--btn-bg);
  border: 1px solid var(--border-red);
  border-radius: 8px;
  color: var(--text-main);
  cursor: pointer;
  font-size: 12px;
}
.tab.active { background: var(--border-red); color: white; }

.donate-btn {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 16px;
  padding: 14px;
  color: #00ff88;
  border-color: #00ff88;
  box-shadow: 0 0 12px #00ff88;
}

/* 🔒 ЖЁСТКОЕ скрытие кнопки Admin по умолчанию */
.admin-btn {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  left: -9999px !important;
}

/* Показываем ТОЛЬКО если JS добавил класс visible И user admin */
.admin-btn.visible.admin-verified {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: static !important;
  left: auto !important;
}

/* 🔒 Скрываем секцию админа по умолчанию */
#section-admin {
  display: none !important;
}

#section-admin.admin-visible {
  display: block !important;
}