/* Сайт бета-теста — тема Apple, как в игре (UI-MANIFEST.md, токены Ui/ThemePalette.cs). */
:root {
  --bg: #000000;
  --panel: #1c1c1e;
  --raised: #2c2c2e;
  --raised-hover: #3a3a3c;
  --edge: #38383a;
  --control: rgba(120, 120, 128, 0.24);
  --control-hover: rgba(120, 120, 128, 0.36);
  --accent: #0a84ff;
  --good: #30d158;
  --warn: #ff9f0a;
  --bad: #ff453a;
  --money: #ffd60a;
  --info: #64d2ff;
  --text: #ffffff;
  --muted: #98989f;
  --subtle: #ceced4;
  --hud: rgba(30, 30, 32, 0.9);
  --r-panel: 14px;
  --r-group: 12px;
  --r-ctl: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.backdrop {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.85) 70%, #000), url(bg.jpg) center/cover no-repeat;
}

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 24px; max-width: 1120px; width: 100%; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 22px; }
.brand:hover { text-decoration: none; }
#nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 8px 24px 40px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px; }

/* Окно (лист) — как AppleUi.Window */
.sheet {
  background: var(--hud); border: 1px solid var(--edge); border-radius: var(--r-panel);
  padding: 24px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.sheet h1 { font-size: 26px; line-height: 1.2; margin: 0 0 4px; font-weight: 700; }
.sheet h2 { font-size: 17px; margin: 0 0 12px; font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 20px; }
.small { font-size: 12px; color: var(--muted); }
.caps { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; margin: 20px 0 8px 4px; }

.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; margin-top: 40px; }
.hero .title { font-size: 48px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.hero .lead { font-size: 19px; color: var(--subtle); margin: 8px 0 24px; max-width: 520px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.card { background: var(--hud); border: 1px solid var(--edge); border-radius: var(--r-panel); padding: 16px; }
.card h3 { margin: 12px 0 4px; font-size: 17px; font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: 13px; }
.tile { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 17px; }

/* Группа строк — Theme.DrawGroup */
.group { background: var(--raised); border-radius: var(--r-group); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 16px; border-top: 1px solid var(--edge); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .label { color: var(--subtle); }
.row .value { color: var(--muted); text-align: right; }

/* Поля и кнопки */
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px 4px; }
input, select {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-ctl);
  background: var(--control); color: var(--text); border: 1px solid transparent; font: inherit; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
input::placeholder { color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 30px; padding: 0 14px; border-radius: var(--r-ctl); border: 0; cursor: pointer;
  background: var(--control); color: var(--text); font: 500 15px Inter, -apple-system, sans-serif; white-space: nowrap;
}
.btn:hover { background: var(--control-hover); text-decoration: none; }
.btn.primary { background: var(--accent); }
.btn.primary:hover { filter: brightness(1.12); }
.btn.big { height: 44px; padding: 0 22px; font-size: 17px; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--bad); }
.btn.good { color: var(--good); }
.btn:disabled { opacity: .5; cursor: default; }
.pill { height: 30px; border-radius: 15px; }

.seg { display: flex; background: var(--control); border-radius: var(--r-ctl); padding: 2px; margin-bottom: 20px; }
.seg button { flex: 1; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--text); font: 500 14px Inter, sans-serif; cursor: pointer; }
.seg button.on { background: var(--raised-hover); box-shadow: 0 1px 3px rgba(0,0,0,.4); }

.msg { border-radius: var(--r-ctl); padding: 10px 14px; margin: 0 0 12px; font-size: 14px; }
.msg.err { background: rgba(255, 69, 58, .16); color: #ff8a82; }
.msg.ok { background: rgba(48, 209, 88, .16); color: #7ee49b; }

.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--control); color: var(--subtle); }
.badge.good { background: rgba(48,209,88,.18); color: var(--good); }
.badge.bad { background: rgba(255,69,58,.18); color: var(--bad); }
.badge.warn { background: rgba(255,159,10,.18); color: var(--warn); }
.badge.accent { background: rgba(10,132,255,.2); color: var(--info); }

.auth { max-width: 420px; margin: 48px auto 0; }
.wrap2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.stat .n { font-size: 28px; font-weight: 700; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); text-transform: uppercase; padding: 8px 12px; }
td { white-space: nowrap; padding: 10px 12px; border-top: 1px solid var(--edge); vertical-align: middle; }
td.mono, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.tablebox { background: var(--raised); border-radius: var(--r-group); overflow-x: auto; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.codes { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.codes .mono { background: var(--control); border-radius: var(--r-ctl); padding: 8px 12px; user-select: all; }

.hidden { display: none !important; }

/* Форум: строгий плотный список, оранжевая полоса сверху — цвет значка игры. */
.forum .fhead { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
  box-shadow: inset 0 2px 0 #ff9f0a; }
.forum .fhead h1 { font-size: 24px; margin: 0; }
.ftable { background: var(--hud); border: 1px solid var(--edge); border-radius: var(--r-group); overflow: hidden; }
.frow { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--edge); color: var(--text); }
.frow:first-child { border-top: 0; }
a.frow:hover { background: var(--raised); text-decoration: none; }
.frow.fth { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; background: rgba(255,255,255,.03); }
.frow .grow { flex: 1; min-width: 0; }
.frow .num { width: 80px; text-align: right; color: var(--subtle); font-variant-numeric: tabular-nums; }
.frow .flast { width: 220px; min-width: 0; }
.frow .fmark { width: 32px; text-align: center; color: var(--muted); }
.ftitle { font-weight: 600; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--subtle); }
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 12px 4px; }
.crumbs span { margin: 0 4px; }
.pager { display: flex; gap: 6px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.pager .btn.on { background: var(--accent); }
.posts { display: flex; flex-direction: column; gap: 10px; }
.post { display: grid; grid-template-columns: 180px 1fr; background: var(--hud); border: 1px solid var(--edge); border-radius: var(--r-group); overflow: hidden; }
.pauthor { padding: 16px; background: rgba(255,255,255,.03); border-right: 1px solid var(--edge); display: flex; flex-direction: column; gap: 8px; }
.pauthor .badge { margin: 2px 0; }
.avatar { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 20px;
  background: linear-gradient(180deg, #ffb340, #e2622e); color: #1c1c1e; }
.pbody { padding: 12px 16px 16px; min-width: 0; }
.pmeta { display: flex; justify-content: space-between; border-bottom: 1px solid var(--edge); padding-bottom: 8px; margin-bottom: 12px; }
.ptext { overflow-wrap: anywhere; line-height: 1.55; }
.ptext blockquote { margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid #ff9f0a; background: var(--raised); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; color: var(--subtle); }
textarea { width: 100%; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--control); color: var(--text);
  border: 1px solid transparent; font: inherit; outline: none; resize: vertical; }
textarea:focus { border-color: var(--accent); }
.lang { min-width: 44px; font-weight: 600; }

/* Шапка: колокольчик и счётчики */
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; }
.bellbox { position: relative; }
.bell { position: relative; }
.bell .count { position: absolute; top: -5px; right: -5px; }
.upop { width: 230px; padding: 6px; }
.mitem { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--text, #fff); font: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.mitem:hover, .mitem:focus { background: rgba(255,255,255,.07); text-decoration: none; }
@media (min-width: 821px) { #npop { left: 0; right: auto; } }
.mitem.danger { color: #ff453a; }
.msep { height: 1px; background: var(--edge); margin: 4px 6px; }
.user .chev { opacity: .6; font-size: 11px; margin-left: 2px; }
.npop { position: absolute; right: 0; top: 38px; width: 340px; max-height: 420px; overflow-y: auto; z-index: 10; padding: 14px; }
.nitem { display: block; padding: 10px; border-radius: var(--r-ctl); color: var(--subtle); border-top: 1px solid var(--edge); }
.nitem:hover { background: var(--raised); text-decoration: none; }
.nitem.unread { color: var(--text); box-shadow: inset 3px 0 0 #ff9f0a; }
.btn.mini { height: 24px; padding: 0 8px; font-size: 12px; }

/* Профиль */
.ulink { color: var(--text); font-weight: 600; }
.avatar.big { width: 72px; height: 72px; font-size: 34px; border-radius: 16px; }
.pgrid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.wpost { display: flex; gap: 12px; background: var(--hud); border: 1px solid var(--edge); border-radius: var(--r-group); padding: 12px 14px; }
.wpost .grow { flex: 1; min-width: 0; }
.post.staff { border-color: rgba(10,132,255,.5); }
.qr { width: 200px; height: 200px; background: #fff; border-radius: 12px; padding: 6px; margin: 8px 0 12px; }
.qr svg { width: 100%; height: 100%; display: block; }

@media (max-width: 820px) {
  .hero, .wrap2, .cards, .stats { grid-template-columns: 1fr; }
  .hero { margin-top: 16px; }
  .hero .title { font-size: 36px; }
  .top { padding: 12px 16px; }
  main { padding: 8px 16px 32px; }
  .sheet { padding: 18px; }
  .hide-sm { display: none; }
  .post { grid-template-columns: 1fr; }
  .pauthor { flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--edge); padding: 10px 16px; }
  .frow .flast { width: 110px; }
  .pgrid { grid-template-columns: 1fr; }
  .npop { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; }
}
