/* ===== Раздел «Все кейсы»: заголовок и фильтры ===== */
.cases {
  --ease-out: cubic-bezier(0.230, 1, 0.320, 1);
  margin-top: 28px;
  scroll-margin-top: calc(var(--header-h) + 12px);
}
@media (min-width: 761px) {
  .cases { margin-top: 40px; }
}

/* ---------- Заголовок ---------- */
.cases__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cases__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font: 900 26px/1.100 var(--font-title);
  letter-spacing: -0.010em;
}
.cases__mark {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: linear-gradient(145deg, #8cc8ff, var(--accent) 50%, var(--accent-deep));
  box-shadow: inset 0 1px 0 #ffffff70, 0 6px 18px rgb(var(--accent-rgb) / 0.450);
  rotate: -6deg;
}
.cases__mark svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 0 #00000040); }
.cases__title small {
  align-self: flex-end;
  margin: 0 0 3px -4px;
  font: 800 13px/1 var(--font-title);
  color: var(--text-3);
}
@media (min-width: 761px) {
  .cases__title { font-size: 34px; gap: 14px; }
  .cases__mark { width: 48px; height: 48px; border-radius: 15px; }
  .cases__mark svg { width: 26px; height: 26px; }
  .cases__title small { font-size: 15px; margin-bottom: 5px; }
}

/* «Как играть?» */
.howbtn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 6px;
  border: 0;
  border-radius: 20px;
  background: rgba(245, 245, 250, 0.040);
  box-shadow: inset 0 0 0 1px #ffffff1a;
  font: 800 13px/1 var(--font-title);
  color: #e6e6ea;
  transition: background-color 0.200s, box-shadow 0.200s;
}
.howbtn i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgb(var(--accent-rgb) / 0.180);
  box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / 0.500);
  font: 900 15px/1 var(--font-title);
  font-style: normal;
  color: var(--accent-hi);
  transition: rotate 0.400s var(--ease-out);
}
.howbtn:hover { background: rgba(245, 245, 250, 0.080); box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / 0.500); }
.howbtn:hover i { rotate: 360deg; }
.howbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Панель фильтров ---------- */
.cases__bar {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
@media (min-width: 900px) {
  .cases__bar {
    grid-template-columns: auto minmax(0, 1fr) 280px;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
  }
}

/* переключатель игры с бегунком */
.seg {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: 52px;
  padding: 5px;
  border-radius: 18px;
  background: rgba(245, 245, 250, 0.030);
  box-shadow: inset 0 0 0 1px #ffffff14, inset 0 0 14px #ffffff0a;
}
.seg__thumb {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: var(--w, 0);
  border-radius: 13px;
  background: linear-gradient(135deg, #8cc8ff, var(--accent) 50%, var(--accent-deep));
  box-shadow: inset 0 1px 0 #ffffff66, 0 0 18px rgb(var(--accent-rgb) / 0.450);
  transform: translateX(var(--x, 0));
  transition: transform 0.400s cubic-bezier(0.340, 1.300, 0.500, 1), width 0.400s var(--ease-out);
}
.seg__btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 13px;
  background: none;
  font: 900 14px/1 var(--font-title);
  letter-spacing: 0.020em;
  white-space: nowrap;
  color: var(--text-2);
  transition: color 0.250s;
}
.seg__btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.seg__btn b { font: italic 900 16px/1 var(--font-title); letter-spacing: 0; }
.seg__btn:hover { color: #fff; }
.seg__btn.is-active { color: #fff; text-shadow: 0 1px 0 #00000040; }
.seg__btn:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: -2px; }
@media (min-width: 900px) {
  .seg { grid-auto-columns: auto; }
  .seg__btn { padding: 0 22px; }
}

/* категории */
.chips {
  display: flex;
  gap: 8px;
  margin-inline: calc(var(--page-pad) * -1);
  padding: 2px var(--page-pad);
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 13px;
  background: rgba(245, 245, 250, 0.030);
  box-shadow: inset 0 0 0 1px #ffffff14;
  font: 800 13px/1 var(--font-title);
  color: #c9c9cf;
  transition: color 0.200s, background-color 0.200s, box-shadow 0.200s;
}
.chip svg { width: 16px; height: 16px; opacity: 0.800; }
.chip:hover { color: #fff; background: rgba(245, 245, 250, 0.070); }
.chip.is-active {
  color: #fff;
  background: rgb(var(--accent-rgb) / 0.160);
  box-shadow: inset 0 0 0 1.500px var(--accent), 0 0 16px rgb(var(--accent-rgb) / 0.250);
}
.chip.is-active svg { opacity: 1; color: var(--accent-hi); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 900px) {
  .chips { margin-inline: 0; padding-inline: 2px; -webkit-mask: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
}

/* поиск */
.search {
  position: relative;
  display: flex;
  align-items: center;
  height: 46px;
  border-radius: 15px;
  background: rgba(245, 245, 250, 0.030);
  box-shadow: inset 0 0 0 1px #ffffff14;
  transition: box-shadow 0.200s, background-color 0.200s;
}
.search:focus-within {
  background: rgba(245, 245, 250, 0.050);
  box-shadow: inset 0 0 0 1.500px var(--accent), 0 0 18px rgb(var(--accent-rgb) / 0.200);
}
.search__ico {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-2);
  pointer-events: none;
  transition: color 0.200s;
}
.search:focus-within .search__ico { color: var(--accent-hi); }
.search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 40px 0 42px;
  border: 0;
  background: none;
  font: 700 14px/1 var(--font-title);
  color: #fff;
  outline: none;
}
.search__input::placeholder { color: var(--text-3); }
.search__input::-webkit-search-cancel-button { display: none; }
.search__clear {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: #ffffff14;
  color: #fff;
  transition: background-color 0.200s;
}
.search__clear svg { width: 14px; height: 14px; }
.search__clear:hover { background: #ffffff29; }
.search__clear[hidden] { display: none; }

/* место под сетку кейсов */
.cases__grid { margin-top: 16px; min-height: 40px; }

/* ---------- Окно «Как играть» ---------- */
.modal {
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background:
    radial-gradient(90% 60% at 100% 0%, rgb(var(--accent-rgb) / 0.220), transparent 70%),
    #18191c;
  box-shadow: inset 0 0 0 1px #ffffff1a, 0 30px 80px #000000b3;
  color: #fff;
  overflow: auto;
}
.modal::backdrop { background: #08080ab8; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal[open] { animation: modal-in 0.350s cubic-bezier(0.230, 1, 0.320, 1); }
@keyframes modal-in {
  0% { opacity: 0; transform: translateY(18px) scale(0.960); }
  100% { opacity: 1; transform: none; }
}
.modal__in { padding: 22px 20px 20px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal__title { margin: 0; font: 900 22px/1.200 var(--font-title); }
.modal__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #ffffff14;
  color: #fff;
  transition: background-color 0.200s, rotate 0.300s;
}
.modal__close svg { width: 16px; height: 16px; }
.modal__close:hover { background: #ffffff29; rotate: 90deg; }
.modal__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.steps { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 14px 14px 14px 62px;
  border-radius: 16px;
  background: #ffffff0a;
  box-shadow: inset 0 0 0 1px #ffffff0f;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(145deg, #8cc8ff, var(--accent) 50%, var(--accent-deep));
  box-shadow: inset 0 1px 0 #ffffff70;
  font: italic 900 18px/1 var(--font-title);
  translate: 0 -50%;
}
.steps b { font: 800 15px/1.300 var(--font-title); }
.steps span { font: 500 13px/1.400 var(--font-text); color: var(--text-2); }
.modal__ok { width: 100%; margin-top: 16px; --h: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .seg__thumb { transition: none; }
  .modal[open] { animation: none; }
}

/* ---------- подсветка переключателя игр: у каждой игры свой цвет ---------- */
.seg { --g: var(--accent); --g2: #8cc8ff; --g3: var(--accent-deep);
  transition: box-shadow 0.350s; 
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g) 38%, #ffffff14), inset 0 0 14px #ffffff0a, 0 0 22px color-mix(in srgb, var(--g) 22%, transparent); }
.seg[data-game="cs2"] { --g: #ff9d2e; --g2: #ffc978; --g3: #e0661a; }
.seg[data-game="standoff"] { --g: #38b6f0; --g2: #8fdcff; --g3: #1a78d6; }
.seg__thumb {
  background: linear-gradient(135deg, var(--g2), var(--g) 50%, var(--g3));
  box-shadow: inset 0 1px 0 #ffffff66, 0 0 20px color-mix(in srgb, var(--g) 60%, transparent), 0 0 44px color-mix(in srgb, var(--g) 28%, transparent);
  transition: transform 0.400s cubic-bezier(0.340, 1.300, 0.500, 1), width 0.400s var(--ease-out), box-shadow 0.350s;
}
/* невыбранные игры слегка светятся своим цветом, при наведении — ярче */
.seg__btn[data-game="cs2"]:not(.is-active) { color: color-mix(in srgb, #ff9d2e 55%, var(--text-2)); }
.seg__btn[data-game="standoff"]:not(.is-active) { color: color-mix(in srgb, #38b6f0 55%, var(--text-2)); }
.seg__btn[data-game="cs2"]:not(.is-active):hover { color: #ffb45c; text-shadow: 0 0 12px #ff9d2e99; }
.seg__btn[data-game="standoff"]:not(.is-active):hover { color: #6fcbf5; text-shadow: 0 0 12px #38b6f099; }
.seg__btn.is-active { text-shadow: 0 1px 0 #00000055, 0 0 14px #ffffff66; }
/* значок у заголовка «Все кейсы» подхватывает цвет выбранной игры */
.cases[data-game="cs2"] .cases__mark { background: linear-gradient(145deg, #ffc978, #ff9d2e 50%, #e0661a); box-shadow: inset 0 1px 0 #ffffff70, 0 6px 18px #ff9d2e73; }
.cases[data-game="standoff"] .cases__mark { background: linear-gradient(145deg, #8fdcff, #38b6f0 50%, #1a78d6); box-shadow: inset 0 1px 0 #ffffff70, 0 6px 18px #38b6f073; }
.cases__mark { transition: box-shadow 0.350s; }
@media (prefers-reduced-motion: reduce) { .seg, .seg__thumb, .cases__mark { transition: none; } }

/* ===== «Все кейсы»: новый заголовок и переключатель игр с логотипами ===== */
.cases__head { padding-bottom: 2px; }
/* «Как играть» — стеклянная капсула с голубой кромкой */
.howbtn { height: 38px; padding: 0 14px 0 5px; background: linear-gradient(180deg, #ffffff0f, #ffffff05);
  box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / 0.350), 0 4px 14px #0000004d; color: #fff; }
.howbtn i { width: 28px; height: 28px; color: #fff;
  background: linear-gradient(145deg, #8cc8ff, var(--accent) 55%, var(--accent-deep)); box-shadow: inset 0 1px 0 #ffffff73, 0 0 10px rgb(var(--accent-rgb) / 0.450); }

/* переключатель: три плитки с логотипами */
.seg { height: 60px; padding: 5px; gap: 4px; border-radius: 18px;
  background: linear-gradient(180deg, #111a2b, #0b101b); box-shadow: inset 0 0 0 1px #ffffff12, inset 0 1px 0 #ffffff0d, 0 8px 22px #00000059; }
.seg__thumb { top: 5px; bottom: 5px; border-radius: 13px;
  background: radial-gradient(90% 120% at 50% 100%, color-mix(in srgb, var(--g) 34%, transparent), transparent 70%), color-mix(in srgb, var(--g) 14%, #0d1424);
  box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--g) 80%, transparent), 0 0 18px color-mix(in srgb, var(--g) 35%, transparent); }
.seg__thumb::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 34%; height: 3px; translate: -50% 0; border-radius: 3px 3px 0 0;
  background: var(--g); box-shadow: 0 0 10px var(--g); }
.seg__btn { gap: 7px; padding: 0 10px; color: #6c778c; text-shadow: none !important; transition: color 0.250s; }
.seg__btn[data-game="cs2"]:not(.is-active) { color: color-mix(in srgb, #ff9d2e 35%, #6c778c); }
.seg__btn[data-game="standoff"]:not(.is-active) { color: color-mix(in srgb, #38b6f0 40%, #6c778c); }
.seg__btn:not(.is-active):hover { color: #c9d3e6 !important; }
.seg__btn.is-active { color: #fff; }
.seg__btn[data-game="cs2"].is-active { color: #ffc27a; }
.seg__btn[data-game="standoff"].is-active { color: #8fdcff; }
.seg__btn.is-active > * { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--g) 70%, transparent)); }
/* «Все игры» */
.gsw__all { width: 17px !important; height: 17px !important; fill: currentColor; }
.gsw__txt { font: 800 13px/1 var(--font-title); white-space: nowrap; }
/* CS2 — фирменная надпись */
.gsw__cs2 { width: auto !important; height: 17px !important; fill: currentColor; }
/* Standoff 2 — своя надпись: слово и «2» в плашке */
.gsw__so { display: inline-flex; align-items: center; gap: 4px; font: italic 900 14px/1 var(--font-title); letter-spacing: 0.050em; white-space: nowrap; }
.gsw__so i { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; font-style: normal; font-size: 12px; letter-spacing: 0;
  background: currentColor; }
.gsw__so i::first-letter { color: #0b101b; }
.gsw__so i { color: inherit; }
@media (min-width: 761px) {
  .seg__btn { padding: 0 22px; }
  .gsw__cs2 { height: 19px !important; }
  .gsw__so { font-size: 15px; }
}
@media (max-width: 360px) {
  .gsw__txt { display: none; }
}
/* «2» в Standoff — в обводке цвета надписи */
.gsw__so i { background: none; box-shadow: inset 0 0 0 1.700px currentColor; }

/* Standoff 2 в переключателе — официальный логотип: невыбранный приглушён, выбранный в цвете со свечением */
.gsw__so-img { display: block; height: 15px; width: auto; filter: grayscale(1) brightness(0.900); opacity: 0.600; transition: filter 0.250s, opacity 0.250s; }
.seg__btn[data-game="standoff"]:not(.is-active):hover .gsw__so-img { opacity: 0.900; filter: grayscale(0.300); }
.seg__btn[data-game="standoff"].is-active .gsw__so-img { opacity: 1; filter: drop-shadow(0 0 8px #ff4a3d66); }
@media (min-width: 761px) { .gsw__so-img { height: 18px; } }
