:root {
  --bg: #0b1e10;
  --bg2: #102515;
  --bg3: #142918;
  --card: rgba(255,255,255,0.05);
  --card2: rgba(255,255,255,0.08);
  --card-border: rgba(255,255,255,0.08);
  --gold: #dff03e;
  --gold2: #ecf76a;
  --green: #3dd68c;
  --green2: #5ef0a8;
  --accent: #3dd68c;
  --text: #f2f8f4;
  --text2: #a8c6b6;
  --text3: #7a9c89;
  --white: #ffffff;
  --danger: #ff5a5a;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.35);
  --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.07);
}

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

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== INSTALL SCREEN ===== */
#install-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at top, #1a4a22 0%, #0b1e10 70%);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
}

.install-screen-inner {
  width: 100%;
  max-width: 440px;
  padding: 0 28px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.install-logo {
  font-size: 72px;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 24px rgba(212,168,67,0.4));
  animation: logoBounce 2s ease-in-out infinite;
}

@keyframes logoBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.install-app-name {
  font-size: 30px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.install-app-sub {
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 36px;
}

.install-desc {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 28px;
}

.install-screen-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--green) 0%, var(--gold) 100%);
  border: none;
  border-radius: 18px;
  padding: 18px;
  font-size: 17px;
  font-weight: 700;
  color: #0c1e0d;
  cursor: pointer;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(76,175,125,0.35);
  transition: transform 0.15s;
}

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

.install-skip {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 14px;
  width: 100%;
  font-size: 15px;
  color: var(--text2);
  cursor: pointer;
}

.install-steps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
  text-align: left;
}

.install-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 14px;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: #0c1e0d;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.step-icon { font-size: 18px; }

.install-arrow-hint {
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 20px;
  animation: pulse 1.5s ease-in-out infinite;
}

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at top, #1a4a22 0%, #0b1e10 60%);
}

.auth-logo {
  text-align: center;
  margin-bottom: 40px;
}

.auth-logo .emoji { font-size: 56px; display: block; margin-bottom: 12px; }

.auth-logo h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.5px;
}

.auth-logo p {
  font-size: 14px;
  color: var(--text2);
  margin-top: 6px;
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 100%;
  max-width: 400px;
  border: 1px solid rgba(223,240,62,0.15);
  box-shadow: var(--shadow);
}

.auth-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.auth-card .subtitle {
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 28px;
  line-height: 1.5;
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  width: 100%;
  background: var(--bg2);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus { border-color: var(--gold); }
.form-group input::placeholder { color: var(--text3); }

.btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 100%);
  color: #0c1e0d;
}

.btn-primary:active { transform: scale(0.98); opacity: 0.9; }

.btn-secondary {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.15);
  color: var(--text2);
  margin-top: 12px;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text3);
}

.auth-footer a { color: var(--gold); text-decoration: none; font-weight: 600; }

.error-msg {
  background: rgba(224,85,85,0.15);
  border: 1px solid rgba(224,85,85,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: #ff8080;
  margin-bottom: 16px;
  display: none;
}

.success-msg {
  background: rgba(76,175,125,0.15);
  border: 1px solid rgba(76,175,125,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--green2);
  margin-bottom: 16px;
  display: none;
}

/* ===== APP LAYOUT ===== */
.app { display: none; flex-direction: column; min-height: 100vh; }
.app.active { display: flex; }

/* Header */
.app-header {
  background: rgba(11,30,16,0.88);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  padding: max(12px, env(safe-area-inset-top)) 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo .emoji { font-size: 20px; }

.header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.2px;
}

.header-sub {
  font-size: 11px;
  color: var(--text3);
  font-weight: 400;
  margin-top: 1px;
}

.header-actions { display: flex; gap: 6px; align-items: center; }

#up-header-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(61,214,140,0.12);
  border: 1px solid rgba(61,214,140,0.25);
  border-radius: 20px;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.2s;
}
#up-header-chip:active { background: rgba(61,214,140,0.2); }
#up-header-icon { font-size: 13px; }
#up-header-timer { font-size: 13px; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; letter-spacing: 0.3px; }

.icon-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text2);
  font-size: 16px;
  transition: background 0.2s;
}

.icon-btn:active { background: rgba(255,255,255,0.1); }

/* Main content */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 140px;
}

/* UP bar — скрыт, трекер теперь в хедере */
#up-bar { display: none !important; }

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(11,30,16,0.94);
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  padding: 6px 8px max(16px, env(safe-area-inset-bottom));
  z-index: 100;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  gap: 4px;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  color: var(--text3);
  border-radius: 14px;
  position: relative;
}

.nav-item .nav-icon { font-size: 22px; transition: transform 0.2s; }
.nav-item .nav-label { font-size: 10px; font-weight: 600; letter-spacing: 0.2px; transition: color 0.2s; }

.nav-item.active {
  color: var(--green);
  background: rgba(61,214,140,0.08);
}
.nav-item.active .nav-icon { transform: scale(1.1); }
.nav-item.active .nav-label { color: var(--green); }

/* Подсветка вкладки «Чат» при новом сообщении */
.nav-item.chat-pulse .nav-icon { animation: chatPulse 0.6s ease 0 3; }
.nav-item.chat-pulse .nav-label { color: var(--green); }
@keyframes chatPulse {
  0%   { transform: scale(1);   filter: none; }
  35%  { transform: scale(1.35); filter: drop-shadow(0 0 6px rgba(61,214,140,0.9)); }
  100% { transform: scale(1);   filter: none; }
}

/* ===== СПИСОК ПОКУПОК (чек-лист) ===== */
.shop-row { display: flex; align-items: flex-start; gap: 11px; padding: 11px 2px; border-bottom: 1px solid rgba(255,255,255,0.07); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.shop-row:last-child { border-bottom: none; }
.shop-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #0b1e10; transition: all .15s; margin-top: 1px; }
.shop-tick { opacity: 0; }
.shop-text { font-size: 14.5px; line-height: 1.45; color: var(--text); }
.shop-row.shop-done .shop-dot { background: var(--gold); border-color: var(--gold); }
.shop-row.shop-done .shop-tick { opacity: 1; }
.shop-row.shop-done .shop-text { text-decoration: line-through; opacity: 0.45; }

/* ===== SCREENS ===== */
.screen { display: none; padding: 24px 20px; animation: screenIn 0.22s ease; max-width: 100%; overflow-x: hidden; }
.screen.active { display: block; }
#screen-chat { padding: 0; }
#screen-chat.active { display: block; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Messenger buttons */
.messengers-screen {
  padding: 32px 0 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.messengers-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.messengers-sub {
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 32px;
  line-height: 1.5;
}

.messenger-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  border: 1px solid rgba(255,255,255,0.08);
}

.messenger-btn:active { transform: scale(0.97); opacity: 0.85; }

.messenger-btn.telegram {
  background: linear-gradient(135deg, #1a3a5c 0%, #0f2a42 100%);
  border-color: rgba(41,182,246,0.25);
}

.messenger-btn.max {
  background: linear-gradient(135deg, #1f2a4a 0%, #141e38 100%);
  border-color: rgba(100,130,255,0.25);
}

/* UP Ring button в материалах */
.up-ring-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--glass);
  border: 1px solid rgba(61,214,140,0.2);
  border-radius: 20px;
  padding: 20px;
  margin: 20px 0;
  cursor: pointer;
  transition: transform 0.15s;
}
.up-ring-btn:active { transform: scale(0.97); }

.up-ring-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61,214,140,0.15) 0%, transparent 70%);
  border: 3px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 12px;
  box-shadow: 0 0 24px rgba(61,214,140,0.2);
  animation: ringPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(61,214,140,0.2); }
  50% { box-shadow: 0 0 36px rgba(61,214,140,0.4); }
}

.up-ring-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.up-ring-sub { font-size: 13px; color: var(--text2); text-align: center; line-height: 1.4; }

.messenger-icon { font-size: 32px; flex-shrink: 0; }

.messenger-info { flex: 1; }
.messenger-name { font-size: 17px; font-weight: 700; color: var(--text); }
.messenger-desc { font-size: 13px; color: var(--text2); margin-top: 2px; }

.messenger-arrow { font-size: 24px; color: var(--text3); }

.messengers-note {
  font-size: 12px;
  color: var(--text3);
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
}

/* Welcome banner */
.welcome-banner {
  background: linear-gradient(135deg, rgba(61,214,140,0.10) 0%, rgba(223,240,62,0.06) 60%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(61,214,140,0.18);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(223,240,62,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  left: -20px;
  bottom: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61,214,140,0.10) 0%, transparent 70%);
  pointer-events: none;
}

.welcome-banner .greeting {
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 6px;
}

.welcome-banner h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.welcome-banner p {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
}

/* Hero UP block on home */
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 0 36px;
  position: relative;
}

.home-hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61,214,140,0.12) 0%, rgba(223,240,62,0.06) 40%, transparent 70%);
  pointer-events: none;
}

.hero-greeting {
  font-size: 13px;
  color: var(--text3);
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
  text-align: center;
}

.hero-ring-wrap {
  position: relative;
  width: 210px;
  height: 210px;
  cursor: pointer;
  margin-bottom: 20px;
}

.hero-ring-wrap svg {
  transform: rotate(-90deg);
  width: 210px;
  height: 210px;
}

.hero-ring-bg { fill: none; stroke: rgba(255,255,255,0.10); stroke-width: 10; }
.hero-ring-fill {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.hero-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.hero-timer {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  line-height: 1;
}

.hero-timer-label {
  font-size: 11px;
  color: var(--text3);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.hero-phase {
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
  text-align: center;
  min-height: 18px;
}

.hero-start-btn {
  margin-top: 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border: none;
  border-radius: 50px;
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 800;
  color: #0c1e0d;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(223,240,62,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}

.hero-start-btn:active { transform: scale(0.96); box-shadow: none; }

/* Section grid */
.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 16px;
  margin-top: 8px;
}

.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

.card {
  background: var(--glass);
  border-radius: var(--radius);
  padding: 22px 16px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}

.card:active { transform: scale(0.96); opacity: 0.85; }

.card .card-icon { font-size: 30px; margin-bottom: 12px; display: block; }
.card .card-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; letter-spacing: -0.2px; }
.card .card-desc { font-size: 13.5px; color: var(--text2); line-height: 1.45; }

.card.card-wide { grid-column: span 2; display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.card.card-wide .card-icon { font-size: 28px; margin: 0; flex-shrink: 0; }
.card.card-wide .card-body { flex: 1; }

/* Эксперимент: анимированные иконки карточек */
.card-icon.ic-sprout {
  display: inline-block;
  transform-origin: 50% 95%;
  animation: icSprout 3.2s ease-in-out infinite;
}
@keyframes icSprout {
  0%, 100% { transform: rotate(-5deg) scale(1); }
  50%      { transform: rotate(5deg) scale(1.1); }
}
.card-icon.ic-pop {
  display: inline-block;
  animation: icPop 2.6s ease-in-out infinite;
}
@keyframes icPop {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 0 rgba(223,240,62,0)); }
  50%      { transform: translateY(-5px) scale(1.13); filter: drop-shadow(0 0 9px rgba(223,240,62,0.7)); }
}

.card.done { border-color: rgba(61,214,140,0.2); }
.card.done .card-desc { color: var(--green); }

/* Progress card with arc */
.progress-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
  border: 1px solid rgba(223,240,62,0.15);
  display: flex;
  align-items: center;
  gap: 20px;
}

.progress-arc-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.progress-arc-wrap svg {
  transform: rotate(-90deg);
  width: 80px;
  height: 80px;
}

.progress-arc-bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 7; }
.progress-arc-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}

.progress-arc-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.progress-arc-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.progress-arc-label {
  font-size: 9px;
  color: var(--text3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.progress-right { flex: 1; }

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-header h3 { font-size: 16px; font-weight: 800; }
.progress-header span { font-size: 13px; color: var(--gold); font-weight: 700; }

.progress-days {
  display: flex;
  justify-content: space-between;
}

.day-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.2s;
}

.day-dot.done { background: var(--green); color: var(--white); box-shadow: 0 0 10px rgba(61,214,140,0.3); }
.day-dot.current { background: var(--gold); color: #0c1e0d; box-shadow: 0 0 10px rgba(223,240,62,0.35); }

/* ===== MATERIALS SCREEN ===== */
.days-list { display: flex; flex-direction: column; gap: 16px; }

.day-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.day-card:active { transform: scale(0.98); }

.day-card.current { border-color: rgba(212,168,67,0.4); }

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

.day-number {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.day-number span { font-size: 22px; font-weight: 800; color: var(--text2); }
.day-card.current .day-number { background: linear-gradient(135deg, var(--gold), var(--gold2)); }
.day-card.current .day-number span { color: #0c1e0d; }
.day-card.done .day-number { background: rgba(61,214,140,0.15); border: 1.5px solid rgba(61,214,140,0.3); }

.day-info { flex: 1; }
.day-info h3 { font-size: 17px; font-weight: 700; margin-bottom: 5px; }
.day-info p { font-size: 13px; color: var(--text2); }

.day-arrow { color: var(--text3); font-size: 18px; }

.day-tags {
  display: flex;
  gap: 8px;
  padding: 0 18px 14px;
  flex-wrap: wrap;
}

.tag {
  background: rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== DAY DETAIL ===== */
.day-detail { display: none; }
.day-detail.active { display: block; }

.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.back-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
  flex-shrink: 0;
}

.detail-header h2 { font-size: 20px; font-weight: 800; }
.detail-header p { font-size: 13px; color: var(--text2); margin-top: 2px; }

.content-block {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.06);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.content-block p, .content-block li, .content-block h4 {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.content-block a { word-break: break-all; }

/* ===== ПОЛОСА ПРОГРЕССА ПУТИ ===== */
.path-progress {
  background: linear-gradient(135deg, rgba(61,214,140,0.12), rgba(223,240,62,0.05));
  border: 1px solid rgba(61,214,140,0.28);
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 4px;
}
.path-progress-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}
.path-progress-label {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* «день N из 8» — отдельным аккуратным чипом под заголовком, без наложения */
.path-progress-count {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  background: rgba(61,214,140,0.14);
  border: 1px solid rgba(61,214,140,0.32);
  border-radius: 20px;
  padding: 3px 11px;
  white-space: nowrap;
}
.path-progress-track {
  height: 10px;
  background: rgba(255,255,255,0.09);
  border-radius: 6px;
  overflow: hidden;
}
.path-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3dd68c, #dff03e);
  border-radius: 6px;
  transition: width 0.6s ease;
}
.path-progress-sub { font-size: 13px; color: var(--text2); margin-top: 9px; line-height: 1.5; }

/* точки кругов */
.cycle-dots { display: flex; gap: 8px; margin: 4px 0 10px; }
.cycle-dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
}
.cycle-dot-done   { background: var(--green); color: #0b1e10; }
.cycle-dot-active { background: rgba(223,240,62,0.18); color: var(--gold); border: 2px solid var(--gold); }
.cycle-dot-todo   { background: rgba(255,255,255,0.07); color: var(--text3); }
.cycle-btn {
  width: 100%;
  margin-top: 14px;
  background: linear-gradient(135deg, #2a6b42, #4caf7d);
  border: none; border-radius: 14px;
  padding: 14px; color: #fff; font-size: 15px; font-weight: 700;
  cursor: pointer;
}

/* ===== ШАГИ ДНЯ (аккордеон) ===== */
.step-card {
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  margin-bottom: 12px;
  overflow: hidden;
}
.step-card.open {
  border-color: rgba(61,214,140,0.35);
  background: rgba(61,214,140,0.05);
}
.step-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 15.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.35;
}
.step-ic { font-size: 24px; flex-shrink: 0; }
.step-title { flex: 1; }
.step-chev {
  flex-shrink: 0;
  color: var(--green);
  font-size: 20px;
  transition: transform 0.3s ease;
}
.step-card.open .step-chev { transform: rotate(180deg); }
.step-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  padding: 0 12px;
}
.step-card.open .step-body {
  max-height: 14000px;
  padding-bottom: 6px;
}
/* внутри шага у материалов поля поменьше */
.step-body .content-block { margin-bottom: 10px; }

.content-block h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.content-block p {
  font-size: 16px;
  color: var(--text);
  line-height: 1.75;
}

.content-block ul {
  list-style: none;
  padding: 0;
}

.content-block ul li {
  font-size: 15px;
  color: var(--text);
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  line-height: 1.5;
  display: flex;
  gap: 10px;
}

.content-block ul li:last-child { border-bottom: none; }
.content-block ul li::before { content: '•'; color: var(--gold); flex-shrink: 0; }

/* Audio player */
.audio-item {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.audio-item:last-child { margin-bottom: 0; }

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  color: #0c1e0d;
  transition: transform 0.2s;
}

.play-btn:active { transform: scale(0.93); }

.audio-info { flex: 1; }
.audio-info .audio-title { font-size: 14px; font-weight: 600; color: var(--text); }
.audio-info .audio-dur { font-size: 12px; color: var(--text3); margin-top: 2px; }

.audio-wave {
  display: flex;
  gap: 2px;
  align-items: center;
  height: 24px;
}

.wave-bar {
  width: 3px;
  background: var(--text3);
  border-radius: 2px;
  animation: none;
}

/* ===== SCHEDULE SCREEN ===== */
.schedule-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.schedule-time {
  background: rgba(223,240,62,0.1);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  text-align: center;
  flex-shrink: 0;
  min-width: 60px;
}

.schedule-time .time { font-size: 16px; font-weight: 800; color: var(--gold); }
.schedule-time .period { font-size: 10px; color: var(--text3); text-transform: uppercase; }

.schedule-info h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.schedule-info p { font-size: 13px; color: var(--text2); line-height: 1.5; }

/* ===== RULES SCREEN ===== */
.rules-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  gap: 16px;
}

.rule-num {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #0c1e0d;
  flex-shrink: 0;
}

.rule-body h4 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.rule-body p { font-size: 14px; color: var(--text2); line-height: 1.6; }

/* ===== CHAT SCREEN ===== */

/* Чат — фиксированный слой между хедером и нав-баром */
#screen-chat {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  top: 56px;   /* JS уточнит при открытии */
  bottom: 56px;
  background: var(--bg);
  z-index: 50;
  flex-direction: column;
  overflow: hidden;
  /* Нет анимации — убирает рывок */
  will-change: contents;
}
#screen-chat.active {
  display: flex;
}

/* Запрет зума двойным тапом в чате */
#screen-chat * {
  touch-action: pan-x pan-y;
}

/* верхняя строка с именем чата и онлайн */
.chat-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top, 12px)) 16px 10px;
  background: rgba(11,30,16,0.95);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.chat-bar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.chat-bar-online {
  font-size: 11px;
  color: var(--green);
  font-weight: 500;
  margin-top: 2px;
}
.notif-icon-btn {
  font-size: 17px;
}
.notif-icon-btn.active {
  background: rgba(223,240,62,0.12);
  border-color: rgba(223,240,62,0.25);
}

/* список сообщений */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  /* overflow-anchor: auto — Chrome автоматически держит скролл снизу */
  overflow-anchor: auto;
}
/* Якорный элемент в конце списка — браузер держит скролл у него */
.chat-scroll-anchor {
  overflow-anchor: auto;
  height: 1px;
  flex-shrink: 0;
}

/* Кнопка «вниз» — появляется когда не у низа чата */
.chat-scroll-btn {
  position: absolute;
  right: 14px;
  bottom: 84px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card2, #16301f);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--green, #3dd68c);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
}
.chat-scroll-btn.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.chat-scroll-badge {
  position: absolute;
  top: -5px;
  right: -3px;
  background: #ff4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
  line-height: 16px;
}
/* Разделитель «непрочитанные» */
.chat-unread-divider {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--green, #3dd68c);
  padding: 6px 0;
  margin: 4px 0;
  border-top: 1px solid rgba(61,214,140,0.25);
  position: relative;
}


/* поле ввода */
.chat-input-bar {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 14px 12px;
  background: rgba(11,30,16,0.97);
  border-top: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* Индикатор «печатает…» — скромная серая курсивная строка над полем ввода.
   Высота зарезервирована всегда, чтобы появление текста не дёргало layout. */
.chat-typing {
  flex-shrink: 0;
  height: 18px;
  line-height: 18px;
  padding: 0 18px;
  font-size: 12.5px;
  font-style: italic;
  color: var(--text3);
  background: rgba(11,30,16,0.97);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none;
}
.chat-typing.is-on { opacity: 1; }

.chat-textarea {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.09);
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  resize: none;
  font-family: inherit;
  line-height: 1.45;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.2s;
  -webkit-overflow-scrolling: touch;
}
.chat-textarea:focus { border-color: rgba(223,240,62,0.3); }
.chat-textarea::placeholder { color: var(--text3); }


.chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  color: #0c1e0d;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s;
}
.chat-send-btn:active { transform: scale(0.9); opacity: 0.8; }

/* ===== Кнопки медиа в чате (фото / голос) ===== */
.chat-attach-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.09);
  color: var(--gold); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform 0.15s, opacity 0.15s;
}
.chat-attach-btn:active { transform: scale(0.9); opacity: 0.8; }

.chat-voice-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--gold); border: none;
  font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform 0.15s;
  -webkit-user-select: none; user-select: none;
}
.chat-voice-btn:active { transform: scale(0.92); }
.chat-voice-btn.recording {
  background: #ff4d4d;
  animation: voicePulse 1s infinite;
}
@keyframes voicePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,77,77,0.5); }
  50% { box-shadow: 0 0 0 12px rgba(255,77,77,0); }
}

.media-preview {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(11,30,16,0.97);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.media-preview-img {
  width: 56px; height: 56px; object-fit: cover;
  border-radius: 10px; border: 1.5px solid rgba(223,240,62,0.4);
}
.media-preview-audio {
  flex: 1; color: var(--gold); font-size: 14px; font-weight: 600;
}
.media-preview-cancel {
  margin-left: auto;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none;
  color: var(--text); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.recording-indicator {
  flex-shrink: 0;
  padding: 9px 16px;
  background: rgba(255,77,77,0.15);
  color: #ff8a8a; font-size: 13px; font-weight: 600;
  text-align: center;
}

/* ===== CHATS LIST (старый стиль, оставляем на случай) ===== */
.chat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.chat-card:active { transform: scale(0.97); }

.chat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.chat-icon.tg { background: rgba(36,161,222,0.15); }
.chat-icon.max { background: rgba(212,168,67,0.12); }

.chat-info { flex: 1; }
.chat-info h4 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.chat-info p { font-size: 13px; color: var(--text2); }

.chat-arrow { color: var(--text3); font-size: 18px; }

/* ===== ADMIN ===== */
.admin-page {
  min-height: 100vh;
  background: var(--bg);
  padding: 20px;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.admin-header h1 { font-size: 22px; font-weight: 800; color: var(--gold); }

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

.stat-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.06);
}

.stat-card .stat-num { font-size: 24px; font-weight: 800; color: var(--gold); }
.stat-card .stat-label { font-size: 11px; color: var(--text3); margin-top: 4px; }

.member-list { display: flex; flex-direction: column; gap: 10px; }

.member-item {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255,255,255,0.06);
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #0c1e0d;
  flex-shrink: 0;
}

.member-info { flex: 1; min-width: 0; }
.member-info .name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-info .email { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-info .expiry { font-size: 11px; color: var(--text3); margin-top: 2px; }

.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.status-badge.active { background: rgba(76,175,125,0.2); color: var(--green2); }
.status-badge.expired { background: rgba(224,85,85,0.15); color: #ff8080; }

.block-btn {
  background: rgba(224,85,85,0.12);
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #ff8080;
  cursor: pointer;
  flex-shrink: 0;
}

.add-member-form {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(223,240,62,0.2);
}

.add-member-form h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--gold); }

.form-row { display: flex; gap: 10px; }
.form-row input { flex: 1; }
.form-row .btn { width: auto; padding: 14px 20px; flex-shrink: 0; font-size: 14px; }

/* ===== LOADER ===== */
.loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, #15351f 0%, var(--bg) 60%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.loader.loader-hide { opacity: 0; }

/* Вспышка свечения за лимоном при «включении» */
.loader::before {
  content: '';
  position: absolute;
  top: 42%;
  left: 50%;
  width: 280px;
  height: 280px;
  transform: translate(-50%, -50%) scale(0.2);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61,214,140,0.45) 0%, rgba(223,240,62,0.18) 35%, rgba(61,214,140,0) 70%);
  animation: glowBurst 1.7s ease-out both;
  pointer-events: none;
}

.loader .emoji {
  font-size: 78px;
  position: relative;
  animation: lemonPowerOn 1.7s cubic-bezier(0.2,0.7,0.2,1) both;
}
.loader p {
  color: var(--text2);
  margin-top: 18px;
  font-size: 15px;
  animation: fadeInSoft 0.7s ease 0.55s both;
}

/* Лимон загорается: тусклый и маленький → яркий со свечением */
@keyframes lemonPowerOn {
  0%   { transform: scale(0.35); opacity: 0; filter: brightness(0.25) drop-shadow(0 0 0 rgba(61,214,140,0)); }
  38%  { transform: scale(1.2);  opacity: 1; filter: brightness(1.7) drop-shadow(0 0 34px rgba(223,240,62,0.95)); }
  62%  { transform: scale(0.96); filter: brightness(1.15) drop-shadow(0 0 20px rgba(61,214,140,0.6)); }
  100% { transform: scale(1);    opacity: 1; filter: brightness(1) drop-shadow(0 0 14px rgba(61,214,140,0.5)); }
}
@keyframes glowBurst {
  0%   { transform: translate(-50%,-50%) scale(0.2); opacity: 0; }
  38%  { transform: translate(-50%,-50%) scale(1);   opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(1.7); opacity: 0; }
}
@keyframes fadeInSoft {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

/* ===== UTILS ===== */
.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.text-center { text-align: center; }

/* Install banner */
.install-banner {
  background: linear-gradient(135deg, rgba(223,240,62,0.12), rgba(61,214,140,0.08));
  border: 1px solid rgba(223,240,62,0.25);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-banner .install-text { flex: 1; }
.install-banner .install-text h4 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.install-banner .install-text p { font-size: 12px; color: var(--text2); }

.install-btn {
  background: var(--gold);
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #0c1e0d;
  cursor: pointer;
  flex-shrink: 0;
}

.close-banner {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
}

@media (max-width: 380px) {
  .cards-grid { grid-template-columns: 1fr; }
  .card.card-wide { grid-column: span 1; }
}

/* ===== CHAT MESSAGE BUBBLES ===== */
.msg-bubble {
  max-width: min(78%, 320px);
  min-width: 64px;
  padding: 10px 14px;
  font-size: 15px;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow: hidden;
  /* Запрет выделения текста */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.msg-bubble.msg-me {
  background: var(--gold);
  color: #0d1f17;
  border-radius: 18px 18px 4px 18px;
}
.msg-bubble.msg-other {
  background: rgba(255,255,255,0.09);
  color: var(--text);
  border-radius: 18px 18px 18px 4px;
  border: 1px solid rgba(255,255,255,0.07);
}

/* ===== ACTION SHEET (долгое нажатие на сообщение) ===== */
.msg-action-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  flex-direction: column;
  justify-content: flex-end;
}
.msg-action-sheet.visible { display: flex; }
.msg-action-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}
.msg-action-menu {
  position: relative;
  background: #1a3020;
  border-radius: 20px 20px 0 0;
  padding: 8px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.msg-action-menu-handle {
  width: 40px; height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: 8px auto 14px;
}
.msg-action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 14px;
  background: none;
  border: none;
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.msg-action-btn:active { background: rgba(255,255,255,0.07); }
.msg-action-btn.danger { color: #ff6b6b; }
.msg-action-btn .act-icon { font-size: 20px; width: 28px; text-align: center; }
.msg-action-separator {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 4px 0;
}

/* ===== PINNED MESSAGE BANNER ===== */
.pin-banner {
  display: none;
  align-items: center;
  padding: 10px 14px;
  background: rgba(223,240,62,0.06);
  border-bottom: 1px solid rgba(223,240,62,0.15);
  gap: 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.pin-banner.visible { display: flex; }
.pin-line {
  width: 3px;
  height: 36px;
  background: var(--gold);
  border-radius: 2px;
  flex-shrink: 0;
}
.pin-info { flex: 1; min-width: 0; }
.pin-label { font-size: 11px; color: var(--gold); font-weight: 700; margin-bottom: 2px; }
.pin-msg-preview {
  font-size: 13px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pin-close-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 18px;
  padding: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Голосовой плеер */
.voice-player {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 200px;
}
.voice-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  border: none;
  color: inherit;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.msg-me .voice-play-btn { background: rgba(0,0,0,0.15); }
.voice-play-btn:active { background: rgba(0,0,0,0.35); }
.voice-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  height: 28px;
}
.vw-bar {
  width: 3px;
  flex: 1;
  background: currentColor;
  opacity: 0.45;
  border-radius: 2px;
  transform-origin: bottom;
  transition: transform 0.08s;
  height: 100%;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

@keyframes pop {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== CLUB STATS (главная) ===== */
.club-stats {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 16px 20px;
  margin: 0 0 4px;
}
.club-stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.club-stat-icon { font-size: 22px; }
.club-stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.1;
}
.club-stat-label {
  font-size: 11px;
  color: var(--text3);
  margin-top: 1px;
}
.club-stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  margin: 0 16px;
}

/* ===== REPLY BAR ===== */
.reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(11,30,16,0.97);
  border-top: 1px solid rgba(223,240,62,0.15);
  flex-shrink: 0;
}
.reply-bar-line {
  width: 3px;
  height: 32px;
  background: var(--gold);
  border-radius: 2px;
  flex-shrink: 0;
}
.reply-bar-content { flex: 1; min-width: 0; }
.reply-bar-to {
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 2px;
}
.reply-bar-preview {
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-cancel-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 18px;
  padding: 4px 6px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ===== REPLY QUOTE внутри пузырька ===== */
.msg-reply-quote {
  background: rgba(0,0,0,0.15);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 5px 8px;
  margin-bottom: 6px;
  cursor: pointer;
}
.msg-me .msg-reply-quote {
  background: rgba(0,0,0,0.12);
  border-color: rgba(13,31,23,0.5);
}
.msg-reply-user {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 2px;
}
.msg-me .msg-reply-user { color: rgba(13,31,23,0.7); }
.msg-reply-text {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-me .msg-reply-text { color: rgba(13,31,23,0.55); }

/* ===== AVATAR в чате ===== */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}
.msg-row.me { flex-direction: row-reverse; }
.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
}
.msg-avatar-placeholder {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(223,240,62,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

/* ===== AVATAR MODAL ===== */
.avatar-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  touch-action: none;
}
.avatar-modal-card {
  background: #1a3020;
  border-radius: 24px;
  padding: 30px 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
}
.avatar-modal-emoji { font-size: 40px; margin-bottom: 12px; }
.avatar-modal-title { font-size: 20px; font-weight: 800; margin: 0 0 8px; color: var(--text); }
.avatar-modal-sub { font-size: 13px; color: var(--text3); margin: 0 0 20px; }
.avatar-preview-wrap {
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 3px dashed rgba(223,240,62,0.4);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
}
.avatar-preview-wrap img { width: 100%; height: 100%; object-fit: cover; }
.avatar-choose-btn {
  width: 100%;
  background: rgba(223,240,62,0.1);
  border: 1px solid rgba(223,240,62,0.3);
  border-radius: 12px;
  padding: 13px;
  color: var(--gold);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
}
.avatar-save-btn {
  width: 100%;
  background: var(--gold);
  border: none;
  border-radius: 12px;
  padding: 13px;
  color: #0c1e0d;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 10px;
}
.avatar-skip-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 13px;
  padding: 8px;
  cursor: pointer;
  width: 100%;
}

/* ===== МОЙ АВАТАР В ШАПКЕ ЧАТА ===== */
.my-avatar-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(223,240,62,0.4);
  background: rgba(223,240,62,0.1);
  overflow: hidden;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  padding: 0;
}
.my-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
