/* Стальные Войны — the front of the house.
 *
 * One screen decides this page: a machine in a dust bowl, a title low on the left, and one button.
 * Everything below it exists to be scrolled past by somebody who has already pressed that button.
 *
 * Colour is restrained on purpose. The photograph is the only place saturated colour is allowed to
 * live; the chrome is warm near-black and sand, and ember belongs to the single action and to
 * nothing else — the moment a second thing is ember, the button stops being the loudest object.
 *
 * Two faces. Tektur for display: angular, built rather than drawn, and with a Cyrillic that holds
 * at 60px. Golos Text for everything read. No third face for "technical" flavour — monospace worn
 * as a costume is a costume, and numbers get tabular figures from the body face instead.
 *
 * One theme, and it is dark, because the game is dust at low sun and a light page beside it looks
 * like a different product. Everything is painted explicitly rather than inherited.
 */

:root {
    --ink: #0C0A09;
    --plate: #15110F;
    --edge: #2A2320;
    --hair: #1F1917;

    --sand: #F2EAE0;
    --dust: #A99C91;
    --quiet: #7A6E65;

    --ember: #E05A22;
    --special: #C878FF;
    --ember-lit: #F5744012;

    --display: "Tektur", "Arial Narrow", system-ui, sans-serif;
    --body: "Golos Text", "Segoe UI", system-ui, sans-serif;

    --pad: clamp(20px, 4.5vw, 56px);
    --wide: 1280px;

    color-scheme: dark;
    accent-color: #E05A22;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--ink);
    color: var(--sand);
    font: 400 17px/1.6 var(--body);
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ember); color: #120A06; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--edge); }
::-webkit-scrollbar-thumb:hover { background: #3A312C; }

a {
    color: var(--sand);
    text-decoration: none;
    text-underline-offset: 4px;
}

a:hover { text-decoration: underline; text-decoration-color: var(--ember); }

:focus-visible {
    outline: 2px solid #F57440;
    outline-offset: 3px;
}

.quiet { color: var(--quiet); }

h1, h2 {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-wrap: balance;
    margin: 0;
}

/* ---------- the bar ---------- */

.bar {
    position: absolute;
    inset: 0 0 auto;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 20px var(--pad);
}

.mark {
    font: 700 19px/1 var(--display);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.mark:hover { text-decoration: none; color: var(--sand); }

.bar-nav {
    display: flex;
    gap: 24px;
    margin-right: auto;
    font-size: 15px;
}

.bar-nav a { color: var(--dust); }
.bar-nav a:hover { color: var(--sand); }

.bar-me {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.bar-who {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    text-align: right;
}

.bar-who b { font-weight: 600; font-size: 15px; }

.purse {
    display: flex;
    gap: 12px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--dust);
}

/* Two wallets, named as well as coloured. The violet is the one the garage already spends on paid
   money, so the two match across the site and the game; the word is there because colour alone
   asks somebody to have learned the code first. */
.coin,
.gem { font-style: normal; }

.gem { color: var(--special); }

/* ---------- buttons ---------- */

.btn {
    font: 600 14px/1 var(--body);
    letter-spacing: 0.01em;
    color: #120A06;
    background: var(--ember);
    border: 1px solid var(--ember);
    padding: 11px 18px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover { background: #F57440; border-color: #F57440; }
.btn:active { background: #C94A18; border-color: #C94A18; }

.btn:disabled,
.btn[aria-disabled="true"] {
    color: var(--quiet);
    background: transparent;
    border-color: var(--edge);
    cursor: not-allowed;
}

.btn-quiet {
    color: var(--sand);
    background: rgba(12, 10, 9, 0.55);
    border-color: rgba(242, 234, 224, 0.28);
    backdrop-filter: blur(6px);
}

.btn-quiet:hover {
    color: #120A06;
    background: var(--sand);
    border-color: var(--sand);
}

.btn-go {
    font-size: 18px;
    font-weight: 600;
    padding: 18px 44px;
}

.link {
    font: 500 15px/1 var(--body);
    color: var(--sand);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: var(--ember);
    text-underline-offset: 4px;
}

.link:hover { color: var(--ember); }

/* ---------- the frame ---------- */

.frame {
    position: relative;
    min-height: min(94vh, 860px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: end;
    gap: 40px;
    padding: 140px var(--pad) clamp(40px, 6vh, 72px);
    overflow: hidden;
}

.frame-shot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 62% 58%;
    z-index: -2;
}

/* Two scrims rather than one: a vertical wash so the title has ground to stand on, and a wash from
   the left so the machine keeps its own light on the right of the frame. */
.frame::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(to top, rgba(12, 10, 9, 0.97) 0%, rgba(12, 10, 9, 0.72) 34%, rgba(12, 10, 9, 0.12) 70%, rgba(12, 10, 9, 0.5) 100%),
        linear-gradient(to right, rgba(12, 10, 9, 0.9) 0%, rgba(12, 10, 9, 0.35) 46%, rgba(12, 10, 9, 0) 72%);
}

.frame-say { max-width: 660px; }

.frame-say h1 {
    font-size: clamp(38px, 6.4vw, 76px);
    line-height: 1.02;
}

.frame-say p {
    max-width: 44ch;
    margin: 20px 0 0;
    font-size: clamp(17px, 1.5vw, 20px);
    color: var(--dust);
}

.frame-do {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 38px;
}

.frame-note { font-size: 14px; color: var(--dust); }

/* The one authored moment on the page: the frame settles once, and nothing else moves. */
@media (prefers-reduced-motion: no-preference) {
    .frame-say > *,
    .top {
        opacity: 0;
        transform: translateY(14px);
        animation: settle 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .frame-say h1 { animation-delay: 0.06s; }
    .frame-say p { animation-delay: 0.16s; }
    .frame-do { animation-delay: 0.26s; }
    .top { animation-delay: 0.4s; }

    @keyframes settle {
        to { opacity: 1; transform: none; }
    }
}

/* ---------- the ten ---------- */

.top {
    align-self: end;
    padding: 20px 22px 18px;
    background: rgba(12, 10, 9, 0.62);
    border: 1px solid rgba(242, 234, 224, 0.14);
    backdrop-filter: blur(10px);
}

.top h2 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dust);
}

.ladder-box {
    margin-top: 14px;
    font-variant-numeric: tabular-nums;
}

.rank {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 10px;
    padding: 7px 0;
    border-top: 1px solid var(--hair);
    font-size: 15px;
}

.rank:first-child { border-top: 0; }

.rank-n { color: var(--quiet); font-size: 14px; }
.rank--top .rank-n { color: var(--ember); }

.rank-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-score { color: var(--dust); font-size: 14px; }

.rank--me .rank-name,
.rank--me .rank-score { color: var(--ember); }

.top-foot {
    margin: 14px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--quiet);
}

.top-forum {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--hair);
    font-size: 15px;
}

.top-forum b { font-weight: 500; font-size: 13px; color: var(--quiet); }

/* ---------- bands ---------- */

.band {
    max-width: var(--wide);
    margin: 0 auto;
    padding: clamp(64px, 9vw, 110px) var(--pad) 0;
}

.band h2 {
    font-size: clamp(24px, 3vw, 34px);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.band { padding-bottom: clamp(56px, 8vw, 96px); }

.band-head {
    display: flex;
    align-items: center;
    gap: 20px;
}

.reel-nav { display: flex; gap: 8px; margin-left: auto; }

.reel-btn {
    width: 42px;
    height: 42px;
    font: 400 22px/1 var(--body);
    color: var(--sand);
    background: transparent;
    border: 1px solid var(--edge);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.reel-btn:hover { color: var(--ember); border-color: var(--ember); }

/* A scroll container with snap points rather than a transformed track: swipe, trackpad and the
   scrollbar all work without being reimplemented, and the buttons only have to scroll it. */
.reel {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc(50% - 10px);
    gap: 20px;
    margin-top: 26px;
    padding-bottom: 4px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.reel::-webkit-scrollbar { display: none; }

.slide {
    position: relative;
    margin: 0;
    scroll-snap-align: start;
}

.slide img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid var(--hair);
}

/* The whole picture is the control. A magnifier badge in a corner is a smaller target and one more
   thing to draw. */
.slide-open {
    position: absolute;
    inset: 0;
    background: transparent;
    border: 0;
    cursor: zoom-in;
}

.slide-open:hover { background: rgba(224, 90, 34, 0.09); }

.slide figcaption {
    margin-top: 10px;
    font-size: 14px;
    color: var(--quiet);
}

.reel-dots {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}

.dot {
    width: 26px;
    height: 3px;
    padding: 0;
    background: var(--edge);
    border: 0;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dot--on { background: var(--ember); }
.dot:hover { background: var(--dust); }

/* ---- the enlarged frame ---- */

.lens {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: clamp(16px, 4vw, 56px);
    background: rgba(6, 4, 3, 0.94);
}

.lens[hidden] { display: none; }

.lens-hold {
    margin: 0;
    max-width: min(1400px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lens-hold img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 160px);
    object-fit: contain;
    border: 1px solid var(--edge);
}

.lens-hold figcaption {
    font-size: 15px;
    color: var(--dust);
    text-align: center;
}

.lens-x {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 44px;
    height: 44px;
    font: 400 28px/1 var(--body);
    color: var(--dust);
    background: none;
    border: 0;
    cursor: pointer;
}

.lens-x:hover { color: var(--sand); }

.lens-step {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    font: 400 26px/1 var(--body);
    color: var(--sand);
    background: transparent;
    border: 1px solid var(--edge);
    cursor: pointer;
}

.lens-step:hover { color: var(--ember); border-color: var(--ember); }
.lens-step[hidden] { display: none; }

/* ---------- foot ---------- */

.foot {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    max-width: var(--wide);
    margin: 0 auto;
    padding: 26px var(--pad) 40px;
    border-top: 1px solid var(--hair);
    font-size: 14px;
}

.foot-mark {
    font: 700 14px/1 var(--display);
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.foot-nav { display: flex; gap: 20px; }
.foot-nav a { color: var(--dust); }
.foot .quiet { margin-left: auto; }

/* ---------- the panel ---------- */

.veil {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(6, 4, 3, 0.86);
}

.veil[hidden] { display: none; }

.card {
    position: relative;
    width: min(400px, 100%);
    padding: 34px 32px 28px;
    background: var(--plate);
    border: 1px solid var(--edge);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}

.card h2 {
    margin-bottom: 24px;
    font-size: 26px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.card-x {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    font-size: 22px;
    line-height: 1;
    color: var(--quiet);
    background: none;
    border: 0;
    cursor: pointer;
}

.card-x:hover { color: var(--sand); }

.field { display: block; margin-bottom: 16px; }

.field span {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    color: var(--dust);
}

.field input {
    width: 100%;
    padding: 12px;
    font: 400 16px/1.3 var(--body);
    color: var(--sand);
    background: var(--ink);
    border: 1px solid var(--edge);
}

.field input::placeholder { color: var(--quiet); }
.field input:focus { border-color: var(--ember); outline: none; }

.card .btn-go { width: 100%; margin-top: 8px; font-size: 16px; padding: 15px 24px; }

.err {
    margin: 0 0 14px;
    padding: 10px 12px;
    font-size: 15px;
    color: #F5B49A;
    background: rgba(224, 90, 34, 0.14);
    border-left: 1px solid var(--ember);
}

.err[hidden] { display: none; }

/* What the panel has to say that is not an error: a letter sent, an address confirmed. Separate
   from .err because "готово" in red is a sentence nobody reads twice. */
.said {
    margin: 0 0 16px;
    padding: 10px 12px;
    font-size: 15px;
    color: var(--sand);
    background: rgba(242, 234, 224, 0.07);
    border-left: 1px solid var(--dust);
}

.said[hidden] { display: none; }

/* The same thing, but for something the page was told by a link rather than by a form: it sits
   above everything, under the bar, and goes when it is clicked. */
.word {
    position: relative;
    z-index: 30;
    margin: 0;
    padding: 74px var(--pad) 14px;
    font-size: 15px;
    color: var(--sand);
    background: rgba(224, 90, 34, 0.16);
    border-bottom: 1px solid var(--ember);
    cursor: pointer;
}

.word[hidden] { display: none; }

/* With a word above it the frame no longer starts under the bar, so it does not need the room. */
body:has(.word:not([hidden])) .frame { padding-top: 40px; }

.swap {
    margin: 18px 0 0;
    font-size: 15px;
    color: var(--dust);
}

/* ---------- narrow ---------- */

@media (max-width: 980px) {
    .frame {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        min-height: 0;
        padding-top: 120px;
    }

    .frame-say { max-width: none; }

    .top { margin-top: 40px; }

    .frame::before {
        background: linear-gradient(to top, rgba(12, 10, 9, 0.97) 30%, rgba(12, 10, 9, 0.78) 62%, rgba(12, 10, 9, 0.34) 100%);
    }
}

@media (max-width: 860px) {
    .reel { grid-auto-columns: 100%; }
}

@media (max-width: 640px) {
    body { font-size: 16px; }

    .bar { gap: 12px; padding: 14px 16px; }
    .mark { font-size: 15px; }
    .bar-nav { display: none; }
    .btn { padding: 9px 12px; font-size: 13px; }
    .btn-go { width: 100%; font-size: 17px; padding: 16px 24px; }

    .frame-do { gap: 12px; }
    .frame-note { width: 100%; }

    .foot .quiet { margin-left: 0; }
}
