/* Стартовая страница и вход (README §392) — те же правила, что у меню игры
   (index.html, «МЕНЮ … как в Train Sim World»): снимок игры фоном, белые
   карточки с тенью, тёмный текст, красный акцент #d62828. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1220; }
body { font: 15px/1.4 -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; color: #1b222b; }
.nojs { position: fixed; inset: 40% 0 auto; text-align: center; color: #fff; font-size: 18px; }
button, input { font: inherit; color: inherit; }
a { color: #b51f1f; }

#wl { position: fixed; inset: 0; overflow: hidden; }
#wl .mbg { position: absolute; inset: 0; background: #1a2230 url(bg.jpg) center / cover no-repeat;
           transition: filter .3s, transform .3s; }
#wl .mbg::after { content: ''; position: absolute; inset: 0;
                  background: linear-gradient(90deg, rgba(246,248,250,.30) 0%, rgba(246,248,250,.08) 40%, rgba(246,248,250,0) 62%); }
/* внутренние экраны — снимок размыт и высветлен, карточки читаются */
#wl.inner .mbg { filter: blur(10px) brightness(1.06) saturate(.9); transform: scale(1.05); }
#wl.inner .mbg::after { background: rgba(246,248,250,.42); }
#wl .mview { position: absolute; inset: 0; display: flex; }
#wl .mscr { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0;
            padding: 26px 40px 30px; animation: mIn .22s ease-out; }
@keyframes mIn { from { opacity: 0; transform: translateY(8px); } }
.mbrand, .mtile, .mhead, .acard, .mrcard, .mtoast, .mkeys, .mwho { box-shadow: 0 10px 30px rgba(20,30,42,.22); }

/* стартовый экран: логотип, плашки */
#wl .mstart { justify-content: space-between; }
.mbrand.mlogo { --lw: clamp(320px, 36vw, 780px); align-self: flex-start; }
.mlogo img { display: block; width: var(--lw); height: auto; margin: calc(var(--lw) * -0.03) 0 0 calc(var(--lw) * -0.03); }
.mbrand { background: none; box-shadow: none; }
.mtag { display: inline-block; margin-top: 4px; padding: 7px 14px; border-radius: 10px; background: rgba(255,255,255,.88);
        font-size: 15px; color: #3b444f; box-shadow: 0 10px 30px rgba(20,30,42,.22); }
.mtiles { display: flex; gap: 18px; flex-wrap: wrap; }
.mtile { width: 300px; height: 230px; border: 0; padding: 0; border-radius: 14px; overflow: hidden; cursor: pointer;
         background: rgba(255,255,255,.95); display: flex; flex-direction: column; text-align: left;
         transition: transform .15s, box-shadow .15s; }
.mtile:hover, .mrcard:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(20,30,42,.3); }
.mtile:focus-visible, .abtn:focus-visible, .mnav:focus-visible { outline: 3px solid #d62828; outline-offset: 2px; }
.mtimg { flex: 1; background: center / cover no-repeat; }
.mticon { flex: 1; display: grid; place-items: center; background: linear-gradient(135deg, #f2f4f7, #dde3e9); }
.mticon svg { width: 66px; height: 66px; stroke: #2a323c; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mt-go .mticon { background: linear-gradient(135deg, #e0362f, #b51f1f); }
.mt-go .mticon svg { stroke: #fff; }
.mtcap { display: block; padding: 14px 18px 16px; border-top: 4px solid #d62828; }
.mt-doc .mtcap { border-top-color: #9aa3ad; }
.mtcap b { display: block; font-size: 22px; font-weight: 800; }
.mtcap small { color: #5d6672; font-size: 13.5px; }
/* кто вошёл — правый нижний угол стартового экрана */
.mwho { position: absolute; right: 40px; top: 26px; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px;
        background: rgba(255,255,255,.92); border-radius: 12px; border-left: 4px solid #2f9a6a; font-size: 13.5px; color: #3b444f; }
.mwho b { color: #1b222b; }
.mwho button { border: 0; border-radius: 8px; padding: 6px 10px; background: #eef1f4; cursor: pointer; font-weight: 650; }
.mwho button:hover { background: #e1e6eb; }

/* шапка внутренних экранов */
.mhead { display: flex; align-items: center; gap: 18px; padding: 12px 16px; margin-bottom: 22px;
         background: rgba(255,255,255,.95); border-radius: 14px; }
.mnav { display: flex; align-items: center; gap: 6px; border: 0; border-radius: 10px; padding: 9px 14px; cursor: pointer;
        background: #eef1f4; font-weight: 650; white-space: nowrap; }
.mnav:hover { background: #e1e6eb; }
.mnav svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mtitle { flex: 1; min-width: 0; }
.mcr { font-size: 12.5px; color: #6b7480; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcr i { font-style: normal; margin: 0 7px; opacity: .45; }
.mtitle h2 { margin: 1px 0 0; font-size: 26px; font-weight: 800; }

/* вход: карточка и кнопки способов */
.abody { flex: 1; min-height: 0; overflow: auto; display: flex; gap: 26px; align-items: flex-start; padding: 2px 4px 30px; margin: -2px -4px 0; }
.acard { width: min(520px, 100%); flex: 0 0 auto; padding: 22px 26px 24px; background: rgba(255,255,255,.97); border-radius: 14px;
         border-top: 4px solid #d62828; }
.acard h3 { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.acard .asub { margin: 0 0 18px; color: #5d6672; font-size: 14px; }
.aside { width: min(400px, 100%); padding: 20px 24px; background: rgba(255,255,255,.88); border-radius: 14px; font-size: 14px; color: #3b444f;
         box-shadow: 0 10px 30px rgba(20,30,42,.18); }
.aside h4 { margin: 0 0 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #3b444f;
            padding-bottom: 4px; border-bottom: 2px solid #d62828; }
.aside ul { margin: 0; padding-left: 18px; line-height: 1.55; }
.abtn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; margin: 0 0 10px; padding: 10px 18px;
        border: 0; border-radius: 10px; cursor: pointer; font-size: 16px; font-weight: 700; text-align: left;
        transition: filter .15s, transform .1s; }
.abtn:hover:not(:disabled) { filter: brightness(1.06); }
.abtn:active:not(:disabled) { transform: translateY(1px); }
.abtn:disabled { opacity: .45; cursor: not-allowed; }
.abtn .ai { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: 16px; }
.abtn small { margin-left: auto; font-weight: 500; font-size: 12.5px; opacity: .8; }
.ayandex { background: #1f1f1f; color: #fff; }
.ayandex .ai { background: #fc3f1d; color: #fff; }
.avk { background: #0077ff; color: #fff; }
.avk .ai { background: #fff; color: #0077ff; font-size: 13px; }
.amail { background: #eef1f4; color: #1b222b; }
.amail .ai { background: #fff; }
.amail .ai svg { width: 16px; height: 16px; stroke: #2a323c; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.aprimary { background: #d62828; color: #fff; justify-content: center; text-align: center; }
.alink { border: 0; background: none; padding: 0; color: #b51f1f; cursor: pointer; text-decoration: underline; font-size: 14px; }
.alink:disabled { color: #8a929c; text-decoration: none; cursor: default; }
.adiv { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; color: #8a929c; font-size: 13px; }
.adiv::before, .adiv::after { content: ''; flex: 1; height: 1px; background: #dde3e9; }
.aconsent { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 18px; padding: 12px 14px; border-radius: 10px;
            background: #f6f7f9; font-size: 13.5px; line-height: 1.45; color: #3b444f; cursor: pointer; }
.aconsent input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: #d62828; cursor: pointer; }
.aconsent.need { box-shadow: inset 0 0 0 2px #d62828; }
.afield { display: block; margin: 0 0 12px; }
.afield span { display: block; margin-bottom: 6px; font-size: 13px; color: #5d6672; }
.afield input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #c9d0d7; border-radius: 10px; background: #fff; font-size: 17px; }
.afield input:focus { outline: none; border-color: #d62828; box-shadow: 0 0 0 3px rgba(214,40,40,.15); }
.afield input.acode { font: 700 28px/1 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .45em; text-align: center; padding-left: .45em; }
.amsg { min-height: 20px; margin: 2px 0 10px; font-size: 14px; }
.amsg.err { color: #c0281f; }
.amsg.ok { color: #2f7d58; }
.arow { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; font-size: 14px; color: #5d6672; }
.acaptcha { min-height: 100px; margin: 0 0 12px; }
.adraft { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 6px; background: #fff3d6; color: #8a5a00;
          font-size: 12px; font-weight: 700; vertical-align: middle; }

/* об игре: маршруты и составы лентой */
.mgrid { flex: 0 0 auto; display: flex; gap: 22px; overflow-x: auto; padding: 8px 4px 34px; margin: -8px -4px 0;
         scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: rgba(20,30,42,.35) transparent; }
.mrcard { flex: 0 0 auto; width: clamp(260px, 24vw, 380px); scroll-snap-align: start; border-radius: 14px; overflow: hidden;
          background: #fff; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.mrcard .mimg { aspect-ratio: 16 / 9; background: center / cover no-repeat; }
.mcap { display: block; flex: 1; padding: 12px 16px 14px; border-top: 4px solid #d62828; }
.mcap b { display: block; font-size: 19px; font-weight: 800; }
.mcap small { display: block; margin-top: 2px; color: #5d6672; font-size: 13.5px; line-height: 1.4; }
.mcap .addon { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 6px; background: #fdecea; color: #b51f1f;
               font-size: 12px; font-weight: 700; }
.msec { margin: 4px 0 10px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #3b444f; font-weight: 700; }
.mabout { flex: 1; min-height: 0; overflow-y: auto; padding-right: 6px; }

/* документы — окно поверх экрана */
.mkwin { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 30px 40px;
         background: rgba(14,20,28,.45); animation: mIn .18s ease-out; }
.mkeys { position: relative; width: min(900px, 100%); max-height: 100%; overflow: auto; padding: 22px 30px 26px;
         background: rgba(255,255,255,.98); border-radius: 14px; color: #1b222b; }
.mkclose { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; display: grid; place-items: center;
           border: 0; border-radius: 10px; background: #eef1f4; cursor: pointer; }
.mkclose:hover { background: #e1e6eb; }
.mkclose svg { width: 18px; height: 18px; stroke: #2a323c; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.mtabs { display: flex; gap: 8px; margin: 0 0 14px; }
.mtabs button { border: 0; border-radius: 10px; padding: 8px 14px; background: #eef1f4; cursor: pointer; font-weight: 650; }
.mtabs button.on { background: #1b222b; color: #fff; }
.mdoc h2 { margin: 2px 0 4px; font-size: 26px; font-weight: 800; padding-right: 50px; }
.mdoc .ver { margin: 0 0 14px; color: #5d6672; font-size: 13px; }
.mdoc h3 { margin: 16px 0 6px; padding-bottom: 4px; border-bottom: 2px solid #d62828; font-size: 13px; letter-spacing: .06em;
           text-transform: uppercase; color: #3b444f; }
.mdoc p, .mdoc li { font-size: 14.5px; line-height: 1.55; color: #2a323c; }
.mdoc ul { padding-left: 20px; }
.mdoc .ph { background: #fff3d6; color: #8a5a00; border-radius: 4px; padding: 0 4px; }

/* сообщение поверх (ошибка возврата от провайдера и т. п.) */
.mtoast { position: absolute; top: 22px; left: 50%; z-index: 8; transform: translateX(-50%); max-width: min(560px, 90vw);
          padding: 12px 18px; border-radius: 12px; background: rgba(255,255,255,.97); border-left: 4px solid #d62828;
          font-size: 14.5px; animation: mIn .2s ease-out; }

@media (max-width: 760px) {
  #wl .mscr { padding: 18px 16px 18px; overflow-y: auto; }
  .mtiles { gap: 12px; }
  .mtile { width: calc(50% - 6px); height: 170px; }
  .mtcap b { font-size: 18px; }
  .mwho { position: static; margin: 10px 0; }
  .abody { flex-direction: column; }
  .mhead { gap: 10px; padding: 10px; }
  .mtitle h2 { font-size: 21px; }
  .mhome span, .mcr { display: none; }
  .mkwin { padding: 12px; }
}
/* меньше экран — меньше картинка фона (1280 вместо 2560) */
@media (max-width: 1280px) and (max-resolution: 1.5dppx) { #wl .mbg { background-image: url(bg_1280.jpg); } }
