:root {
  --bg: var(--tg-theme-bg-color, #0f1115);
  --text: var(--tg-theme-text-color, #f4f4f5);
  --hint: var(--tg-theme-hint-color, #8b8f9a);
  --accent: var(--tg-theme-button-color, #d4af37);
  --accent-text: var(--tg-theme-button-text-color, #0f1115);
  --card-bg: #1a1d24;
  --border: #2a2e38;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app { max-width: 640px; margin: 0 auto; padding: 0 16px 80px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  max-width: 640px;
  margin: 0 auto;
  z-index: 10;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--hint);
  font-size: 11px;
  padding: 12px 4px;
  cursor: pointer;
}
.tab-btn.active { color: var(--accent); font-weight: 600; }

.hero {
  text-align: center;
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
}

.suits { font-size: 22px; letter-spacing: 12px; margin-bottom: 12px; opacity: 0.8; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 8px;
}

.hero h1 { font-size: 28px; margin: 0 0 12px; }

.lead { color: var(--hint); line-height: 1.5; margin: 0 auto 20px; max-width: 480px; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-stats div { display: flex; flex-direction: column; gap: 2px; }
.hero-stats .label { font-size: 11px; text-transform: uppercase; color: var(--hint); }
.hero-stats .value { font-size: 14px; font-weight: 600; }

.section { padding: 28px 0; border-bottom: 1px solid var(--border); }
.section h2 { font-size: 20px; margin: 0 0 4px; }
.section-lead { color: var(--hint); margin: 0 0 16px; font-size: 14px; }

.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.info-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.info-card h3 { font-size: 14px; margin: 0 0 6px; }
.info-card p { font-size: 12px; color: var(--hint); margin: 0; line-height: 1.4; }

.events-list { display: flex; flex-direction: column; gap: 12px; }

.event-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.event-tags { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.tag {
  font-size: 10px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent);
  font-weight: 600;
}

.event-card h3 { margin: 0 0 6px; font-size: 15px; }
.event-card .event-desc { color: var(--hint); font-size: 12px; margin: 0 0 10px; }
.event-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--hint); margin-bottom: 12px; }

.register-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.register-btn:disabled { background: var(--border); color: var(--hint); cursor: default; }

.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
}
.profile-card .name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.profile-card .rating { color: var(--accent); font-weight: 600; }
.profile-card .my-events { margin-top: 12px; font-size: 12px; color: var(--hint); }

.leaderboard-title { font-size: 14px; margin: 0 0 10px; color: var(--hint); text-transform: uppercase; letter-spacing: 1px; }
.leaderboard-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.leaderboard-list li {
  display: flex;
  justify-content: space-between;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

.contacts { text-align: center; border-bottom: none; }
.muted { color: var(--hint); font-size: 13px; }

.pill-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.pill {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--hint);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pill.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.search-input {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 14px;
}

.day-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.day-chip {
  white-space: nowrap;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.day-heading {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--hint);
  margin: 20px 0 10px;
}
.day-group:first-child .day-heading { margin-top: 0; }

.article-card { margin-bottom: 12px; }
.article-content { white-space: pre-line; line-height: 1.5; }

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 20px;
}
.admin-form input,
.admin-form textarea {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
