/* GIFTGAMES1001 — отдельный слой; game-kit.css и чужие обводки не меняем. */
.gg-control { display: grid; gap: 10px; flex: 0 0 auto; min-width: 0; font-family: var(--font-body, system-ui, sans-serif); }
.gg-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2, #202737); }
.gg-modes button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px; border: 0; border-radius: 10px; color: var(--text-2, #aeb8d0); background: transparent; font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1.2; cursor: pointer; }
.gg-modes button[aria-pressed="true"] { background: var(--primary, #7552f7); color: #fff; }
.gg-modes button:disabled { opacity: .65; cursor: default; }
.gg-choice-wrap { display: grid; gap: 7px; }
.gg-choice-wrap[hidden], .gg-access[hidden], .gg-recheck[hidden] { display: none; }
.gg-choice { display: flex; align-items: center; gap: 10px; min-height: 64px; width: 100%; min-width: 0; padding: 7px 10px; border: 1px solid var(--border, #333d52); border-radius: 14px; background: var(--surface, #171d2b); color: var(--text, #eef1fc); text-align: left; font-family: inherit; cursor: pointer; }
.gg-choice > span:not(.gg-thumb) { min-width: 0; flex: 1; }
.gg-choice b, .gg-choice small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gg-choice b { font-size: 13px; line-height: 1.4; }
.gg-choice small { color: var(--text-2, #aeb8d0); font-size: 11px; line-height: 1.5; }
.gg-thumb { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 10px; background: var(--rar-full), #171d2b; box-shadow: var(--rar-rim-sm); }
.gg-thumb img { width: 42px; height: 42px; object-fit: contain; }
.gg-status, .gg-access { margin: 0; font-size: 11px; line-height: 1.45; color: var(--text-2, #aeb8d0); }
.gg-access { padding: 6px 2px; }
.gg-recheck { justify-self: start; background: transparent; color: var(--text, #eef1fc); border: 0; padding: 0; text-decoration: underline; font: inherit; cursor: pointer; }
.gg-gift .gk-panel__body > .gk-amount, .gg-gift .gk-panel__body > .gk-tabs,
.gg-gift .rk-auto, .gg-gift .rk-autorun, .gg-gift .jm-auto, .gg-gift .jm-wallet,
.gg-gift .rk-wallet, .gg-gift .ar-refill { display: none; }
.gg-gift [data-gk-btn="allin"] { display: none; }
.gg-card, .gg-thumb { --rs-g: var(--rar0-g); --rs-h: var(--rar0-h); }
.gg-card.t1, .gg-thumb.t1 { --rs-g: var(--rar1-g); --rs-h: var(--rar1-h); }
.gg-card.t2, .gg-thumb.t2 { --rs-g: var(--rar2-g); --rs-h: var(--rar2-h); }
.gg-card.t3, .gg-thumb.t3 { --rs-g: var(--rar3-g); --rs-h: var(--rar3-h); }
.gg-card.t4, .gg-thumb.t4 { --rs-g: var(--rar4-g); --rs-h: var(--rar4-h); }
.gg-card.t5, .gg-thumb.t5 { --rs-g: var(--rar5-g); --rs-h: var(--rar5-h); }
.gg-card { position: relative; min-width: 0; display: grid; justify-items: center; align-content: start; gap: 5px; padding: 12px 8px; border: 0; border-radius: 16px; color: var(--text, #eef1fc); background: var(--rar-full), var(--surface, #171d2b); box-shadow: var(--rar-rim-sm); text-align: center; font-family: inherit; }
button.gg-card { cursor: pointer; }
.gg-card img { display: block; width: 100%; height: 108px; object-fit: contain; }
.gg-card b { max-width: 100%; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.gg-card small { color: var(--text-2, #aeb8d0); font-size: 10px; }
.gg-card strong { white-space: nowrap; font-size: 13px; }
.gg-card[aria-disabled="true"] { opacity: .62; cursor: default; }
.gg-reason { font-size: 10px; line-height: 1.25; color: var(--text-2, #aeb8d0); }
.gg-card.is-selected { outline: 2px solid var(--primary, #7552f7); outline-offset: -2px; }
.gg-dialog { width: min(620px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); margin: auto; box-sizing: border-box; padding: 20px; border: 1px solid var(--border, #333d52); border-radius: 22px; color: var(--text, #eef1fc); background: var(--bg, #121929); font-family: var(--font-body, system-ui, sans-serif); overflow: auto; }
.gg-dialog::backdrop { background: rgb(5 8 18 / .82); }
.gg-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gg-dialog header small { font-size: 10px; letter-spacing: .08em; color: var(--text-2, #aeb8d0); }
.gg-dialog h2 { margin: 5px 0 0; font-size: 22px; }
.gg-dialog [data-gg-close], .gg-result__close { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; color: var(--text, #eef1fc); background: var(--surface-2, #202737); cursor: pointer; }
.gg-limits, .gg-dialog-error { font-size: 12px; line-height: 1.4; color: var(--text-2, #aeb8d0); }
.gg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.gg-empty { grid-column: 1 / -1; padding: 30px 10px; text-align: center; font-size: 14px; line-height: 1.6; }
.gg-result { position: absolute; z-index: 12; inset: 0; display: grid; place-items: center; padding: 12px; background: rgb(5 8 18 / .72); }
.gg-result__card { position: relative; display: grid; justify-items: center; gap: 14px; width: min(280px, 100%); max-height: 100%; box-sizing: border-box; padding: 22px 18px 18px; border-radius: 22px; background: var(--bg, #121929); color: var(--text, #eef1fc); text-align: center; overflow: auto; }
.gg-result h3, .gg-result p { margin: 0; }
.gg-result h3 { font-size: 20px; padding: 0 20px; }
.gg-result p { font-size: 12px; line-height: 1.5; }
.gg-result .gg-card { width: 180px; }
.gg-result .gg-card img { height: 144px; }
.gg-result__close { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; }
.gg-result__done { min-height: 42px; width: 100%; border: 0; border-radius: 12px; color: #fff; background: var(--primary, #7552f7); font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1.2; cursor: pointer; }
.gg-gift.gg-arena-placed [data-gk-cta], .gg-gift.gg-arena-placed [data-gk-btn="allin"] { pointer-events: none; opacity: .6; }
.gg-upgrade-switch { max-width: 520px; padding: 10px 12px; margin: 0 auto; }
.gg-upgrade-host { display: none; }
body.gg-upgrade-on > #app { display: none; }
body.gg-upgrade-on { min-height: 0; height: auto; }
body.gg-upgrade-on .gg-upgrade-host { display: block; }
.gg-upgrade-host .gk { --gk-top: 210px; min-height: 480px; }
.gg-upgrade-host .gg-choice-wrap { display: none; }
.gg-upgrade-switch .gg-choice { display: none; }
.gg-upgrade-switch .gg-control { gap: 6px; }
/* Переключатель занимает часть прежней высоты: рублёвая кнопка остаётся на экране. */
@media (max-width: 899.98px) {
  body:has(> .gg-upgrade-switch):not(.gg-upgrade-on) #app .up.up9 { height: calc(100dvh - var(--gg-nav-h, 64px)); }
}
.gg-upgrade-host .gk-shell--side { height: calc(var(--up-vh, 100dvh) - var(--gg-nav-h, 64px)); }
.gg-upgrade-host [data-gg-source], .gg-upgrade-host [data-gg-target] { min-height: 52px; }
.gg-up-controls { display: grid; gap: 12px; }
.gg-submodes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gg-submodes button { min-height: 38px; padding: 8px; border: 1px solid var(--border, #333d52); border-radius: 10px; background: var(--surface, #171d2b); color: var(--text, #eef1fc); font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.2; cursor: pointer; }
.gg-submodes button[aria-pressed="true"] { border-color: var(--primary, #7552f7); color: var(--primary-text, #bcaaff); }
.gg-up-note, .gg-real-note { font-size: 12px; line-height: 1.5; color: var(--text-2, #aeb8d0); }
.gg-up-field { height: 100%; min-height: 300px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; padding: 24px; }
.gg-up-field .gg-card { width: min(210px, 100%); justify-self: center; }
.gg-up-field .gg-card img { height: clamp(80px, 13vw, 170px); }
.gg-dial { width: 150px; height: 150px; display: grid; place-items: center; position: relative; }
.gg-dial svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.gg-dial b { font-size: 20px; }
.gg-dial.is-playing svg { animation: gg-turn 1.2s ease-out; }
@keyframes gg-turn { from { transform: rotate(-90deg); } to { transform: rotate(990deg); } }
.gg-real-mines { height: 100%; display: grid; place-content: center; grid-template-columns: repeat(5, minmax(32px, 85px)); grid-auto-rows: minmax(32px, 85px); gap: 8px; padding: 20px; }
.gg-real-mines button { border: 1px solid var(--border, #333d52); border-radius: 12px; background: var(--surface-2, #202737); color: var(--text, #eef1fc); cursor: pointer; font-size: 26px; }
.gg-real-mines button[data-open="gem"] { background: var(--primary, #7552f7); }
.gg-real-jump { position: relative; height: 100%; min-height: 280px; }
.gg-real-jump canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.gg-real-jump strong { position: absolute; top: 22px; left: 0; right: 0; text-align: center; font-size: 40px; }
.gg-control button:focus-visible, .gg-dialog button:focus-visible, .gg-result button:focus-visible { outline: 2px solid var(--primary-text, #bcaaff); outline-offset: 3px; }
/* У «Мин» на узком экране панель разложена по именованным ячейкам.
   Выбор подарка получает собственный ряд, а поле занимает остаток высоты. */
@container gk (max-width: 899.98px) {
  #app .mn-game .gg-control { grid-area: gift; }
  #app .mn-game .gk-shell--side > .gk-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto var(--mn-cta) var(--mn-r2) var(--mn-r3) var(--mn-r4);
    grid-template-areas: "gift gift" "cta cta" "amt amt" "cnt tabs" "r1 r2";
  }
  #app .mn-game .mn-presets { grid-row: 5; }
  #app .mn-game.gg-gift .gk-shell--side > .gk-panel {
    grid-template-rows: auto var(--mn-cta) var(--mn-r3) var(--mn-r4);
    grid-template-areas: "gift gift" "cta cta" "cnt cnt" "r1 r2";
  }
  #app .mn-game.gg-gift .mn-presets { grid-row: 4; }
  /* MINI1002-gift-look: no fixed 220 px floor — it pushed the gift panel out of the Telegram frame; the kit's own floor stays. */
  #app .mn-game.gk--fit-frame .gk-shell--side > .gk-stage {
    flex: 1 1 auto; height: auto;
  }
}
@media (max-width: 639.98px) {
  .gg-dialog { padding: 16px; }
  .gg-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gg-dialog .gg-card img { height: 100px; }
  .gg-upgrade-switch { padding: 7px 8px; }
  .gg-upgrade-host .gk { --gk-top: 165px; }
  .gg-up-field { padding: 14px 10px; gap: 8px; min-height: 240px; }
  .gg-dial { width: 70px; height: 70px; }
  .gg-dial b { font-size: 14px; }
  .gg-up-field .gg-card { padding: 9px 5px; }
  .gg-up-field .gg-card b { font-size: 11px; }
  .gg-up-field .gg-card strong { font-size: 11px; }
  .gg-up-field .gg-card img { height: 78px; }
  .gg-real-mines { grid-template-columns: repeat(5, minmax(32px, 58px)); grid-auto-rows: 52px; gap: 6px; padding: 12px; }
  .gg-result__card { gap: 8px; padding: 20px 14px 12px; }
  .gg-result .gg-card img { height: 94px; }
}
@media (prefers-reduced-motion: reduce) { .gg-dial.is-playing svg { animation: none; } }

/* GIFTPREVIEW1001: «Заберёте сейчас: подарок» — ровно тот, что выдаст забор */
.gg-take { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; line-height: 1.3; color: var(--text-2, #B9C0DA); min-width: 0; }
.gg-take[hidden] { display: none; }
.gg-take b { color: var(--text, #FFFFFF); font-weight: 700; }
.gg-take .gg-thumb { flex: 0 0 34px; width: 34px; height: 34px; }

/* MINI1002-gift-look: phone only (a desktop game frame is >= 928 px) — readable gift text and a 44 px close zone. */
@media (max-width: 899.98px) {
  .gg-choice small { font-size: 13px; line-height: 1.4; }
  .gg-status, .gg-access { font-size: 14px; line-height: 1.4; }
  .gg-card small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .gg-reason { font-size: 12px; line-height: 1.3; }
  .gg-dialog header small { font-size: 12px; }
  .gg-result p { font-size: 13px; }
  .gg-take { font-size: 13px; }
  .gg-up-field .gg-card b, .gg-up-field .gg-card strong { font-size: 12px; }
  .gg-result__card--phone .gg-result__close { top: 6px; right: 6px; width: 40px; height: 40px; flex-basis: 40px; }
  .gg-result__card--phone .gg-result__close::after { content: ''; position: absolute; inset: -4px; }
}

/* N2-gift-2 (ночь 02.10, единая система ставок подарком): встроенный выбор подарка на телефоне — ОДНА строка чипов во всех играх
   (общий список панели, Мины, Plinko, Прыгун, окно выбора — шторка Ракетки, «Выбрать подарок»): картинка 28 px + имя + цена, ровно 3 в ряд, листание вбок по 3 (snap), 38 px — как плашки Мин.
   Было: у Коровки/Мерджа/Скретча сетка 3 в ряд по 131 px до 300 px (сцена Коровки сжималась 472 → 324 px, у Мерджа и Скретча
   кнопка ставки уезжала за низ), у Мин и Plinko — свои ленты с обрезанной карточкой. Панель подарком теперь не выше рублёвой.
   Порядок и годность — прежние. :not(#_) — перебить правила игр, не трогая их файлы. */
@media (max-width: 767.98px) {
  html body :is(:is(.gg-panel-inline, .gk.gk-pseg-on) :is(.gg-list, .gk-pgifts__list), .mn-gift-list, .pk-pay-list, .jm-gifts, .gg-prod-picker .gg-list):not(#_):not([hidden]) {
    display: flex; gap: 6px; max-height: none; margin: 0 0 2px; padding: 1px; grid-template-columns: none;
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
  html body :is(:is(.gg-panel-inline, .gk.gk-pseg-on) :is(.gg-list, .gk-pgifts__list), .mn-gift-list, .pk-pay-list, .jm-gifts, .gg-prod-picker .gg-list):not(#_)::-webkit-scrollbar { display: none; }
  html body :is(:is(.gg-panel-inline, .gk.gk-pseg-on) :is(.gg-list, .gk-pgifts__list), .mn-gift-list, .pk-pay-list, .jm-gifts, .gg-prod-picker .gg-list) .gg-card:not(#_) {
    flex: 0 0 calc((100% - 12px) / 3); box-sizing: border-box; min-width: 0; height: 38px; scroll-snap-align: start;
    display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 7px; row-gap: 1px;
    align-content: center; align-items: center; justify-items: start; padding: 4px 8px; text-align: left;
    border-radius: 14px; border: 1px solid rgb(255 255 255 / .13); background: rgb(255 255 255 / .04); box-shadow: none; }
  html body :is(:is(.gg-panel-inline, .gk.gk-pseg-on) :is(.gg-list, .gk-pgifts__list), .mn-gift-list, .pk-pay-list, .jm-gifts, .gg-prod-picker .gg-list) .gg-card.is-selected:not(#_) { border-color: #a297ff; background: rgb(124 140 255 / .18); }
  html body :is(:is(.gg-panel-inline, .gk.gk-pseg-on) :is(.gg-list, .gk-pgifts__list), .mn-gift-list, .pk-pay-list, .jm-gifts, .gg-prod-picker .gg-list) .gg-card:not(#_)::before, html body :is(:is(.gg-panel-inline, .gk.gk-pseg-on) :is(.gg-list, .gk-pgifts__list), .mn-gift-list, .pk-pay-list, .jm-gifts, .gg-prod-picker .gg-list) .gg-card:not(#_)::after { display: none; }
  html body :is(:is(.gg-panel-inline, .gk.gk-pseg-on) :is(.gg-list, .gk-pgifts__list), .mn-gift-list, .pk-pay-list, .jm-gifts, .gg-prod-picker .gg-list) .gg-card:not(#_) img { grid-row: 1 / 3; width: 28px; height: 28px; object-fit: contain; margin: 0; }
  html body :is(:is(.gg-panel-inline, .gk.gk-pseg-on) :is(.gg-list, .gk-pgifts__list), .mn-gift-list, .pk-pay-list, .jm-gifts, .gg-prod-picker .gg-list) .gg-card:not(#_) b {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.2; text-align: left; }
  html body :is(:is(.gg-panel-inline, .gk.gk-pseg-on) :is(.gg-list, .gk-pgifts__list), .mn-gift-list, .pk-pay-list, .jm-gifts, .gg-prod-picker .gg-list) .gg-card:not(#_) :is(small, .gg-reason) { display: none; }
  html body :is(:is(.gg-panel-inline, .gk.gk-pseg-on) :is(.gg-list, .gk-pgifts__list), .mn-gift-list, .pk-pay-list, .jm-gifts, .gg-prod-picker .gg-list) .gg-card:not(#_) strong { font-size: 12px; line-height: 1.2; color: var(--text, #eef1fc); }
  /* N2-gift-3: имя и цена — ровно по одной строке и по центру плашки во всех играх (у Коровки COWPANEL имя было блоком в две строки
     высотой 29 px, цена уезжала за нижний край). !important — стили игр сильнее общих. */
  html body :is(:is(.gg-panel-inline, .gk.gk-pseg-on) :is(.gg-list, .gk-pgifts__list), .mn-gift-list, .pk-pay-list, .jm-gifts, .gg-prod-picker .gg-list) .gg-card:not(#_) :is(b, strong) { display: block !important; min-height: 0 !important; height: auto !important;
    margin: 0 !important; padding: 0 !important; -webkit-line-clamp: unset !important; white-space: nowrap !important; align-self: center !important; }
  html body :is(:is(.gg-panel-inline, .gk.gk-pseg-on) :is(.gg-list, .gk-pgifts__list), .mn-gift-list, .pk-pay-list, .jm-gifts, .gg-prod-picker .gg-list) .gg-card:not(#_) b { align-self: end !important; }
  html body :is(:is(.gg-panel-inline, .gk.gk-pseg-on) :is(.gg-list, .gk-pgifts__list), .mn-gift-list, .pk-pay-list, .jm-gifts, .gg-prod-picker .gg-list) .gg-card:not(#_) strong { align-self: start !important; }
}

/* N2-gift-real-7 (№43): один вид сегмента «Рублями · Подарком» во всех играх — как общий .gk-pseg (Мердж/Скретч).
   Было три вида активной кнопки: серая, тёмно-синяя (Арена, Блэкджек), градиент (Прыгун, Plinko); у Коровки — узкий сегмент. */
@media (max-width: 767.98px) {
:is(.gk-pseg, .gg-modes, .jm-src, .pk-pay-tabs):not(#_) {
  display: flex; gap: 6px; width: 100%; box-sizing: border-box; padding: 4px; border-radius: 16px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); box-shadow: none;
}
:is(.gk-pseg, .gg-modes, .jm-src, .pk-pay-tabs):not(#_) > button {
  flex: 1 1 0; min-width: 0; min-height: 36px; height: auto; padding: 9px 4px; border: 0; border-radius: 12px;
  background: transparent; background-image: none; box-shadow: none; color: rgb(180, 189, 214); font-size: 13.5px; font-weight: 600;
}
:is(.gk-pseg, .gg-modes, .jm-src, .pk-pay-tabs):not(#_) > button[aria-pressed="true"] {
  background: rgba(255, 255, 255, .13); background-image: none; color: #eef1fc;
}
}

/* N2-gift-real-11 (№52, предложение N2-gift-help-c4-1): кнопка общего окна итога на телефоне — тот же градиент, что «Поставить …» / «Начать игру» */
@media (max-width: 767.98px) {
  .gg-result .gg-result__done { background: var(--gk-ctl-fill, linear-gradient(100deg, #5B74FE 0%, #6C66FA 50%, #7B5CF0 100%)); }
}
