:root {
  --bg: #0b0e15; --bg2: #10141d; --panel: #161a23; --panel2: #1d2230; --line: #2a3142; --text: #e9ebf1; --muted: #9aa3b5;
  --acc: #ffb347; --acc2: #ff7a3d; --ok: #6fdc8c; --bad: #ff8a80; --radius: 14px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
img { max-width: 100%; display: block; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--acc); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-only:focus { position: fixed; left: 8px; top: 8px; width: auto; height: auto; clip: auto; z-index: 100; background: var(--panel); padding: 6px 12px; border-radius: 8px; }
.wrap { width: min(1180px, 100% - 32px); margin: 0 auto; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); text-decoration: none; cursor: pointer; font-weight: 600; transition: border-color .15s, transform .15s, background .15s; white-space: nowrap; }
.btn:hover { border-color: #4a5570; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--acc), var(--acc2)); color: #1a1006; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn[disabled] { opacity: .55; cursor: progress; }

/* шапка */
.top { position: sticky; top: 0; z-index: 20; background: rgba(11, 14, 21, .82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand span { font-size: 24px; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.nav a:hover { color: var(--text); background: var(--panel); }
.acct { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.who { display: inline-flex; align-items: center; gap: 8px; max-width: 220px; }
.who b { overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #1a1006;
  background: linear-gradient(135deg, var(--acc), var(--acc2)); flex: none; }

/* герой */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,14,21,.96) 0%, rgba(11,14,21,.75) 45%, rgba(11,14,21,.15) 100%),
  linear-gradient(0deg, var(--bg) 0%, transparent 35%); }
.hero .wrap { position: relative; z-index: 1; padding: 72px 0 84px; }
.hero h1 { font-size: clamp(32px, 5vw, 56px); line-height: 1.08; margin: 0 0 14px; max-width: 640px; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--acc), var(--acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: #c8cfdc; font-size: 18px; max-width: 560px; margin: 0 0 26px; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.facts { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 34px; color: var(--muted); font-size: 14px; }
.facts b { display: block; color: var(--text); font-size: 22px; }

/* секции */
section.block { padding: 56px 0 24px; }
.block h2 { font-size: 28px; margin: 0 0 6px; }
.lead { color: var(--muted); margin: 0 0 26px; max-width: 720px; }

/* карточки игр */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s, border-color .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); border-color: #3b4560; box-shadow: var(--shadow); }
.cover { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #000; cursor: pointer; aspect-ratio: 16 / 9; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .ic { position: absolute; left: 12px; bottom: -18px; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 26px;
  background: var(--panel2); border: 1px solid var(--line); box-shadow: 0 6px 16px rgba(0,0,0,.5); }
.cover .tag-new { position: absolute; right: 10px; top: 10px; background: var(--acc); color: #1a1006; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.card-body { padding: 26px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { margin: 0; font-size: 19px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; color: #c2cadb; background: var(--panel2); border: 1px solid var(--line); padding: 1px 8px; border-radius: 99px; }
.prog { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: 13px; color: var(--muted); margin-top: auto;
  background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.prog:hover .bar { border-color: #4a5570; }
.prog .lbl { grid-column: 1 / -1; }
.bar { display: block; height: 8px; background: var(--bg2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3aa760, #7be39b); border-radius: 99px; transition: width .6s ease; }
.pct { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.prog.free .bar i { background: repeating-linear-gradient(45deg, #2f3a50 0 6px, #263044 6px 12px); width: 100% !important; }
.card-actions { display: flex; gap: 8px; }
.card-actions .btn { flex: 1; }

/* как это работает */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step b { display: block; font-size: 16px; margin: 6px 0 4px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }
.step .n { font-size: 26px; }
.note { color: var(--muted); font-size: 13px; margin-top: 18px; background: var(--panel); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; }

footer.foot { border-top: 1px solid var(--line); margin-top: 56px; padding: 22px 0 40px; color: var(--muted); font-size: 13px; }
footer.foot .wrap { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }

/* модальные окна */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(3, 5, 10, .72); backdrop-filter: blur(4px); }
.modal[hidden] { display: none; }
.dlg { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); width: min(980px, 100%); max-height: calc(100vh - 32px);
  overflow: auto; animation: pop .18s ease-out; }
.dlg.narrow { width: min(420px, 100%); }
.dlg.mid { width: min(760px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.x { position: absolute; right: 12px; top: 12px; z-index: 3; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: rgba(22,26,35,.85); cursor: pointer; font-size: 16px; }
.x:hover { border-color: var(--acc); }
.dlg-pad { padding: 24px; }
.dlg h2 { margin: 0 0 4px; font-size: 24px; }
.dlg h3 { margin: 18px 0 8px; font-size: 16px; color: var(--acc); }
.muted { color: var(--muted); }

/* окно игры */
.gm-head { display: grid; grid-template-columns: 1.35fr 1fr; gap: 0; }
.viewer { position: relative; background: #000; aspect-ratio: 16 / 9; }
.viewer img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.viewer .cap { position: absolute; left: 10px; bottom: 10px; right: 10px; font-size: 12px; color: #fff; text-shadow: 0 1px 3px #000; }
.viewer .nav-l, .viewer .nav-r { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.45); color: #fff; cursor: pointer; }
.viewer .nav-l { left: 8px; } .viewer .nav-r { right: 8px; }
.gm-info { padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 10px; }
.gm-info .t { display: flex; gap: 12px; align-items: center; padding-right: 40px; }
.gm-info .t .ic { font-size: 34px; }
.gm-info p { margin: 0; color: #c8cfdc; }
.thumbs { display: flex; gap: 6px; padding: 8px 10px; background: var(--bg2); overflow-x: auto; border-bottom: 1px solid var(--line); }
.thumbs button { flex: none; width: 96px; aspect-ratio: 16 / 9; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: #000; cursor: pointer; opacity: .7; position: relative; }
.thumbs button.on, .thumbs button:hover { border-color: var(--acc); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .mine::after { content: "📸"; position: absolute; right: 2px; top: 0; font-size: 11px; }
.tabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 12px 12px 10px; color: var(--muted); cursor: pointer; font-weight: 600; }
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--acc); }
.pane { padding: 18px 22px 24px; }
.pane[hidden] { display: none; }
.feat { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 0; margin: 0; list-style: none; }
.feat li { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.feat li b { display: block; margin-bottom: 2px; }
.how { margin: 0; padding-left: 20px; color: #c8cfdc; }
.how li { margin: 4px 0; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.shot { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.shot button.open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; aspect-ratio: 16 / 9; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot figcaption { font-size: 12px; color: var(--muted); padding: 6px 8px; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.shot .del { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 4px; }
.shot .del:hover { color: var(--bad); }
.empty { color: var(--muted); background: var(--panel2); border: 1px dashed var(--line); border-radius: 10px; padding: 14px; font-size: 14px; }

/* прогресс */
.meter { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; margin: 6px 0 14px; }
.meter .bar { height: 12px; }
.meter .lbl { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.stat { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.checks li { display: flex; gap: 10px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: 14px; }
.checks li.done { border-color: #2e8049; }
.checks .i { font-size: 18px; width: 24px; text-align: center; }
.checks .c { flex: 1; min-width: 0; }
.checks small { display: block; color: var(--muted); font-size: 12px; }
.checks li.done small { color: var(--ok); }
.checks .mark { color: var(--muted); }
.checks li.done .mark { color: var(--ok); }
.cal { display: flex; gap: 4px; flex-wrap: wrap; }
.cal div { width: 46px; text-align: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 0; font-size: 11px; color: var(--muted); }
.cal div b { display: block; font-size: 12px; color: #ffd27a; letter-spacing: -1px; }
.cal div.today { border-color: var(--acc); }
.guest-note { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: rgba(255,179,71,.08); border: 1px solid rgba(255,179,71,.35);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }

/* профиль */
.pf-head { display: flex; gap: 16px; align-items: center; padding-right: 40px; }
.pf-head .avatar { width: 56px; height: 56px; font-size: 24px; }
.ring { --p: 0; width: 86px; height: 86px; border-radius: 50%; margin-left: auto; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--panel2) 0); }
.ring span { width: 68px; height: 68px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.rows { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 34px 1fr 1.2fr 50px; gap: 12px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 12px; cursor: pointer; text-align: left; width: 100%; }
.row:hover { border-color: #4a5570; }
.row .i { font-size: 22px; }
.row small { display: block; color: var(--muted); font-size: 12px; }
.row .pct { text-align: right; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* форма входа */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg2); border-radius: 10px; padding: 4px; margin: 14px 0 18px; }
.auth-tabs button { border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.auth-tabs button[aria-selected="true"] { background: var(--panel2); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset; }
.fld { display: grid; gap: 6px; margin-bottom: 14px; }
.fld label { font-size: 13px; color: var(--muted); }
.fld .in { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; }
.fld .in:focus-within { border-color: var(--acc); }
.fld input { flex: 1; min-width: 0; background: none; border: 0; padding: 11px 12px; outline: none; }
.fld .eye { background: none; border: 0; padding: 0 12px; cursor: pointer; color: var(--muted); }
.fld small { color: var(--muted); font-size: 12px; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: #c8cfdc; margin: -4px 0 14px; cursor: pointer; }
.chk input { margin-top: 4px; accent-color: var(--acc); }
.err { color: var(--bad); font-size: 14px; min-height: 1.4em; margin: -4px 0 10px; }
.full { width: 100%; }
.tiny { font-size: 12px; color: var(--muted); margin-top: 14px; }

/* просмотр картинки */
.lb { z-index: 60; flex-direction: column; gap: 10px; }
.lb img { max-width: min(1200px, 100%); max-height: calc(100vh - 110px); border-radius: 10px; box-shadow: var(--shadow); background: #000; }
.lb .bar2 { display: flex; gap: 10px; align-items: center; color: #dfe4ee; font-size: 14px; }

/* всплывающие сообщения */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px;
  box-shadow: var(--shadow); z-index: 80; font-size: 14px; animation: pop .2s ease-out; }

@media (max-width: 780px) {
  .nav { display: none; }
  .gm-head { grid-template-columns: 1fr; }
  .hero .wrap { padding: 48px 0 56px; }
  .row { grid-template-columns: 30px 1fr 50px; }
  .row .bar { display: none; }
  .who b { display: none; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
