:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #17202a;
  --muted: #5b6572;
  --border: #e3e8ee;
  --accent: #2563eb;
  --accent2: #1d4ed8;
  --danger: #d64545;
  --header-bg: rgba(255, 255, 255, 0.85);
}
html.dark {
  --bg: #10151c;
  --card: #1a2230;
  --text: #e6ebf2;
  --muted: #93a0b4;
  --border: rgba(255, 255, 255, 0.1);
  --header-bg: rgba(16, 21, 28, 0.85);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.container { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 28px; padding-bottom: 40px; }

/* Шапка */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 16px;
}
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 6px 12px; border-radius: 8px; font-size: 14px;
  color: var(--muted); text-decoration: none;
}
.nav a:hover { background: rgba(127,127,127,0.12); color: var(--text); }
.nav a.active { background: var(--accent); color: #fff; }
.header-side { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px; font-size: 12px;
  background: rgba(127,127,127,0.12); color: var(--muted); white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-loading { background: #9aa3ad; animation: pulse 1.2s infinite; }
.dot-on { background: #34a853; }
.dot-off { background: #d64545; }
@keyframes pulse { 50% { opacity: 0.4; } }

/* Кнопки и карточки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: rgba(127,127,127,0.12); }
.btn-danger { background: transparent; border-color: var(--border); color: var(--danger); }
.btn-icon { padding: 6px 10px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
  box-shadow: 0 1px 2px rgba(16, 21, 28, 0.05);
}
.muted { color: var(--muted); }
.mono {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  background: rgba(127,127,127,0.12); padding: 8px 12px; border-radius: 8px;
}
.flash {
  margin-bottom: 16px; padding: 12px 16px; border-radius: 10px;
  background: rgba(37,99,235, 0.12); border: 1px solid rgba(37,99,235,.35);
  color: var(--accent); font-size: 14px;
}
.flash-error { background: rgba(214,69,69,.1); border-color: rgba(214,69,69,.35); color: var(--danger); }

/* Hero */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; margin-bottom: 40px; }
.hero h1 { font-size: 38px; margin: 0 0 12px; line-height: 1.15; }
.hero p { color: var(--muted); margin: 0 0 20px; font-size: 16px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-art { min-height: 240px; border-radius: 16px; overflow: hidden; position: relative; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
.hero-art.placeholder {
  background:
    linear-gradient(135deg, rgba(37,99,235,.85), rgba(29,78,216,.65)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 16px, transparent 16px 32px);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 56px;
}

/* Блоки главной */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.status-card .ip-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-top: 8px; }

/* Вкладки */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn {
  padding: 9px 16px; border: none; background: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.rules-body { white-space: pre-line; line-height: 1.7; color: var(--text); }

/* Магазин */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.product { overflow: hidden; padding: 0; display: flex; flex-direction: column; position: relative; }
.product-img { height: 150px; background: linear-gradient(135deg, rgba(37,99,235,.2), rgba(29,78,216,.2)); display: flex; align-items: center; justify-content: center; font-size: 44px; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: #e8a020; color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px;
}
.product-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-body h3 { margin: 0; font-size: 16px; }
.product-body .desc { color: var(--muted); font-size: 13px; flex: 1; }
.product-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.price { font-size: 18px; font-weight: 800; color: var(--accent); }
html.dark .price { color: var(--accent2); }

/* Прогресс-бары сборов */
.goal { margin-bottom: 20px; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 10px; flex-wrap: wrap; }
.goal-head h3 { margin: 0; font-size: 16px; }
.progress { height: 16px; background: rgba(127,127,127,0.18); border-radius: 999px; overflow: hidden; }
.progress > div {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .5s;
}
.goal-meta { font-size: 13px; color: var(--muted); margin-top: 6px; text-align: right; }

/* Формы */
.field { margin-bottom: 14px; }
.label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 5px; }
.input, .textarea, select.input {
  width: 100%; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none;
}
.input:focus, .textarea:focus { border-color: var(--accent); }
.textarea { min-height: 140px; resize: vertical; }

/* Таблицы в админке */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.table .num { text-align: right; }
.table input[type=text], .table input[type=number] { width: 100%; min-width: 80px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pill-pending { background: rgba(232,160,32,.15); color: #b07608; }
.pill-confirmed { background: rgba(37,99,235,.15); color: var(--accent); }
.pill-rejected { background: rgba(214,69,69,.12); color: var(--danger); }

.login-box { max-width: 360px; margin: 60px auto; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0; text-align: center; font-size: 12px; color: var(--muted);
}

/* Лаунчер */
.logo-cw { font-size: 12px; font-weight: 800; letter-spacing: .5px; }
.launcher-icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 88px; height: 88px; border-radius: 20px; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-size: 30px; font-weight: 800; letter-spacing: 1px;
  box-shadow: 0 6px 18px rgba(37,99,235,.35);
}
.grass-block {
  position: absolute; right: -6px; bottom: -6px; width: 30px; height: 30px;
  border-radius: 6px; border: 3px solid var(--card);
  background: linear-gradient(180deg, #6abe30 0 55%, #8a5a2b 55% 100%);
}
.launcher-sub { font-size: 18px; font-weight: 600; color: var(--text); margin: -8px 0 12px !important; }
.btn-lg { padding: 13px 26px; font-size: 16px; }
.launcher-shot {
  min-height: 260px; display: flex; align-items: center; justify-content: center;
  border-style: dashed; border-width: 2px; font-size: 15px;
  max-width: 560px; justify-self: end; width: 100%;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  margin-bottom: 20px;
}
.feature {
  text-align: left;
  padding: 20px 16px;
  border-radius: 12px;
  min-width: 0;
}
.feature-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 19px; margin-bottom: 12px;
}
.feature h3 { margin: 0 0 6px; font-size: 15px; line-height: 1.3; }
.feature p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }
@media (max-width: 980px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

.steps { margin: 0 0 14px; padding-left: 20px; line-height: 2; }
.hint {
  padding: 12px 14px; border-radius: 10px; font-size: 13px;
  background: rgba(37,99,235,.1); border: 1px solid rgba(37,99,235,.25);
  color: var(--text);
}
.faq { border-bottom: 1px solid var(--border); padding: 10px 0; }
.faq:last-child { border-bottom: none; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.faq summary::marker { color: var(--accent); }
.faq p { margin: 8px 0 4px; font-size: 14px; color: var(--muted); }

/* Реквизиты на странице сборов */
.req-card { margin-bottom: 22px; border-left: 4px solid var(--accent); }
.req-list { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.req-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.req-row dt { color: var(--muted); font-size: 13px; }
.req-row dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.req-note { margin: 12px 0 0; font-size: 13px; }
.copy-toast {
  display: none; font-size: 12px; font-weight: 600; color: var(--accent);
  animation: toast-in .25s;
}
.copy-toast.show { display: inline; }
@keyframes toast-in { from { opacity: 0; transform: translateY(4px); } }

/* Страница FAQ */
.faq-item { margin-bottom: 10px; padding: 14px 18px; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item summary::marker { color: var(--accent); }
.faq-item p { margin: 10px 0 0; color: var(--muted); line-height: 1.6; }

.support-card { margin-top: 26px; border-top: 4px solid #5865f2; }
.support-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.support-hours { margin: 6px 0 0; font-size: 13px; color: var(--accent); font-weight: 600; }
.support-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 12px; font-size: 24px;
  background: #5865f2; color: #fff;
}
.topic-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer;
}
.chip:hover { border-color: #5865f2; color: #5865f2; }
.chip.active { background: #5865f2; border-color: #5865f2; color: #fff; }
.chip-hint {
  margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 13px;
  background: rgba(88,101,242,.1); border: 1px solid rgba(88,101,242,.3);
}

/* Форма товара в админке + live preview + кроп */
.editor-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; align-items: start; }
.preview-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 8px; }

.crop-modal {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(0,0,0,.65); align-items: center; justify-content: center; padding: 16px;
}
.crop-modal.open { display: flex; }
.crop-box {
  background: var(--card); border-radius: 14px; padding: 18px; width: 100%; max-width: 560px;
}
.crop-stage {
  position: relative; width: 100%; aspect-ratio: 8 / 5; overflow: hidden;
  border-radius: 10px; background: #111; touch-action: none; cursor: grab;
}
.crop-stage img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; }
.crop-controls { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.crop-controls input[type=range] { flex: 1; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .grid-2 { grid-template-columns: 1fr; }
  .status-badge { display: none; }
}

.faq-edit { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px dashed var(--border); }
.faq-edit:last-of-type { border-bottom: none; }

.launcher-preview {
  max-width: 540px; width: 100%; margin: 0 auto;
}
.launcher-preview img {
  width: 100%; height: auto; max-height: 320px;
  object-fit: contain; display: block;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
  image-rendering: -webkit-optimize-contrast;
  background: var(--card);
}
