:root { --bg: #14110d; --panel: #1f1a14; --panel2: #2a231a; --line: #4a3c2a; --gold: #c9a14a; --gold2: #f0d48a; --text: #eadfc8; --muted: #a8977a; --red: #c0453a; --font: "Georgia", "Times New Roman", serif; --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--ui); font-size: 15px; line-height: 1.45; }
body { background: radial-gradient(ellipse at top, #2b2116 0%, #14110d 60%) fixed; min-height: 100vh; }
a { color: var(--gold2); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font); color: var(--gold2); font-weight: normal; margin: .3em 0 .5em; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17px; }
button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: linear-gradient(#3a2f22, #2a2219); color: var(--text); padding: 7px 14px; display: inline-block; text-decoration: none !important; }
button:hover, .btn:hover { filter: brightness(1.2); } button:disabled { opacity: .5; cursor: default; }
.primary { background: linear-gradient(#b8903f, #8a6a2c) !important; color: #1a140c !important; border-color: #e0bf6c !important; font-weight: 600; }
.danger { background: linear-gradient(#8e3229, #6a231d); border-color: #b5544a; }
.small { font-size: 13px; } button.small { padding: 3px 8px; } .big { padding: 11px 22px; font-size: 17px; }
.muted { color: var(--muted); } .gold { color: var(--gold2); }
input, textarea, select { font: inherit; background: #120f0b; color: var(--text); border: 1px solid var(--line); padding: 8px 10px; width: 100%; }
select { width: auto; } input[type=checkbox] { width: auto; }
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus { outline: 1px solid var(--gold); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; }
.panel { background: rgba(31, 26, 20, .92); border: 1px solid var(--line); padding: 14px; margin-bottom: 12px; }
.boot { display: grid; place-items: center; height: 100vh; font-family: var(--font); font-size: 22px; color: var(--gold); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 18px 16px; } .narrow { max-width: 520px; }
.lead { font-size: 17px; color: var(--text); }

/* шапка */
.top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 18px; padding: 6px 16px; background: #120f0bee; border-bottom: 1px solid var(--line); backdrop-filter: blur(4px); }
.logo { display: flex; align-items: center; gap: 8px; color: var(--gold2); font-family: var(--font); font-size: 20px; line-height: 1; text-decoration: none !important; }
.logo small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .15em; text-transform: uppercase; }
.logo-img { height: 38px; width: auto; }
.top nav { display: flex; gap: 4px; flex: 1; } .top nav a { padding: 6px 10px; color: var(--muted); border-bottom: 2px solid transparent; }
.top nav a.on, .top nav a:hover { color: var(--gold2); border-color: var(--gold); text-decoration: none; }
.acct { display: flex; gap: 8px; align-items: center; } .acc { font-size: 13px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* баннер */
.hero-banner { position: relative; min-height: 380px; display: flex; align-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-banner .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .8; }
.hero-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #14110dd8 5%, #14110d70 50%, transparent 85%), linear-gradient(transparent 60%, var(--bg)); }
.hb-in { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 30px 16px; width: 100%; }
.hb-in h1 { font-size: 46px; margin: 0 0 8px; text-shadow: 0 2px 10px #000; } .hb-in .lead { max-width: 560px; text-shadow: 0 1px 4px #000; }
.stats { color: var(--muted); } .stats b { color: var(--gold2); }

.feats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.feats > div { background: var(--panel); border: 1px solid var(--line); padding: 12px; }
.feats img { width: 100%; aspect-ratio: 16/9; object-fit: cover; margin-bottom: 6px; } .feats p { margin: 0; font-size: 14px; color: var(--muted); }
.races { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.race { display: flex; flex-direction: column; border: 1px solid var(--c1, var(--line)); background: linear-gradient(160deg, var(--c0), #17130e 75%); overflow: hidden; text-decoration: none !important; }
.race img { width: 100%; aspect-ratio: 4/3; object-fit: cover; opacity: .85; } .race b { font-family: var(--font); font-weight: normal; padding: 4px 8px 0; color: var(--gold2); } .race small { padding: 0 8px 8px; color: var(--muted); }
.race:hover { box-shadow: 0 0 14px #f0d48a44; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.news { display: block; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--gold); padding: 10px 12px; margin-bottom: 8px; color: var(--text); text-decoration: none !important; }
.news b { color: var(--gold2); font-family: var(--font); font-weight: normal; font-size: 17px; } .news time { float: right; color: var(--muted); font-size: 12px; } .news p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.tbl { width: 100%; border-collapse: collapse; } .tbl td, .tbl th { padding: 4px 6px; border-bottom: 1px solid #3a3024; text-align: left; font-size: 14px; } .tbl th { color: var(--muted); font-weight: normal; }
.rt { display: inline-block; font-size: 11px; padding: 0 6px; border-left: 3px solid var(--c, var(--gold)); background: #2a231a; color: var(--text); }
.latest { list-style: none; padding: 0; margin: 0; } .latest li { padding: 6px 0; border-bottom: 1px solid #2e261b; } .latest small { display: block; color: var(--muted); font-size: 12px; }

/* о мире */
.howto { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 20px; }
.howto div { background: var(--panel); border: 1px solid var(--line); padding: 10px; font-size: 14px; } .howto b { display: block; font-family: var(--font); font-size: 26px; color: var(--gold); }
.ab-race { display: flex; gap: 14px; border: 1px solid var(--line); border-left: 4px solid var(--c1); background: linear-gradient(100deg, color-mix(in srgb, var(--c0) 30%, #1f1a14), #1a1610 60%); padding: 12px; margin-bottom: 10px; scroll-margin-top: 60px; }
.ab-race img { width: 220px; max-width: 32%; aspect-ratio: 4/3; object-fit: cover; flex: none; border: 1px solid var(--line); } .ab-race p { margin: .3em 0; font-size: 14px; }
.rules li { margin-bottom: 6px; } #rules { scroll-margin-top: 60px; }

/* форум */
.crumbs { color: var(--muted); margin-bottom: 8px; font-size: 14px; }
.secs, .topics { border: 1px solid var(--line); }
.sec, .tp { display: grid; grid-template-columns: 1fr 100px 220px; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #2e261b; background: var(--panel); color: var(--text); text-decoration: none !important; }
.sec { grid-template-columns: 40px 1fr 90px 220px; }
.sec:hover, .tp:hover { background: #2a231a; } .sec b, .tp b { color: var(--gold2); font-weight: normal; font-family: var(--font); font-size: 16px; } .sec small, .tp small { display: block; color: var(--muted); font-size: 12px; }
.sec-ic { width: 36px; height: 36px; object-fit: contain; } .sec:not(:has(.sec-ic)) { grid-template-columns: 1fr 90px 220px; }
.cnt { color: var(--muted); font-size: 12px; text-align: center; } .last { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.pager { display: flex; gap: 4px; margin: 10px 0; flex-wrap: wrap; } .pager a { padding: 3px 9px; border: 1px solid var(--line); } .pager a.on { background: var(--gold); color: #1a140c; }
.post { display: grid; grid-template-columns: 170px 1fr; border: 1px solid var(--line); margin-bottom: 8px; background: var(--panel); scroll-margin-top: 60px; }
.post aside { padding: 10px; background: #1a1610; border-right: 1px solid var(--line); font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.post aside b { color: var(--gold2); font-size: 15px; } .post time, .post aside small { color: var(--muted); font-size: 12px; }
.adm { font-style: normal; font-size: 11px; background: var(--gold); color: #1a140c; padding: 0 5px; }
.pbody { padding: 10px 12px; word-wrap: break-word; overflow-wrap: anywhere; } .pbody q { display: block; border-left: 3px solid var(--gold); padding: 2px 8px; margin: 4px 0; background: #2a231a; color: var(--muted); quotes: none; }
.edited { font-size: 11px; color: var(--muted); margin: 8px 0 0; } .pact { margin-top: 8px; display: flex; gap: 4px; justify-content: flex-end; }
.reply { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; } .mod { padding: 6px; border: 1px dashed var(--line); margin-bottom: 8px; }
.form { display: flex; flex-direction: column; gap: 10px; }

/* окно входа */
#modal { position: fixed; inset: 0; z-index: 100; background: #000b; display: grid; place-items: center; padding: 10px; overflow-y: auto; }
.mbox { position: relative; width: min(380px, 100%); background: linear-gradient(#2a231a, #1a1610); border: 1px solid var(--gold); padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 40px #000; }
.mbox .x { position: absolute; right: 6px; top: 6px; padding: 2px 8px; background: none; border: none; color: var(--muted); }
.tabs { display: flex; } .tabs button { flex: 1; background: none; border: none; border-bottom: 2px solid var(--line); color: var(--muted); }
.tabs button.on { border-color: var(--gold); color: var(--gold2); }
.agree { font-size: 13px; display: flex; gap: 6px; align-items: center; } .err { color: #e88; font-size: 13px; margin: 0; min-height: 1em; }
.mbox h3 { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 200; background: #2a231a; border: 1px solid var(--gold); padding: 9px 16px; box-shadow: 0 4px 20px #000; max-width: 90vw; }
.toast.bad { border-color: var(--red); color: #fbb; }
.foot { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; padding: 20px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); margin-top: 20px; }

/* телефон и низкие экраны (812×375 в альбомной ориентации) */
@media (max-width: 900px) { .feats { grid-template-columns: repeat(2, 1fr); } .cols { grid-template-columns: 1fr; } .howto { grid-template-columns: repeat(2, 1fr); } }
@media (max-height: 500px), (max-width: 700px) {
  html, body { font-size: 14px; } h1 { font-size: 24px; } h2 { font-size: 19px; }
  .top { padding: 4px 10px; gap: 10px; } .logo { font-size: 16px; } .logo small { display: none; } .logo-img { height: 28px; }
  .top nav a { padding: 4px 6px; } .acct button, .acct .btn { padding: 4px 10px; }
  .hero-banner { min-height: 240px; } .hb-in { padding: 16px 12px; } .hb-in h1 { font-size: 30px; } .lead { font-size: 15px; } .big { padding: 8px 16px; font-size: 15px; }
  .wrap { padding: 12px 10px; }
  .feats { grid-template-columns: repeat(4, 1fr); gap: 6px; } .feats img { display: none; } .feats > div { padding: 8px; } .feats h3 { font-size: 14px; } .feats p { font-size: 12px; }
  .races { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 5px; }
  .cols { grid-template-columns: 1.3fr 1fr; gap: 14px; }
  .sec, .tp { grid-template-columns: 1fr 80px; padding: 7px 8px; } .sec { grid-template-columns: 30px 1fr 80px; } .sec-ic { width: 28px; height: 28px; } .last { display: none; }
  .post { grid-template-columns: 130px 1fr; }
  .mbox { padding: 12px; gap: 7px; } .mbox input { padding: 6px 8px; }
}
@media (max-width: 560px) {
  .top { flex-wrap: wrap; } .top nav { order: 3; flex-basis: 100%; } .feats, .cols { grid-template-columns: 1fr; } .howto { grid-template-columns: 1fr; }
  .post { grid-template-columns: 1fr; } .post aside { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); }
  .ab-race { flex-direction: column; } .ab-race img { max-width: 100%; width: 100%; }
}

/* ================= NARVOM: сайт на один альбомный экран, без прокрутки страницы ================= */
* { scrollbar-width: thin; scrollbar-color: #8a6a2c transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; } ::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #8a6a2c; border-radius: 3px; } ::-webkit-scrollbar-thumb:hover { background: var(--gold); }
html, body { height: 100%; overflow: hidden; }
body { min-height: 0; }
#site { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.top { position: relative; }
.logo-t { font-family: var(--font); font-size: 22px; letter-spacing: .32em; color: var(--gold2); text-shadow: 0 0 12px #c9a14a55; }
main { min-height: 0; overflow: hidden; }
main.m-page { overflow-y: auto; overscroll-behavior: contain; }
.foot { margin: 0; padding: 6px 12px; gap: 14px; align-items: center; background: #120f0bee; }
.lnk { white-space: nowrap; } .lnk.don { color: #ff9a8a; }

.home { position: relative; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) clamp(230px, 28vw, 380px); gap: clamp(10px, 2vw, 28px);
  padding: clamp(10px, 3vh, 40px) clamp(12px, 4vw, 64px); overflow: hidden; }
.home > .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; z-index: 0; }
.home::after { content: ''; position: absolute; inset: 0; z-index: 0; background: linear-gradient(90deg, #14110df2 10%, #14110d99 55%, #14110dcc), linear-gradient(transparent 70%, #14110d); }
.h-left, .h-right { position: relative; z-index: 1; min-height: 0; }
.h-left { display: flex; flex-direction: column; justify-content: center; gap: clamp(4px, 1.4vh, 14px); }
.brand { font-size: clamp(40px, 13vh, 128px); letter-spacing: .28em; line-height: 1; margin: 0; color: var(--gold2); text-shadow: 0 0 30px #c9a14a66, 0 3px 12px #000; }
.brand-en { margin: 0; font-family: var(--font); font-size: clamp(13px, 2.4vh, 22px); color: var(--text); letter-spacing: .04em; }
.brand-ru { margin: 0; font-family: var(--font); font-style: italic; font-size: clamp(12px, 2.1vh, 19px); color: var(--muted); }
.home .lead { margin: 0; max-width: 620px; font-size: clamp(13px, 2vh, 17px); }
.home .stats { margin: 0; font-size: 13px; }
.feat-row { display: flex; flex-wrap: wrap; gap: 6px; } .feat-row span { border: 1px solid var(--line); background: #1f1a14cc; padding: 3px 10px; font-size: 13px; }
.races-row { display: flex; gap: 6px; flex-wrap: wrap; }
.rc { display: flex; flex-direction: column; align-items: center; width: clamp(46px, 6.2vw, 78px); text-decoration: none !important; }
.rc img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 2px solid var(--c1, var(--line)); box-shadow: 0 0 0 2px #0008; }
.rc span { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.1; margin-top: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc:hover img { box-shadow: 0 0 12px var(--c1); }
.h-right { display: flex; flex-direction: column; gap: 10px; justify-content: center; overflow: hidden; }
.hcard { background: #1a1610d9; border: 1px solid var(--line); border-left: 3px solid var(--gold); padding: 8px 12px; min-height: 0; overflow: hidden; }
.hcard h3 { margin: 0 0 4px; font-size: 16px; }
.hn { display: block; padding: 3px 0; border-bottom: 1px solid #2e261b; color: var(--text); text-decoration: none !important; overflow: hidden; }
.hn b { font-weight: normal; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .hn time { font-size: 11px; color: var(--muted); }
.more { font-size: 12px; display: inline-block; margin-top: 4px; }
.htop { list-style: none; margin: 0; padding: 0; } .htop li { display: flex; gap: 6px; align-items: center; padding: 2px 0; font-size: 13px; }
.htop i { font-style: normal; color: var(--gold); width: 14px; } .htop b { font-weight: normal; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .htop em { font-style: normal; color: var(--gold2); }
.hlinks { display: flex; flex-direction: column; gap: 6px; } .hlinks .lnk { font-size: 14px; }
.foot .lnk { display: none; }
@media (max-height: 520px), (max-width: 760px) {
  .top { padding: 3px 10px; } .logo-t { font-size: 17px; }
  .home { grid-template-columns: minmax(0, 1fr) 210px; padding: 6px 12px; gap: 10px; }
  .home .lead, .home .stats { display: none; }
  .h-left { gap: 5px; }
  .brand { font-size: clamp(34px, 12vh, 60px); }
  .feat-row span { font-size: 11px; padding: 1px 7px; }
  .rc { width: 40px; } .rc span { display: none; }
  .h-right { gap: 5px; } .hcard { padding: 4px 8px; } .hcard h3 { font-size: 13px; margin: 0 0 2px; }
  .hn { padding: 1px 0; font-size: 12px; } .hn time { display: none; } .more { display: none; }
  .htop li { font-size: 11px; padding: 0; } .htop .rt { display: none; }
  .hlinks .lnk { font-size: 12px; }
  .foot { padding: 3px 10px; font-size: 11px; gap: 10px; }
}
@media (max-width: 560px) and (orientation: portrait) {
  .home { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; } .h-right .hcard:not(.hlinks) { display: none; }
}

/* ===== вход через Telegram и Google ===== */
.mbox .oauth { display: grid; gap: 8px; margin-top: 4px; }
.mbox .oauth .or { display: flex; align-items: center; gap: 10px; color: #a8916a; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.mbox .oauth .or::before, .mbox .oauth .or::after { content: ""; flex: 1; height: 1px; background: #6a543066; }
.mbox .oa-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; min-height: 44px; }
.mbox .oa-row iframe { border-radius: 20px; }
.mbox .oauth p { margin: 0; text-align: center; }
@media (max-height: 500px) {
  #modal { padding: 6px; }
  .mbox:has(.oauth) { width: min(540px, 100%); }
  .mbox .oa-row { flex-wrap: nowrap; min-height: 40px; }
  .mbox .oauth { gap: 6px; margin-top: 0; }
  .mbox .err:empty { display: none; }
  .mbox:has(.oauth) { gap: 5px; padding-top: 8px; padding-bottom: 8px; } .mbox:has(.oauth) .tabs button { padding-top: 4px; padding-bottom: 4px; }
}
