/* Общие стили marfpuzzles: цвета, шрифт, кнопки, поля. Фон как у остальных проектов marf, акцент — свой, тёплый оранжевый. */

:root {
  --bg: #0b0b0e;
  --surface: #141418;
  --surface-2: #1b1b21;
  --surface-3: #24242c;
  --border: #25252d;
  --border-strong: #3a3a45;
  --text: #ededf2;
  --muted: #8b8b98;
  --accent: #ff7417;
  --accent-soft: rgba(255, 116, 23, .14);
  --accent-ink: #1f0d02;
  --danger: #ff5a5f;
  --radius: 14px;
  --container: 1200px;
  --gutter: 28px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter Tight", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
@media (max-width: 900px) {
  :root { --gutter: 16px; }
}

/* ---------- логотип ---------- */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.logo img { width: 28px; height: 28px; }
.logo span { color: var(--muted); font-weight: 500; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { height: 34px; padding: 0 14px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; flex: none; }

.input {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  outline: none;
}
.input:focus { border-color: var(--accent); }

/* ---------- всплывающие сообщения ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  z-index: 100;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: var(--danger); }

/* ---------- шапка, блоки, подвал (общие для главной, профиля и топа) ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 11, 14, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.topbar nav { display: flex; align-items: center; gap: 4px; }

.btn.big { height: 52px; padding: 0 26px; font-size: 16px; }
.btn.wide { width: 100%; }

.block { padding-top: 40px; padding-bottom: 24px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.block-head h2 { margin: 0; font-size: 32px; letter-spacing: -0.03em; }
.block-head p { margin: 0; }
.muted { color: var(--muted); }
.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 48px; padding-bottom: 40px; font-size: 14px; }
.footer a { color: var(--muted); }
@media (max-width: 600px) {
  .block-head h2 { font-size: 26px; }
  .topbar nav .ghost { display: none; }
}

/* ---------- аватар и уровень ---------- */

.ava {
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  color: #0b0b0e;
  font-weight: 800;
}
.ava img { width: 100%; height: 100%; object-fit: cover; }

.account { position: relative; }
.account-chip {
  position: relative;
  display: flex;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  cursor: pointer;
}
.account-chip .lvl {
  position: absolute;
  right: -6px;
  bottom: -4px;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--bg);
}
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 40;
  width: 270px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.account-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.account-head b { display: block; }
.account-head span { font-size: 13px; color: var(--muted); }
.xpbar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.xptext { margin: 6px 0 10px; font-size: 12px; color: var(--muted); }
.account-menu a, .account-menu button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}
.account-menu a:hover, .account-menu button:hover { background: var(--surface-2); }
.account-menu .plus-link { color: var(--accent); font-weight: 700; }

/* ---------- окно входа ---------- */

.auth {
  width: min(400px, calc(100vw - 32px));
  padding: 28px;
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.auth::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
.auth h3 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.auth-sub { margin: 6px 0 18px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  cursor: pointer;
}
.auth-close svg { width: 18px; height: 18px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); margin-bottom: 16px; }
.auth-tabs button { height: 36px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.auth-tabs button.on { background: var(--surface-3); color: var(--text); }
.auth form { display: flex; flex-direction: column; gap: 12px; }
.auth label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.auth label .input { color: var(--text); font-size: 15px; }
.auth .btn.wide { margin-top: 4px; }
.auth-error { margin: 0; color: var(--danger); font-size: 14px; }
.auth .off { display: none !important; }
.auth-tabs button:disabled { opacity: .4; cursor: default; }
.link-btn {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.link-btn:hover { color: var(--accent); }
.link-btn.center { align-self: center; }
.auth .btn.ghost.wide { margin-top: 8px; color: var(--muted); }
.code-input { height: 56px; text-align: center; font-size: 28px !important; font-weight: 800; letter-spacing: .4em; }

/* ---------- плашки под шапкой: объявление сайта, напоминание о почте ---------- */

.site-banner { border-bottom: 1px solid var(--border); font-size: 14px; }
.site-banner .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
.site-banner.info { background: var(--surface); }
.site-banner.warn { background: var(--accent-soft); }
.site-banner.warn b { color: var(--accent); }
.banner-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.banner-close { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.banner-close:hover { background: var(--surface-2); color: var(--text); }
.banner-close svg { width: 16px; height: 16px; }
