:root {
    --bg: #eef3f8;
    --panel: #ffffff;
    --ink: #1d2733;
    --muted: #6a7a8c;
    --line: #d5dfea;
    --brand: #0f4c81;
    --brand-soft: #e6eef7;
    --accent: #1a9e8f;
    --warn: #c2410c;
    --err: #d64545;
    --ok: #2f9e44;
    --card: #f4f8fc;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(20, 40, 70, .08), 0 6px 18px rgba(20, 40, 70, .06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--brand); }

.wrap {
    max-width: 1480px;
    margin: 0 auto;
    padding: 16px 18px 40px;
}

/* ---------- шапка ---------- */
.top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    padding: 6px 0 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
}
.home-link {
    color: var(--muted, #64748b);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    align-self: center;
}
.home-link:hover { color: var(--brand); text-decoration: none; }


.brand .mark {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--brand);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: .5px;
}

.brand h1 {
    margin: 0;
    font-size: 19px;
    line-height: 1.2;
}

.brand p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--muted);
}

.lang button,
.mode button,
.btn {
    font: inherit;
    cursor: pointer;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    border-radius: 8px;
    padding: 8px 13px;
    transition: background .15s, border-color .15s, color .15s;
}

.btn:hover,
.lang button:hover,
.mode button:hover { border-color: var(--brand); }

.btn.primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn.primary:hover { background: #0c3d68; }

.mode, .lang {
    display: inline-flex;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 9px;
    overflow: hidden;
}

.mode button, .lang button {
    border: 0;
    border-radius: 0;
    padding: 8px 14px;
}

.mode button + button, .lang button + button { border-left: 1px solid var(--line); }

.mode button.on, .lang button.on {
    background: var(--brand);
    color: #fff;
}



.bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

.bar .spacer { flex: 1; }

.score {
    font-size: 13.5px;
    color: var(--muted);
    white-space: nowrap;
}

.score b { color: var(--ink); }

.points {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
}

.points b { color: var(--brand); }

.points.low {
    background: #fdeaea;
    color: var(--err);
}

.points.low b { color: var(--err); }

/* ---------- ссылка на парную игру ---------- */
.crosslink {
    margin: 0 0 12px;
    padding: 9px 14px;
    border: 1px solid #cfe3d6;
    border-radius: var(--radius);
    background: #f2f9f5;
    font-size: 13px;
}

.crosslink a { font-weight: 600; }

/* ---------- сообщение ---------- */
.msg {
    min-height: 20px;
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: var(--brand-soft);
    border: 1px solid #cfe0f0;
    color: #1b3c5c;
    font-size: 14px;
}

.msg.ok { background: #e7f6ea; border-color: #bfe3c6; color: #1f6b2c; }
.msg.err { background: #fdeaea; border-color: #f3c4c4; color: #9c2b2b; }

/* ---------- раунды ---------- */
.rounds {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.rounds button {
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    border-radius: 9px;
    padding: 9px 14px;
}

.rounds button:hover { border-color: var(--brand); }
.rounds button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.rounds button.done:not(.on) { border-color: #bfe3c6; background: #f1fbf3; color: #1f6b2c; }

.roundIntro {
    padding: 12px 14px;
    margin: 0 0 12px;
    background: var(--brand-soft);
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius);
    font-size: 13.5px;
    line-height: 1.55;
}

details.rules {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 16px;
    margin-bottom: 12px;
}

details.rules summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--brand);
}

details.rules ol { margin: 10px 0 0; padding-left: 20px; }
details.rules li { margin-bottom: 5px; }

footer {
    margin-top: 26px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--muted);
}

footer a { color: var(--muted); }

/* Юридическая строка: тише основного текста подвала, но читаемая. */
footer .legal {
    margin-top: 10px;
    font-size: 11.5px;
    opacity: .8;
}
