:root {
    color-scheme: dark;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #ededed;
    background: #101010;
}

* { box-sizing: border-box; }

body {
    min-width: 320px;
    margin: 0;
    background: #101010;
}

a { color: #e4e4e4; }

button,
input,
select {
    font: inherit;
}

.site-header {
    border-bottom: 1px solid #343434;
    background: #171717;
}

.site-header__inner,
.site-main {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header__inner {
    display: flex;
    min-height: 64px;
    align-items: center;
    gap: 28px;
}

.brand {
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
}

.site-nav {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
}

.site-nav a {
    color: #cfcfcf;
    text-decoration: none;
}

.site-nav a[aria-current="page"] { color: #ffffff; }
.site-nav__account { margin-left: auto; }

.site-main {
    min-height: calc(100vh - 64px);
    padding: 44px 0 64px;
}

.site-main--narrow { width: min(620px, calc(100% - 32px)); }
.site-main--home { display: flex; flex-direction: column; }

h1,
h2,
h3 {
    margin-top: 0;
    line-height: 1.2;
}

h1 { font-size: clamp(28px, 5vw, 44px); }
h2 { font-size: 22px; }

p {
    color: #c4c4c4;
    line-height: 1.65;
}

.lead { max-width: 720px; font-size: 18px; }

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 28px 0;
}

.button {
    display: inline-flex;
    min-height: 42px;
    padding: 9px 16px;
    align-items: center;
    justify-content: center;
    color: #101010;
    border: 1px solid #eeeeee;
    border-radius: 4px;
    background: #eeeeee;
    cursor: pointer;
    text-decoration: none;
}

.button--secondary {
    color: #eeeeee;
    border-color: #555555;
    background: #202020;
}

.button:disabled { cursor: wait; opacity: 0.65; }

.panel,
.news-item {
    padding: 24px;
    border: 1px solid #363636;
    border-radius: 5px;
    background: #181818;
}

.panel + .panel,
.news-item + .news-item { margin-top: 16px; }

.news-item time,
.muted {
    color: #8f8f8f;
    font-size: 14px;
}

.news-item h2 { margin: 10px 0; }
.news-item h2 a { text-decoration: none; }

.form {
    display: grid;
    gap: 18px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label { font-weight: 600; }

.field input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: #ffffff;
    border: 1px solid #505050;
    border-radius: 4px;
    outline: none;
    background: #111111;
}

.field input:focus { border-color: #bdbdbd; }
.field small { color: #949494; }

.form-message {
    min-height: 24px;
    margin: 0;
    color: #c4c4c4;
}

.form-message[data-state="error"] { color: #ff9b9b; }
.form-message[data-state="success"] { color: #a9e5ae; }

.code-form {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
}

.code-input {
    position: relative;
    width: min(100%, 340px);
}

.code-input__native {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    color: transparent;
    caret-color: transparent;
    border: 0;
    outline: 0;
    opacity: 0.01;
    background: transparent;
}

.code-input__slots {
    display: grid;
    grid-template-columns: repeat(4, minmax(52px, 1fr));
    gap: 10px;
    pointer-events: none;
}

.code-input__slots span {
    display: grid;
    height: 64px;
    place-items: center;
    color: #ffffff;
    border: 1px solid #505050;
    border-radius: 6px;
    background: #111111;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}

.code-input:focus-within .code-input__slots span {
    border-color: #888888;
}

.code-input__slots span[data-active="true"] {
    border-color: #eeeeee;
    box-shadow: 0 0 0 1px #eeeeee inset;
}

.language-picker {
    display: flex;
    width: max-content;
    max-width: 100%;
    padding-top: 72px;
    margin-top: auto;
    align-items: center;
    gap: 10px;
    color: #999999;
    font-size: 14px;
}

.language-picker select {
    min-height: 36px;
    padding: 6px 30px 6px 10px;
    color: #e8e8e8;
    border: 1px solid #444444;
    border-radius: 4px;
    outline: none;
    background: #171717;
}

.language-picker select:focus { border-color: #888888; }

.account-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 28px;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.stat {
    padding: 18px;
    border: 1px solid #363636;
    border-radius: 5px;
    background: #181818;
}

.stat span { display: block; color: #999999; font-size: 13px; }
.stat strong { display: block; margin-top: 7px; overflow-wrap: anywhere; }

.inventory {
    display: grid;
    padding: 0;
    gap: 8px;
    list-style: none;
}

.inventory li {
    display: block;
    padding: 10px 12px;
    border: 1px solid #333333;
    border-radius: 4px;
}

/* Инвентарь сгруппирован по слотам: в каждом слоте носится ровно один
   предмет, и группировка делает это правилом, а не подписью. */
.inventory-group h3 {
    margin: 0 0 8px;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #999999;
}

.inventory-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
}

.inventory-row + .inventory-row { border-top: 1px solid #262626; }

.inventory-equip {
    padding: 5px 12px;
    font-size: 13px;
}

.history { display: grid; gap: 8px; }

.history-row {
    display: grid;
    grid-template-columns: minmax(84px, auto) 1fr auto auto auto;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border: 1px solid #333333;
    border-radius: 4px;
}

.history-row[data-outcome="win"] { border-left: 3px solid #6fb26f; }
.history-row[data-outcome="loss"] { border-left: 3px solid #b26f6f; }
.history-row[data-outcome="draw"] { border-left: 3px solid #999999; }
.history-row[data-outcome="aborted"] { border-left: 3px solid #4d4d4d; }

.delta--up { color: #8fcf8f; }
.delta--down { color: #cf8f8f; }

.leaderboard {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard th,
.leaderboard td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #262626;
}

.leaderboard th {
    color: #999999;
    font-size: 13px;
    font-weight: 500;
}

.leaderboard-me { background: #1d1d1d; }
.leaderboard-me td:first-child { border-left: 3px solid #e2b260; }

.session-list {
    display: grid;
    gap: 12px;
    margin: 14px 0 20px;
}

.session-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid #343434;
    border-radius: 4px;
    background: #111111;
}

.session-card__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.session-current {
    padding: 3px 7px;
    color: #b8e5bc;
    border: 1px solid #355a38;
    border-radius: 3px;
    font-size: 12px;
}

.session-details {
    display: grid;
    gap: 7px;
}

.session-details > div {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
    gap: 12px;
}

.session-end { justify-self: start; }

[hidden] { display: none !important; }

@media (max-width: 720px) {
    .site-header__inner { padding: 14px 0; align-items: flex-start; flex-direction: column; gap: 12px; }
    .site-nav { width: 100%; }
    .site-nav__account { margin-left: 0; }
    .site-main { min-height: auto; padding-top: 30px; }
    .account-grid { grid-template-columns: 1fr; }
    .session-details > div { grid-template-columns: 1fr; gap: 2px; }
    .history-row { grid-template-columns: 1fr auto; row-gap: 4px; }
    .leaderboard th:nth-child(4), .leaderboard td:nth-child(4) { display: none; }
}

/* Блок входа готовыми учётными записями. Появляется только на стенде: список
   приходит от сервера, боевой такого метода не знает. */
.local-accounts {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px dashed #3a3a3a;
}

.local-accounts h2 {
    margin: 0 0 6px;
    font-size: 15px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #999999;
}

.local-accounts .actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
