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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  min-height: 100vh;
}

/* ── Landing ─────────────────────────────────────────────────── */
.container {
  text-align: center;
  padding: 40px 24px 24px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.logo {
  width: 72px;
  height: 72px;
  background: #0088cc;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 0 36px rgba(0, 136, 204, 0.35);
}

.logo svg {
  width: 40px;
  height: 40px;
  fill: #fff;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 10px;
}

p.subtitle {
  color: #8892b0;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 28px;
}

/* ── Click Counter ───────────────────────────────────────────── */
.counter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  justify-content: center;
}

.counter-item {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 14px 24px;
  text-align: center;
  min-width: 130px;
}

.counter-item.ru {
  border: 1px solid rgba(255,255,255,0.12);
}

.counter-num {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #0088cc;
}

.counter-item.ru .counter-num {
  color: #ff4d4d;
}

.counter-label {
  font-size: 12px;
  color: #8892b0;
}

/* ── Categories ──────────────────────────────────────────────── */
.categories {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.cat-card.primary {
  background: rgba(0, 136, 204, 0.1);
  border-color: rgba(0, 136, 204, 0.3);
  order: -1;
}

.cat-card:hover {
  background: rgba(255,255,255,0.07);
}

.cat-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.cat-info {
  flex: 1;
  min-width: 0;
}

.cat-label {
  font-size: 16px;
  font-weight: 600;
}

.cat-card.primary .cat-label {
  color: #0088cc;
}

.cat-desc {
  font-size: 13px;
  color: #8892b0;
  margin-top: 2px;
}

.btn-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0088cc;
  color: #fff;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  flex-shrink: 0;
  fill: #fff;
}

.btn-go:hover {
  background: #0099e6;
  box-shadow: 0 4px 16px rgba(0, 136, 204, 0.35);
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 20px 0 32px;
}

.footer a {
  color: #4a5568;
  font-size: 13px;
  text-decoration: none;
}

.footer a:hover {
  color: #8892b0;
}

/* ── Admin wrapper ───────────────────────────────────────────── */
.admin-wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 32px 20px 20px;
}

.admin-box {
  max-width: 420px;
  margin: 0 auto;
}

.admin-box h2 {
  font-size: 22px;
  margin-bottom: 24px;
  text-align: center;
}

.back-link {
  display: block;
  text-align: center;
  margin-top: 8px;
  margin-bottom: 32px;
  color: #4a5568;
  font-size: 14px;
  text-decoration: none;
}

.back-link:hover { color: #8892b0; }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 4px;
}

.tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  color: #8892b0;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active {
  background: #0088cc;
  color: #fff;
}

.tab:hover:not(.active) {
  color: #ccc;
}

.tab-content h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8892b0;
  margin: 20px 0 12px;
}

/* ── Category edit rows ──────────────────────────────────────── */
.cat-edit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.cat-edit-info {
  flex: 1;
  min-width: 180px;
  font-size: 14px;
  line-height: 1.5;
}

.cat-edit-icon {
  font-size: 22px;
  margin-right: 8px;
  vertical-align: middle;
}

.cat-edit-info code {
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #aab;
}

.badge {
  background: #0088cc;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

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

.bot-input {
  width: 120px;
}

.input-sm, .input-xs {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #2a2a4a;
  background: #111128;
  color: #fff;
  font-size: 14px;
  outline: none;
}

.input-sm:focus, .input-xs:focus {
  border-color: #0088cc;
}

.input-xs { width: 56px; }

.btn-sm {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.btn-save {
  background: #0088cc;
  color: #fff;
}

.btn-del {
  background: rgba(255,77,77,0.15);
  color: #ff4d4d;
}

.form-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

/* ── Stats ───────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.stat-card {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
}

.stat-card.ru { border: 1px solid rgba(255,77,77,0.25); }

.stat-num {
  font-size: 26px;
  font-weight: 700;
  color: #0088cc;
}

.stat-card.ru .stat-num { color: #ff4d4d; }

.stat-label {
  font-size: 12px;
  color: #8892b0;
  margin-top: 4px;
}

.bar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 14px;
}

.bar-label { color: #ccc; }
.bar-val { font-weight: 600; color: #0088cc; }

.muted { color: #8892b0; font-size: 13px; padding: 8px 0; }

/* ── Shared ──────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: #8892b0;
  margin-bottom: 6px;
  text-align: left;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #2a2a4a;
  background: #111128;
  color: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: #0088cc;
}

.btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: #0088cc;
  color: #fff;
}

.btn-primary:hover { background: #0099e6; }

.btn-secondary {
  background: #1e1e3a;
  color: #8892b0;
  margin-top: 12px;
}

.btn-secondary:hover { background: #2a2a4a; }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-error {
  background: rgba(255, 77, 77, 0.15);
  color: #ff4d4d;
  border: 1px solid rgba(255, 77, 77, 0.3);
}

.alert-success {
  background: rgba(0, 204, 136, 0.15);
  color: #00cc88;
  border: 1px solid rgba(0, 204, 136, 0.3);
}

.hidden { display: none !important; }

@media (max-width: 500px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .counter-bar { flex-direction: column; align-items: center; }
  .cat-edit-row { flex-direction: column; align-items: stretch; }
  .cat-edit-actions { flex-wrap: wrap; }
}
