/* ============================================================
   Тема GO-1 «Платформа для геймификации» (ТЗ v1.1, приложение Б)
   Палитра: графит #1A2330 / графит-софт #2A3547 / оранж #D4875A
   Фон: #FAF7F2 · карточки: #FFFFFF · радиус: 10px
   ============================================================ */
:root {
  --graphite: #1A2330;
  --graphite-soft: #2A3547;
  --orange: #D4875A;
  --orange-hover: #C0764C;
  --orange-soft: #F6E3D4;
  --bg: #FAF7F2;
  --card: #FFFFFF;
  --text: #1A2330;
  --muted: #5C6779;
  --border: #E7E1D8;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(26, 35, 48, .08), 0 4px 14px rgba(26, 35, 48, .06);
  --green: #2E7D53; --green-bg: #E3F2EA;
  --red: #B3382C; --red-bg: #FBE7E4;
  --amber: #9A6A12; --amber-bg: #FBF1DC;
  --blue: #2C5D8F; --blue-bg: #E4EEF7;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0 0 .8em; }
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-size: 13px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 8px; top: 8px; background: var(--orange); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 99; }

/* ---------- Шапка ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--graphite); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.header-row { display: flex; align-items: center; gap: 12px; height: 62px; }
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; background: var(--orange); color: #fff; font-weight: 900; font-size: 19px; }
.logo-name { font-weight: 700; font-size: 14px; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main-nav { display: flex; gap: 2px; }
.nav-link { padding: 8px 12px; border-radius: 8px; color: rgba(255,255,255,.85); font-size: 14px; font-weight: 500; white-space: nowrap; }
.nav-link:hover { background: var(--graphite-soft); color: #fff; }
.nav-link.active { background: var(--graphite-soft); color: #E8B08A; }
.header-search { margin-left: auto; display: flex; align-items: center; background: var(--graphite-soft); border-radius: 8px; overflow: hidden; max-width: 240px; width: 100%; }
.header-search input { background: transparent; border: 0; color: #fff; padding: 8px 10px; width: 100%; outline: none; font-size: 14px; }
.header-search input::placeholder { color: rgba(255,255,255,.5); }
.header-search button { background: transparent; border: 0; cursor: pointer; padding: 6px 8px; font-size: 14px; }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: rgba(255,255,255,.85); font-size: 17px; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--graphite-soft); }
.badge-dot { position: absolute; top: -2px; right: -4px; background: var(--orange); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 6px; border-radius: 999px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--graphite-soft); }
.user-name { font-size: 14px; font-weight: 500; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: var(--card); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); min-width: 210px; padding: 6px; z-index: 50; }
.ud-head { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.ud-head b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ud-head span { font-size: 12px; color: var(--muted); }
.user-dropdown a { display: block; padding: 8px 10px; border-radius: 7px; font-size: 14px; }
.user-dropdown a:hover { background: #F3EEE7; }
.ud-exit { color: var(--red); }
.burger { display: none; }
.mobile-panel { display: none; border-top: 1px solid rgba(255,255,255,.12); background: var(--graphite); padding: 10px 16px 14px; }
.mobile-panel a { display: block; padding: 10px 12px; border-radius: 8px; color: rgba(255,255,255,.88); font-size: 15px; }
.mobile-panel a:hover { background: var(--graphite-soft); }
.mobile-auth { display: flex; gap: 8px; margin-top: 8px; }

/* ---------- Аватары, бейджи ---------- */
.avatar { --hue: 24; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 14px; background: hsl(var(--hue) 52% 46%); flex-shrink: 0; }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge-gray { background: #ECEAE4; color: #57534B; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-orange { background: var(--orange-soft); color: #9C5B2E; }
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--muted); }

/* ---------- Кнопки, формы ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: var(--radius); padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s; text-align: center; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-hover); }
.btn-outline { border-color: #C9C2B6; background: transparent; color: var(--text); }
.btn-outline:hover { background: #F1EBE2; }
.btn-ghost { background: transparent; color: inherit; }
.btn-ghost:hover { background: var(--graphite-soft); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-danger:hover { background: #F5D7D2; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
input, select, textarea { font: inherit; color: inherit; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=date], .field input[type=url], .field input[type=search], .field input[type=tel], .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #D6CFC3; border-radius: 8px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(212,135,90,.18); }
.field textarea { min-height: 90px; resize: vertical; }
.checkbox { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; margin: 10px 0; }
.checkbox input { margin-top: 3px; }
.form-error { background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }

/* ---------- Flash ---------- */
.flash { margin: 14px auto 0; padding: 11px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 500; }
.flash-success { background: var(--green-bg); color: var(--green); }
.flash-error { background: var(--red-bg); color: var(--red); }
.flash-info { background: var(--blue-bg); color: var(--blue); }

/* ---------- Основная сетка ---------- */
.site-main { flex: 1; padding: 22px 0 44px; }
.page-head { margin-bottom: 18px; }
.page-head .crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.page-head .crumbs a:hover { color: var(--orange); }
.section { margin-bottom: 30px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.section-title .more { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--orange); }
.section-title .more:hover { text-decoration: underline; }

/* ---------- Главная: hero, баннеры ---------- */
.hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-bottom: 28px; }
.hero-card { border-radius: 14px; padding: 30px 28px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; min-height: 240px; position: relative; overflow: hidden; }
.hero-main { background: linear-gradient(135deg, var(--graphite) 15%, #34455F 70%, var(--orange) 160%); }
.hero-main h1 { font-size: 27px; margin-bottom: 8px; }
.hero-main p { color: rgba(255,255,255,.82); max-width: 480px; }
.hero-side { background: linear-gradient(120deg, var(--orange) 0%, #B96F44 100%); min-height: 240px; }
.hero-side .hc { background: rgba(255,255,255,.14); border-radius: 10px; padding: 11px 13px; margin-top: 9px; font-size: 13.5px; }
.hero-stats { display: flex; gap: 20px; margin: 14px 0 18px; }
.hero-stats b { font-size: 21px; display: block; }
.hero-stats span { font-size: 12.5px; color: rgba(255,255,255,.75); }

/* ---------- Карточки конкурсов ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; }
.contest-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.contest-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-cover { --hue: 24; display: flex; align-items: flex-start; justify-content: space-between; height: 108px; padding: 12px; background: linear-gradient(135deg, hsl(var(--hue) 45% 88%), hsl(calc(var(--hue) + 30) 40% 78%)); position: relative; }
.card-kind { background: rgba(255,255,255,.85); color: var(--graphite); font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.hot-flag { background: var(--graphite); color: #FFC79E; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.card-title { font-size: 15.5px; margin: 0; }
.card-title a:hover { color: var(--orange); }
.card-desc { color: var(--muted); font-size: 13px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-prize { font-size: 13px; font-weight: 600; color: #9C5B2E; background: var(--orange-soft); border-radius: 7px; padding: 5px 9px; margin: 0; }
.card-meta { display: flex; flex-wrap: wrap; gap: 11px; margin-top: auto; padding-top: 7px; font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--border); }
.is-hot { border-color: #E8B08A; box-shadow: 0 0 0 1px #E8B08A inset; }

/* ---------- Фильтры ---------- */
.filters { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.filters-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.filters .field { margin: 0; }
.tabs { display: inline-flex; background: #EFE9DF; border-radius: 9px; padding: 3px; gap: 2px; }
.tab { border: 0; background: transparent; padding: 7px 16px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
a.tab { text-decoration: none; }

/* ---------- Страница конкурса ---------- */
.contest-layout { display: grid; grid-template-columns: 1fr 330px; gap: 18px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; }
.panel h2 { font-size: 17px; }
.contest-hero { --hue: 24; border-radius: 12px; padding: 26px 24px; color: var(--graphite); background: linear-gradient(135deg, hsl(var(--hue) 45% 90%), hsl(calc(var(--hue) + 30) 42% 80%)); margin-bottom: 14px; }
.contest-hero h1 { font-size: 24px; }
.contest-hero .crumbs a:hover { color: var(--orange); }
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.stat-cell { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; text-align: center; }
.stat-cell b { display: block; font-size: 17px; }
.stat-cell span { font-size: 11.5px; color: var(--muted); }
.q-block { border: 1px solid var(--border); border-radius: 10px; padding: 13px 15px; margin-bottom: 11px; }
.q-block .q-text { font-weight: 600; margin-bottom: 8px; }
.q-option { display: flex; gap: 9px; align-items: center; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; cursor: pointer; transition: border-color .12s, background .12s; font-size: 14px; }
.q-option:hover { border-color: var(--orange); background: #FDF7F1; }
.q-option input { accent-color: var(--orange); }
.participants-list { display: flex; flex-direction: column; gap: 9px; }
.participant-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.participant-row .p-name { font-weight: 600; font-size: 14px; }
.participant-row .p-city { font-size: 12px; color: var(--muted); }
.vote-btn { margin-left: auto; }
.finished-note { background: #ECEAE4; border: 1px dashed #C9C2B6; color: var(--muted); border-radius: 10px; padding: 14px 16px; text-align: center; font-weight: 600; }

/* ---------- Кабинет ---------- */
.cab-layout { display: grid; grid-template-columns: 250px 1fr; gap: 18px; align-items: start; }
.cab-nav { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px; position: sticky; top: 76px; }
.cab-nav .cab-user { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.cab-nav a { display: block; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--muted); font-weight: 500; }
.cab-nav a:hover { background: #F3EEE7; color: var(--text); }
.cab-nav a.active { background: var(--orange-soft); color: #9C5B2E; font-weight: 600; }
.cab-nav .nav-sep { height: 1px; background: var(--border); margin: 8px 4px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 11px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 11px; padding: 14px 16px; }
.kpi b { font-size: 22px; display: block; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi.k-orange b { color: var(--orange); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.points-plus { color: var(--green); font-weight: 700; }
.points-minus { color: var(--red); font-weight: 700; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 10px 0; }
.pay-method { border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 13px; cursor: pointer; font-size: 13.5px; font-weight: 600; display: flex; gap: 9px; align-items: center; }
.pay-method:hover { border-color: var(--orange); }
.pay-method input { accent-color: var(--orange); }
.packs { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 6px; }
.pack { border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 18px; text-align: center; cursor: pointer; font-weight: 700; font-size: 16px; background: #fff; }
.pack:hover { border-color: var(--orange); }
.pack input { display: none; }
.pack .pack-rub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.ref-link-box { display: flex; gap: 8px; margin: 10px 0 14px; }
.ref-link-box input { flex: 1; padding: 10px 12px; border: 1px solid #D6CFC3; border-radius: 8px; background: #FBF8F3; font-size: 13px; font-family: ui-monospace, monospace; }
.tgl { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.tgl input { opacity: 0; width: 0; height: 0; }
.tgl span { position: absolute; inset: 0; background: #CFC8BC; border-radius: 999px; transition: .15s; cursor: pointer; }
.tgl span::before { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; left: 3px; top: 3px; background: #fff; transition: .15s; }
.tgl input:checked + span { background: var(--orange); }
.tgl input:checked + span::before { transform: translateX(18px); }

/* ---------- Прочие блоки ---------- */
.empty-state { text-align: center; padding: 38px 20px; color: var(--muted); }
.empty-emoji { font-size: 34px; margin-bottom: 8px; }
.news-item { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 11px; }
.news-item h3 { margin-bottom: 4px; }
.news-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.winner-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 11px; padding: 12px 15px; margin-bottom: 9px; }
.winner-place { width: 30px; height: 30px; border-radius: 50%; background: var(--orange-soft); color: #9C5B2E; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.activity-feed { display: flex; flex-direction: column; gap: 8px; }
.activity-item { display: flex; gap: 9px; font-size: 13.5px; border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
.inst-embed { background: linear-gradient(135deg, #F6E3D4, #E8D2EF); border-radius: 10px; padding: 22px; text-align: center; color: #6B4E3B; }
.instagram-media { margin: 0 auto !important; }
.demo-box { border: 1.5px dashed var(--orange); background: #FDF6EF; border-radius: 10px; padding: 13px 15px; margin: 14px 0; font-size: 13.5px; }
.demo-box b { color: #9C5B2E; }
.demo-accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.demo-accounts button { border: 1px solid #E8B08A; background: #fff; border-radius: 8px; padding: 7px 9px; font-size: 12.5px; cursor: pointer; text-align: left; }
.demo-accounts button:hover { background: var(--orange-soft); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 13px; }
.step-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 17px 18px; }
.step-num { width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 9px; }
.alert { border-radius: 10px; padding: 12px 15px; font-size: 14px; margin-bottom: 12px; }
.alert-info { background: var(--blue-bg); color: var(--blue); }
.alert-warn { background: var(--amber-bg); color: var(--amber); }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }

/* ---------- Подвал ---------- */
.site-footer { background: var(--graphite); color: rgba(255,255,255,.85); margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 26px; padding: 30px 16px 22px; }
.footer-brand .logo-mark { margin-bottom: 10px; }
.footer-desc { font-size: 13px; color: rgba(255,255,255,.65); max-width: 320px; }
.footer-col h3 { color: #fff; font-size: 14px; margin-bottom: 10px; }
.footer-col a { display: block; padding: 3px 0; font-size: 13.5px; color: rgba(255,255,255,.72); }
.footer-col a:hover { color: #E8B08A; }
.subscribe { display: flex; gap: 7px; margin-bottom: 14px; }
.subscribe input { flex: 1; min-width: 0; background: var(--graphite-soft); border: 1px solid transparent; border-radius: 8px; padding: 9px 11px; color: #fff; outline: none; font-size: 13.5px; }
.subscribe input::placeholder { color: rgba(255,255,255,.45); }
.subscribe input:focus { border-color: var(--orange); }
.socials { display: flex; gap: 8px; }
.socials a { width: 34px; height: 34px; border-radius: 50%; background: var(--graphite-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; padding: 0; }
.socials a:hover { background: var(--orange); color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; padding-bottom: 16px; font-size: 12.5px; color: rgba(255,255,255,.55); }

/* ---------- Адаптив ---------- */
@media (max-width: 1000px) {
  .main-nav, .header-search { display: none; }
  .burger { display: inline-flex; }
  .mobile-panel { display: block; }
  .mobile-panel[hidden] { display: none; }
  .hero { grid-template-columns: 1fr; }
  .contest-layout { grid-template-columns: 1fr; }
  .cab-layout { grid-template-columns: 1fr; }
  .cab-nav { position: static; }
  .footer-grid { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 560px) {
  h1 { font-size: 22px; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .pay-methods { grid-template-columns: 1fr; }
  .logo-name { display: none; }
  .card-meta { gap: 8px; }
}
