* {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Или только для body */
body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

/* Для разных весов */
h1, h2, h3 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700; /* Жирный для заголовков */
}

p, span, div {
    font-family: 'Nunito', sans-serif;
    font-weight: 400; /* Обычный для текста */
}

.btn, button {
    font-family: 'Nunito', sans-serif;
    font-weight: 600; /* Полужирный для кнопок */
}

/* Для скрамблов */
.scramble-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
}

/* ===== Layout ===== */
.flex-grow-1 {
    flex: 1 1 auto;
}

/* ===== Cards ===== */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}

/* ===== Официальные контесты: золотая обводка и бейдж ===== */
.text-official { color: #b8860b !important; }
.badge-official {
    background-color: #f5c518;
    color: #3d2e00;
}
.card.card-official {
    border: 2px solid #e0b000;
    box-shadow: 0 2px 10px rgba(224, 176, 0, 0.25);
}
.card.card-official:hover {
    box-shadow: 0 4px 18px rgba(224, 176, 0, 0.4);
}
.card-official > .card-body:first-child {
    background: linear-gradient(180deg, rgba(245, 197, 24, 0.12), transparent 90px);
}
.official-help { line-height: 1; vertical-align: middle; }

/* ===== Таблицы результатов: узкие столбцы попыток, лучшей и среднего идут подряд ===== */
/* Узкий столбец по содержимому — свободное место забирает столбец с именем */
.table .col-fit { width: 1%; white-space: nowrap; }
.table-results td.col-fit, .table-results th.col-fit { padding-left: .6rem; padding-right: .6rem; }
/* Столбцы времени одной ширины, как бы ни было заполнено: влезает и «(12:34.56)».
   Заголовок «Лучшая попытка» переносится на две строки, а не расширяет свой столбец */
.table-results td.col-fit.text-center, .table-results th.col-fit.text-center {
    width: 7.5em;
    min-width: 7.5em;
    max-width: 7.5em;
}
.table-results th.col-fit.text-center { white-space: normal; }
/* Немного пустого места справа от последнего столбца */
.table-results th:last-child, .table-results td:last-child { padding-right: 1.5rem; }

/* ===== Status colors ===== */
.status-draft     { color: #6c757d; }
.status-published { color: #0dcaf0; }
.status-active    { color: #198754; }
.status-finished  { color: #6c757d; }
.status-cancelled { color: #dc3545; }

/* ===== Cubing icons ===== */
.cubing-icon {
    font-family: 'cubing-icons', sans-serif;
    font-style: normal;
    font-size: 1.1em;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    line-height: 1;
    position: relative;
    /* top: -0.05em; */
}

/* ===== Достижения (templates/participants/_achievements.html) ===== */
/* Тёмный цвет ступени — для иконки, пунктира и плашки с цифрой; рамка — градиент #ach-g-<ступень> */
.ach-t-VI   { --ach-dark: #6c757d; }
.ach-t-V    { --ach-dark: #2b8a3e; }
.ach-t-IV   { --ach-dark: #087f5b; }
.ach-t-III  { --ach-dark: #6741d9; }
.ach-t-II   { --ach-dark: #c92a2a; }
.ach-t-I    { --ach-dark: #e67700; }
.ach-t-star { --ach-dark: #1f5fae; }

.achievements {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 1rem 0.5rem;
}
.ach { text-align: center; cursor: default; outline: none; }
.ach-badge {
    position: relative;
    width: 72px;
    height: 79px;
    margin: 0 auto;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18));
}
.ach-badge svg { width: 100%; height: 100%; display: block; }
.ach-dash { stroke: var(--ach-dark); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: .5; }
.ach-plate { fill: var(--ach-dark); }
.ach-numeral { font: 800 14px Nunito, system-ui, sans-serif; fill: #fff; letter-spacing: 1px; }
.ach-icon {
    position: absolute;
    /* Центр иконки — в центре пунктирного шестигранника */
    left: 0; right: 0; top: 18px;
    height: 38px;
    display: flex; align-items: center; justify-content: center;
    color: var(--ach-dark);
    font-size: 24px;
    line-height: 1;
}
.ach-icon .cubing-icon { font-size: 26px; }
.ach-icon svg { width: 28px; height: 24px; }
.ach-icon .ach-sub {
    position: absolute;
    right: 13px; bottom: -4px;
    font-size: 13px;
    background: #fff;
    border-radius: 50%;
    padding: 1px;
}
.ach-icon .ach-sub.cubing-icon { font-size: 14px; padding: 2px; right: 9px; bottom: -6px; border: 1px solid currentColor; }
.ach-icon .ach-num { font-size: 8px; font-weight: 800; border-radius: 4px; padding: 1px 3px; right: 11px; border: 1px solid currentColor; }
/* «Многоборец»: три иконки треугольником, не касаются друг друга и пунктира */
.ach-trio { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ach-trio > span { display: flex; gap: 5px; line-height: 1; }
.ach-icon .ach-trio .cubing-icon { font-size: 13px; height: 13px; }
.ach-dnf {
    font-weight: 900; font-size: 11px; letter-spacing: .5px;
    border: 2px solid currentColor; border-radius: 5px;
    padding: 1px 3px;
    transform: rotate(-12deg);
}
.ach-name { font-size: .78rem; line-height: 1.2; margin-top: .35rem; }
/* Ещё не получено — серое и бледное */
.ach-locked .ach-badge { filter: grayscale(1) opacity(.35); }
.ach-locked .ach-name { color: #adb5bd; }

/* ===== Select2 fix for Bootstrap 5 ===== */
.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    min-height: 38px;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* ===== Navbar ===== */
.navbar-brand i {
    margin-right: 4px;
}

/* ===== Tables ===== */
.table th {
    font-weight: 600;
    font-size: 0.875rem;
}

/* ===== Monospace results ===== */
.result-time {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}