/* Страница «Ресурсы Aion» (gathering).
   Общий фон, переключатель языков и кнопка «Назад» берутся из
   ../common/site-common.css; здесь — только оформление страницы.
   Панели в цвете карточек главной (#312919), заголовок — как
   градиентная надпись Aion на главной. */

@font-face {
    font-family: 'RomicCyr';
    src: url('../fonts/RomicCyr.ttf') format('truetype');
    font-display: swap;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Trebuchet MS", sans-serif;
    min-height: 100vh;
    display: flex;
    padding: 1.5rem 0;
}

/* центр страницы: margin:auto центрует и не режет верх при переполнении */
.gathering {
    margin: auto;
    width: min(1000px, 96vw);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gathering__panel {
    background-color: #312919;
    border: 2px solid #2d251f;
    border-radius: 10px;
    padding: 1.25rem;
    color: #d4d4d8;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gathering__title {
    font-family: 'RomicCyr', 'DM Sans', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    padding-left: 0.3em;
    text-align: center;
    /* тот же градиент, что у надписи Aion на главной */
    background: linear-gradient(180deg, #f4f6ff 0%, #c6ccff 42%, #8f9aff 62%, #e2d6ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 8px rgba(143, 154, 255, 0.4));
    line-height: 1.1;
}

.gathering__row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.gathering__group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border: none;
}

.gathering__group--grow {
    flex: 1;
    min-width: 260px;
}

.gathering__label,
.gathering__group legend {
    font-size: 0.85rem;
    color: #a1a1aa;
}

fieldset.gathering__group {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 0.35rem 0.9rem 0.55rem;
    flex-direction: row;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

fieldset.gathering__group legend {
    padding: 0 0.4em;
}

.gathering__radio {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1rem;
    font-weight: bold;
    color: #d4d4d8;
    cursor: pointer;
    white-space: nowrap;
}

.gathering__radio input {
    accent-color: #ffd700;
    cursor: pointer;
}

select {
    background-color: #f4f4f5;
    color: #18181b;
    border: none;
    border-radius: 6px;
    padding: 0.45rem 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
}

#gath-region {
    min-width: 170px;
}

.gathering__levels {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.gathering__levels label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1rem;
    color: #d4d4d8;
}

.gathering__levels select {
    width: 5.5rem;
}

/* --- Выпадающий список ресурсов с поиском --- */
.combobox {
    position: relative;
    display: flex;
}

.combobox input {
    flex: 1;
    background-color: #f4f4f5;
    color: #18181b;
    border: none;
    border-radius: 6px 0 0 6px;
    padding: 0.45rem 0.6rem;
    font-size: 1rem;
    font-family: inherit;
    min-width: 0;
}

.combobox__arrow {
    background-color: #d4d4d8;
    color: #3f3f46;
    border: none;
    border-radius: 0 6px 6px 0;
    padding: 0 0.65rem;
    font-size: 0.95rem;
    cursor: pointer;
}

.combobox__arrow:hover {
    background-color: #e4e4e7;
}

.combobox__list {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    z-index: 60;
    background-color: #f4f4f5;
    color: #18181b;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    max-height: 290px;
    overflow-y: auto;
}

.combobox__option {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    width: 100%;
    padding: 0.45rem 0.7rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.95rem;
    font-family: inherit;
    color: #18181b;
    cursor: pointer;
}

.combobox__option:hover,
.combobox__option:focus {
    background-color: #e4e4e7;
    outline: 0;
}

.combobox__option .combobox__regions {
    color: #71717a;
    font-size: 0.78rem;
    white-space: nowrap;
}

.combobox__empty {
    padding: 0.5rem 0.7rem;
    color: #71717a;
    font-size: 0.9rem;
}

/* кнопка сброса фильтров — второстепенная, рядом с комбобоксом */
.gathering__reset {
    background-color: rgba(255, 255, 255, 0.08);
    color: #d4d4d8;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    padding: 0.45rem 1.1rem;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.gathering__reset:hover {
    background-color: rgba(255, 255, 255, 0.16);
}

.gathering__reset:active {
    transform: translateY(1px);
}

/* --- Результат --- */
.gathering__count {
    font-size: 0.95rem;
    color: #d4d4d8;
    min-height: 1.3em;
}

#gath-output {
    width: 100%;
    height: 34vh;
    min-height: 180px;
    background-color: #f4f4f5;
    color: #18181b;
    border: none;
    border-radius: 6px;
    padding: 0.6rem;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
}

#gath-copy {
    display: block;
    margin: 0 auto;
    background-color: #ffd700;
    color: #111;
    font-weight: bold;
    font-size: 1rem;
    font-family: inherit;
    border: none;
    border-radius: 6px;
    padding: 0.55rem 1.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

#gath-copy:hover {
    background-color: #f1c90b;
}

#gath-copy:active {
    transform: translateY(1px);
}

/* всплывающее подтверждение копирования */
#gath-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    background-color: #312919;
    border: 1px solid #4a3f2a;
    color: #ffd700;
    font-size: 0.9rem;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s, visibility 0.4s;
    max-width: 320px;
}

#gath-toast.show {
    visibility: visible;
    opacity: 1;
}

/* полосы прокрутки — как в калькуляторе заточки */
::-webkit-scrollbar {
    width: 15px;
}

::-webkit-scrollbar-track {
    background-color: #d4d4d8;
    box-shadow: inset 0 0 5px grey;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #52525b;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}

@media only screen and (max-width: 720px) {
    .gathering__row {
        align-items: stretch;
    }

    fieldset.gathering__group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }
}

/* --- Телефон в ландшафте (низкий экран) --------------------------------
   margin:auto вертикально центрирует колонку панелей, когда она помещается
   в экран, — на низком экране флаги языков оказываются далеко выше
   коричневой панели. Привязываем контент к верху. Десктоп не затронут:
   высота окна десктопа >= 600px. */
@media only screen and (max-height: 599px) {
    .gathering {
        margin: 0 auto;
    }
}

/* --- Мобильная версия (телефоны) ---------------------------------------
   Десктоп не затронут: правила только до 480px. */
@media only screen and (max-width: 480px) {
    body {
        padding: 0.6rem 0;
    }

    .gathering {
        width: calc(100vw - 16px);
        gap: 0.7rem;
    }

    .gathering__panel {
        padding: 0.8rem;
        gap: 0.7rem;
    }

    .gathering__title {
        font-size: 1.25rem;
        letter-spacing: 0.2em;
    }

    .gathering__row {
        gap: 0.7rem;
    }

    /* группы фильтров — на всю ширину, одной колонкой */
    .gathering__group {
        flex: 1 1 100%;
    }

    .gathering__group--grow {
        min-width: 0;
    }

    #gath-region {
        width: 100%;
    }

    select,
    .combobox input {
        /* 16px+ — иначе iOS увеличивает страницу при фокусе поля */
        font-size: 16px;
    }

    .gathering__levels select {
        width: 4.6rem;
    }

    #gath-output {
        height: 32vh;
        min-height: 140px;
        font-size: 0.85rem;
    }

    #gath-toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
        text-align: center;
    }
}
