/* ==========================================================================
   Админ-панель (KR | Интерфейсы, кадры Group 2087329xxx)

   Два слоя:
   1) .adm-layer — немодальная панель слежки поверх игры (статус-плашка со
      временем, ник/обновить/выход, ряд наказаний, «Информация об игроке»).
      Живёт вне kui-root, масштабируется сама: кадр дизайна 1920×912
      (скриншот телефона 2.1:1), высота кадра = высота экрана, ширина —
      сколько влезло; элементы прибиты к краям/центру обычным CSS.
   2) Модалки — экран KingUI "adm" на холсте 910×912: панель по центру,
      масштаб одинаковый для всех видов, поэтому при переходах меню →
      список → форма размер не прыгает.

   Рамки — inset box-shadow, не border (border сдвигает absolute-детей).
   ========================================================================== */

/* Regular (400) нужен только админке: подписи «Информации об игроке» */
@font-face {
    font-family: "Halvar Engschrift";
    src: url("assets/HalvarEng-Rg.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

/* --------------------------------------------------------------------------
   Общие кирпичи модалок: строка, кнопка, скроллбар
   -------------------------------------------------------------------------- */

.adm-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.adm-panel {
    position: relative;
    width: 910px;
    padding: 0 22px 22px;
    box-sizing: border-box;
    background: rgba(28, 29, 34, 0.5);
    border-radius: 18.8px;
    pointer-events: auto;
    font-family: var(--kui-font);
    font-weight: 700;
    color: #fff;
}

.adm-head {
    height: 78.7px;
    margin: 0 -22px 25px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, var(--kui-gold-a) 0%, var(--kui-gold-b) 100%);
    border-radius: 18.8px;
    color: var(--kui-bg);
    font-size: 35.24px;
    line-height: 41px;
    white-space: nowrap;
    overflow: hidden;
}

.adm-head span { overflow: hidden; text-overflow: ellipsis; }

.adm-row {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 79.2px;
    box-sizing: border-box;
    background: #212228;
    box-shadow: inset 0 0 0 5.58px var(--kui-line);
    border-radius: 19.19px;
    font-size: 29.37px;
    line-height: 34px;
    color: #fff;
    white-space: nowrap;
}

.adm-sel,
.adm-row.adm-sel {
    background: linear-gradient(90deg, var(--kui-gold-a) 0%, var(--kui-gold-b) 100%);
    box-shadow: none;
    color: var(--kui-bg);
}

.adm-gold { color: #F0C354; }
.adm-sel .adm-gold { color: var(--kui-bg); }

.adm-pick { cursor: pointer; }
.adm-pick:active { filter: brightness(1.12); }

.adm-btns {
    display: flex;
    gap: 18.5px;
}

.adm-btn {
    position: relative;
    flex: 1 1 0;
    height: 78.7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #212228;
    box-shadow: inset 0 0 0 5.58px var(--kui-line);
    border-radius: 19.19px;
    font-size: 29.37px;
    line-height: 34px;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
}

.adm-btn-p {
    background: linear-gradient(90deg, var(--kui-gold-a) 0%, var(--kui-gold-b) 100%);
    box-shadow: none;
    color: var(--kui-bg);
}

.adm-btn:active { filter: brightness(1.12); }

.adm-btn-off {
    opacity: 0.45;
    pointer-events: none;
}

/* Прокручиваемая область + свой скроллбар справа (15.8 × высота области).
   Нативный скроллбар спрятан: в WebView он тонкий системный и не по макету. */
.adm-scroll {
    position: relative;
    display: flex;
    gap: 26px;
}

.adm-scroll-box {
    flex: 1 1 auto;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.adm-scroll-box::-webkit-scrollbar { display: none; }

.adm-bar-y {
    position: relative;
    flex: 0 0 15.84px;
    background: var(--kui-line);
    border-radius: 8px;
}

.adm-bar-y i {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: linear-gradient(180deg, var(--kui-gold-a) 0%, var(--kui-gold-b) 100%);
    border-radius: 8px;
}

.adm-noscroll .adm-bar-y { display: none; }

/* --------------------------------------------------------------------------
   Вид list: меню форм, список команд, список форм, действие с формой
   -------------------------------------------------------------------------- */

.adm-list {
    display: flex;
    flex-direction: column;
    gap: 10.5px;
}

.adm-list .adm-row { padding: 0 27px 0 43px; }

/* колонки строки: № / команда / текст / автор справа */
.adm-c-i { flex: 0 0 73px; }
.adm-c-c { flex: 0 0 173px; }
.adm-c-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.adm-c-r { flex: 0 0 auto; margin-left: 20px; text-align: right; }

/* «Список форм»: номер с отступом 25, команда уже */
.adm-list-forms .adm-row { padding-left: 25px; }
.adm-list-forms .adm-c-c { flex-basis: 118px; }
.adm-list-forms .adm-c-r { color: #F0C354; }
.adm-list-forms .adm-sel .adm-c-r { color: var(--kui-bg); }

/* «Список команд»: команда с 39 */
.adm-list-cmds .adm-row { padding-left: 39px; }

/* строка только для чтения («Действие с формой») */
.adm-ro { cursor: default; }
.adm-list-info .adm-row { padding-left: 52px; }
.adm-list-info .adm-c-c { flex-basis: 165px; }
.adm-list-info .adm-c-r { color: #F0C354; }

.adm-empty {
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
}

/* --------------------------------------------------------------------------
   Вид text (жалоба игрока) и input (ответ игроку)
   -------------------------------------------------------------------------- */

.adm-text {
    padding: 22.6px 43px;
    white-space: normal;
    word-break: break-word;
    max-height: calc(34px * 4 + 45.2px);
    overflow-y: auto;
    scrollbar-width: none;
    align-items: flex-start;
}

.adm-text::-webkit-scrollbar { display: none; }

.adm-field {
    padding: 0 0 0 43px;
    cursor: text;
}

.adm-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    min-height: 79.2px;
    padding: 0 27px 0 0;
    margin: 0;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 29.37px;
    color: #fff;
    caret-color: var(--kui-gold-a);
    box-sizing: border-box;
}

.adm-input::placeholder { color: rgba(255, 255, 255, 0.5); }

.adm-field-on { box-shadow: inset 0 0 0 5.58px #8a7440; }
.adm-field-err { box-shadow: inset 0 0 0 5.58px #c43b3b; }

.adm-gap-l { height: 45px; }
.adm-gap-m { height: 26px; }
.adm-gap-s { height: 22px; }

.adm-count {
    position: absolute;
    right: 24px;
    bottom: 6px;
    font-size: 17px;
    line-height: 20px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Вид grid: шаблоны ответа (3 колонки), причины наказания (2 колонки)
   -------------------------------------------------------------------------- */

.adm-grid {
    display: grid;
    gap: 15px 7px;
}

.adm-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.adm-cols-2 .adm-head { margin-bottom: 14px; }
.adm-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 18.5px; }

.adm-tile {
    height: 79.2px;
    padding: 0 12px;
    justify-content: center;
    text-align: center;
    font-size: 22px;
    line-height: 25px;
    white-space: normal;
    overflow: hidden;
}

.adm-tile span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}

/* причина + срок: название слева, срок золотом справа */
.adm-tile-kv {
    justify-content: space-between;
    padding: 0 20px;
    font-size: 29.37px;
    line-height: 34px;
    text-align: left;
    white-space: nowrap;
}

.adm-tile-kv span { display: block; overflow: hidden; text-overflow: ellipsis; }
.adm-tile-kv b { flex: 0 0 auto; margin-left: 14px; font-weight: 700; color: #F0C354; }
.adm-tile-kv.adm-sel b { color: var(--kui-bg); }

/* --------------------------------------------------------------------------
   Вид cmd: форма команды (/mute и т.п.)
   -------------------------------------------------------------------------- */

.adm-form {
    display: flex;
    flex-direction: column;
    gap: 11.5px;
}

.adm-frow {
    display: flex;
    align-items: center;
    gap: 20px;
}

.adm-flabel {
    flex: 0 0 auto;
    font-size: 29.37px;
    line-height: 34px;
    white-space: nowrap;
}

.adm-frow .adm-row { flex: 1 1 auto; min-width: 0; }
.adm-frow .adm-field { padding-left: 32px; }

.adm-presets {
    flex: 1 1 auto;
    display: flex;
    gap: 14px;
}

.adm-presets-full { gap: 10px; }

.adm-preset {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding: 0 6px;
}

/* перед «ИТОГ» в макете пустая строка: 61 без своего времени, 36 со своим */
.adm-sum { margin-top: 49.5px; }
.adm-form-custom .adm-sum { margin-top: 24.5px; }
.adm-sum .adm-row { padding: 0 32px; overflow: hidden; }
.adm-sum .adm-row span { overflow: hidden; text-overflow: ellipsis; }
.adm-sum .adm-ph { color: rgba(240, 195, 84, 0.45); }

/* ==========================================================================
   Слой слежки поверх игры
   ========================================================================== */

.adm-layer {
    position: fixed;
    inset: 0;
    z-index: 8500;
    pointer-events: none;
    overflow: hidden;
    padding: env(safe-area-inset-top) env(safe-area-inset-right)
             env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.adm-stage {
    position: absolute;
    transform-origin: 0 0;
    font-family: var(--kui-font);
    color: #fff;
}

.adm-stage .adm-live { pointer-events: auto; }
.adm-hide { display: none !important; }

/* --- статус-плашка: время | иконка счётчик (375 × 58.6) --- */
.adm-stat {
    position: absolute;
    left: 50%;
    top: 8px;
    width: 375px;
    height: 58.6px;
    margin-left: -187.5px;
    background: rgba(28, 29, 34, 0.5);
    border-radius: 35.8px;
    font-weight: 500;
    font-size: 27.19px;
    line-height: 31px;
}

.adm-stat-time {
    position: absolute;
    left: 23.5px;
    top: 13.8px;
    width: 218.3px;
    text-align: center;
    white-space: nowrap;
}

.adm-stat-div {
    position: absolute;
    left: 255.7px;
    top: 11.4px;
    width: 4.32px;
    height: 35.8px;
    background: var(--kui-line);
    border-radius: 2px;
}

.adm-stat-ic {
    position: absolute;
    left: 275px;
    top: 13.9px;
    width: 31px;
    height: 31px;
}

.adm-stat-n {
    position: absolute;
    left: 316px;
    top: 13.8px;
    min-width: 40px;
    white-space: nowrap;
    color: #fff;
}

.adm-stat-on .adm-stat-n { color: #F0C354; }

.adm-sic-f { fill: var(--kui-line); }
.adm-sic-x { fill: rgba(255, 255, 255, 0.7); }
.adm-stat-on .adm-sic-f { fill: url(#admGoldH); }
.adm-stat-on .adm-sic-x { fill: #212228; }
/* «!» в папке — дырка в форме, сквозь неё видна плашка */

/* --- ник / обновить / выход (500 × 61.1) --- */
.adm-who {
    position: absolute;
    left: 50%;
    bottom: 127px;
    width: 500px;
    height: 61.1px;
    margin-left: -250px;
}

.adm-nick {
    position: absolute;
    left: 0;
    top: 0;
    width: 273.7px;
    height: 61.1px;
    background: #1C1D22;
    border-radius: 37.6px;
    font-weight: 500;
}

.adm-nick-id {
    position: absolute;
    left: 19.6px;
    top: 10px;
    width: 53px;
    text-align: center;
    font-size: 35.18px;
    line-height: 41px;
    color: #FFBC37;
}

.adm-nick-div {
    position: absolute;
    left: 89.6px;
    top: 11.8px;
    width: 4.53px;
    height: 37.55px;
    background: var(--kui-line);
    border-radius: 2px;
}

.adm-nick-n {
    position: absolute;
    left: 102px;
    right: 14px;
    top: 14px;
    text-align: center;
    font-size: 28.55px;
    line-height: 33px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adm-refresh {
    position: absolute;
    left: 290px;
    top: 0;
    width: 61.1px;
    height: 61.1px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--kui-gold-a) 0%, var(--kui-gold-b) 100%);
    cursor: pointer;
}

.adm-refresh::after {
    content: "";
    position: absolute;
    left: 11px;
    top: 12px;
    width: 37px;
    height: 39px;
    background: #212228;
    -webkit-mask: url("assets/adm-refresh.png?v=20261005a") center / 100% 100% no-repeat;
    mask: url("assets/adm-refresh.png?v=20261005a") center / 100% 100% no-repeat;
}

.adm-refresh:active { transform: rotate(-40deg); transition: transform 0.15s; }

.adm-exit {
    position: absolute;
    left: 367.5px;
    top: 0;
    width: 132.5px;
    height: 61.1px;
    background: var(--kui-red);
    border-radius: 37.6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 28.55px;
    line-height: 33px;
    cursor: pointer;
}

.adm-exit:active, .adm-act:active, .adm-arrow:active, .adm-ibtn:active { filter: brightness(1.15); }

/* --- ряд наказаний: ‹ KICK MUTE JAIL WARN SLAP BAN › (771 × 93) --- */
.adm-acts {
    position: absolute;
    left: 50%;
    bottom: 18px;
    width: 771px;
    height: 93px;
    margin-left: -385.5px;
}

.adm-arrow {
    position: absolute;
    top: 25px;
    width: 43px;
    height: 43px;
    border-radius: 5.4px;
    background: linear-gradient(90deg, var(--kui-gold-a) 0%, var(--kui-gold-b) 100%);
    cursor: pointer;
}

.adm-arrow svg { position: absolute; left: 0; top: 0; }
.adm-arrow-l { left: 0; }
.adm-arrow-r { right: 0; }

.adm-act-row {
    position: absolute;
    left: 72px;
    top: 0;
    width: 627px;
    height: 93px;
    display: flex;
    gap: 13.8px;
}

.adm-act {
    position: relative;
    flex: 0 0 93px;
    height: 93px;
    background: #1C1D22;
    border-radius: 11.6px;
    cursor: pointer;
}

.adm-act-red { background: var(--kui-red); }

.adm-act-ic {
    position: absolute;
    background: #F0C354;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.adm-act-red .adm-act-ic { background: #fff; }

.adm-act-x { position: absolute; background: #fff; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }

.adm-act-n {
    position: absolute;
    left: 0;
    right: 0;
    top: 62px;
    text-align: center;
    font-weight: 500;
    font-size: 16.96px;
    line-height: 20px;
}

/* --- «Информация об игроке» (290 × 522) --- */
.adm-info {
    position: absolute;
    right: 33px;
    top: 78px;
    width: 290px;
    height: 522px;
    background: rgba(28, 29, 34, 0.5);
    border-radius: 16px;
}

.adm-info-t {
    position: absolute;
    left: 16.5px;
    top: 23px;
    width: 257px;
    text-align: center;
    font-weight: 700;
    font-size: 24px;
    line-height: 28px;
    color: #F0C354;
}

.adm-irow {
    position: absolute;
    left: 31px;
    right: 33px;
    height: 23px;
    font-size: 20px;
    line-height: 23px;
}

.adm-irow-ic {
    position: absolute;
    left: 0;
    background: #F0C354;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

.adm-irow-n {
    position: absolute;
    left: 28px;
    top: 0;
    font-weight: 400;
    white-space: nowrap;
}

.adm-irow-v {
    position: absolute;
    right: 0;
    top: 0;
    font-weight: 700;
    white-space: nowrap;
}

.adm-ibtn {
    position: absolute;
    left: 31px;
    width: 228px;
    height: 39px;
    border-radius: 10.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 24px;
    line-height: 28px;
    padding-bottom: 3px;
    box-sizing: border-box;
    cursor: pointer;
}

.adm-ibtn-stat {
    top: 423px;
    background: linear-gradient(90deg, var(--kui-gold-a) 0%, var(--kui-gold-b) 100%);
    color: var(--kui-bg);
}

.adm-ibtn-form {
    top: 471px;
    background: #212228;
    box-shadow: inset 0 0 0 3px var(--kui-line);
    color: #fff;
}

/* Тач-зона под палец для мелких кнопок слоя (масштаб слоя ~0.4 на телефоне) */
.adm-layer .kui-tap::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: max(100%, calc(44px / var(--adm-scale, 1)));
    height: max(100%, calc(44px / var(--adm-scale, 1)));
}
