/* ===== Контракты (страница #contracts) ===== */
.ctr { display: none; --ease-out: cubic-bezier(0.230, 1, 0.320, 1); }
body.is-ctr .ctr { display: block; max-width: 1100px; margin: 0 auto; animation: cview-in 0.400s var(--ease-out); }
body.is-ctr .promo, body.is-ctr .cases, body.is-ctr .cview, body.is-ctr .inv, body.is-ctr .dep,
body.is-ctr .prof, body.is-ctr .upg, body.is-ctr .crash, body.is-ctr .mines { display: none; }

.ctr__head { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; }
.ctr__ico { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 4px 10px rgb(155 109 255 / 0.500)); }
.ctr__title { margin: 0; font: 900 28px/1 var(--font-title); letter-spacing: -0.010em; }
.ctr__how { display: flex; align-items: center; gap: 8px; height: 44px; margin-left: auto; padding: 0 16px 0 10px; border: 0; border-radius: 14px; cursor: pointer;
  font: 800 14px/1 var(--font-title); color: #e6ecfa; white-space: nowrap; background: rgb(255 255 255 / 0.060); box-shadow: inset 0 0 0 1.500px rgb(92 200 255 / 0.400); }
.ctr__how i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font: 900 14px/1 var(--font-title); font-style: normal; color: #0b1a44; background: #e6ecfa; }
.ctr__how:hover { box-shadow: inset 0 0 0 1.500px #7af0ff; }
.ctr__sub { margin: 10px 0 0; font: 700 14px/1.300 var(--font-title); color: #c9d4ee; text-align: center; }

.ctr__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 6px; }
.ctr__grid > * { min-width: 0; }
@media (min-width: 960px) { .ctr__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }

/* крафт-кейс */
.ctr__case { position: relative; width: min(520px, 100%); margin: 0 auto; aspect-ratio: 760 / 549; }
.ctr__crate { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 30px rgb(0 0 0 / 0.550)) drop-shadow(0 0 30px rgb(92 200 255 / 0.250)); }
.ctr__inside { position: absolute; left: 24%; right: 24%; top: 36%; height: 22%; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 2px; pointer-events: none; }
.ctr__inside .ci { width: 19%; aspect-ratio: 4 / 3; display: grid; place-items: center; animation: ci-in 0.350s var(--ease-out); }
.ctr__inside .ci img, .ctr__inside .ci svg { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 4px #000a); }
@keyframes ci-in { from { transform: translateY(-40px) scale(0.600); opacity: 0; } }
.ctr[data-state="craft"] .ctr__crate { animation: crate-shake 0.180s linear infinite; filter: drop-shadow(0 0 40px rgb(122 240 255 / 0.900)) brightness(1.150); }
.ctr[data-state="craft"] .ctr__inside .ci { animation: ci-sink 1.600s var(--ease-out) forwards; }
@keyframes crate-shake { 25% { transform: translate(-3px, 1px) rotate(-0.600deg); } 75% { transform: translate(3px, -1px) rotate(0.600deg); } }
@keyframes ci-sink { to { transform: translateY(20px) scale(0.200); opacity: 0; } }
/* выпавший скин поверх кейса */
.ctr__win { position: absolute; left: 50%; top: 46%; z-index: 3; display: grid; justify-items: center; gap: 4px; width: min(300px, 80%); padding: 12px 14px 14px; border-radius: 20px;
  transform: translate(-50%, -50%); text-align: center; background: rgb(8 12 28 / 0.920); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 2px var(--rc, #5cc8ff), 0 0 40px -8px var(--rc, #5cc8ff); animation: win-in 0.550s var(--ease-out); }
.ctr__win[hidden] { display: none; }
@keyframes win-in { from { transform: translate(-50%, -50%) scale(0.400); opacity: 0; } }
.ctr__win .art { width: 70%; aspect-ratio: 4 / 3; object-fit: contain; filter: drop-shadow(0 8px 14px #000a); }
.ctr__win small { font: 700 12px/1 var(--font-title); color: #9aa6c6; }
.ctr__win b { font: 900 18px/1.150 var(--font-title); color: #fff; }
.ctr__win em { font: 900 22px/1 var(--font-title); font-style: normal; color: #6dffb0; }
.ctr__win em.is-down { color: #ffb35c; }
.ctr__win span { font: 800 12px/1 var(--font-title); color: #c9d4ee; }
.ctr__win button { margin-top: 6px; height: 36px; padding: 0 16px; border: 0; border-radius: 11px; cursor: pointer; font: 800 13px/1 var(--font-title); color: #fff; background: rgb(255 255 255 / 0.100); }

/* панель: сумма, слоты, кнопки */
.ctr__panel { display: grid; gap: 12px; margin-top: 10px; padding: 16px; border-radius: 22px; background: linear-gradient(180deg, #131931, #0c1022); box-shadow: inset 0 0 0 1px #ffffff17; }
.ctr__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 800 16px/1 var(--font-title); color: #9aa6c6; }
.ctr__sum { display: flex; align-items: center; gap: 6px; }
.ctr__sum b, .ctr__cnt b { color: #fff; font-variant-numeric: tabular-nums; }
.ctr__sum .cbal__coin { width: 20px; height: 22px; font-size: 10px; }
.ctr__slots { display: flex; gap: 8px; overflow-x: auto; padding: 6px; border-radius: 16px; background: #080b16; box-shadow: inset 0 0 0 1px #ffffff12; scrollbar-width: thin; }
.cslot { position: relative; flex: 0 0 96px; height: 84px; display: grid; place-items: center; border: 0; border-radius: 13px; cursor: pointer; color: #4d5672; background: rgb(255 255 255 / 0.040);
  box-shadow: inset 0 0 0 1.500px rgb(255 255 255 / 0.080); font: 700 22px/1 var(--font-title); }
.cslot.is-set { background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 70%), #121933; box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--rc) 60%, transparent); }
.cslot .art { width: 80%; height: 54px; object-fit: contain; }
.cslot__p { position: absolute; left: 6px; right: 6px; bottom: 5px; overflow: hidden; font: 800 11px/1 var(--font-title); color: #e6ecfa; white-space: nowrap; text-overflow: ellipsis; }
.cslot__x { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 900 12px/1 var(--font-title); color: #fff; background: #e0344fcc; }
.ctr__range { margin: -2px 0 0; font: 700 13px/1.300 var(--font-title); color: #8592b3; text-align: center; }
.ctr__range b { color: #fff; }
.ctr__rand { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border: 0; border-radius: 15px; cursor: pointer;
  font: 900 16px/1 var(--font-title); color: #c9d4ee; background: rgb(255 255 255 / 0.060); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.100); }
.ctr__rand svg { width: 20px; height: 20px; fill: currentColor; }
.ctr__rand:hover { color: #fff; background: rgb(var(--accent-rgb) / 0.180); }
.ctr__go { height: 58px; border: 0; border-radius: 17px; cursor: pointer; font: 900 18px/1 var(--font-title); color: #fff;
  background: linear-gradient(180deg, #4aa3ff, #2f6dff); box-shadow: inset 0 1px 0 #ffffff66, inset 0 -5px 0 #0003, 0 10px 22px -10px #2f8cff; transition: transform 0.150s, filter 0.200s; }
.ctr__go.is-ready { color: #04210f; background: linear-gradient(180deg, #5cf09a, #18a95f); box-shadow: inset 0 1px 0 #ffffff80, inset 0 -5px 0 #0002, 0 10px 22px -10px #18a95f; }
.ctr__go:active { transform: scale(0.980); }
.ctr__go:disabled { cursor: default; filter: saturate(0.400) brightness(0.700); }
.ctr__msg { margin: 0; font: 700 13px/1.300 var(--font-title); color: #ff8a8a; text-align: center; }
.ctr__msg:empty { display: none; }

/* инвентарь */
.ctr__inv { padding: 16px; border-radius: 22px; background: linear-gradient(180deg, #131931, #0c1022); box-shadow: inset 0 0 0 1px #ffffff17; }
.ctr__invhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.ctr__invhead h2 { margin: 0 auto 0 0; font: 900 22px/1 var(--font-title); }
.ctr__sort { display: flex; gap: 6px; }
.ctr__sort button { height: 36px; padding: 0 12px; border: 0; border-radius: 11px; cursor: pointer; font: 800 13px/1 var(--font-title); color: #9aa6c6; background: rgb(255 255 255 / 0.050);
  box-shadow: inset 0 0 0 1.500px rgb(92 200 255 / 0.250); }
.ctr__sort button.is-on { color: #fff; box-shadow: inset 0 0 0 1.500px #5cc8ff; background: rgb(47 140 255 / 0.180); }
.ctr__items { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; max-height: 520px; overflow-y: auto; scrollbar-width: thin; }
.citem { position: relative; display: grid; justify-items: center; gap: 4px; min-width: 0; padding: 8px 6px 9px; border: 0; border-radius: 14px; cursor: pointer; text-align: center;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--rc) 26%, transparent), transparent 70%), #10162c; box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--rc) 35%, transparent);
  transition: transform 0.150s, box-shadow 0.200s; }
.citem:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.500px var(--rc); }
.citem .art { width: 90%; height: 56px; object-fit: contain; }
.citem b { overflow: hidden; width: 100%; font: 800 12px/1.150 var(--font-title); color: #e6ecfa; white-space: nowrap; text-overflow: ellipsis; }
.citem i { font: 800 12px/1 var(--font-title); font-style: normal; color: #8cd8ff; }
.citem.is-in { opacity: 0.400; }
.citem.is-in::after { content: "✓"; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 900 12px/1 var(--font-title); color: #04210f; background: #5cf09a; }
.ctr__empty { grid-column: 1 / -1; padding: 30px 10px; font: 700 15px/1.400 var(--font-title); color: #c9d4ee; text-align: center; }
.ctr__empty a, .ctr__empty button { color: #6fc8ff; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }

/* FAQ */
.ctr__faqh { margin: 28px 0 12px; font: 900 22px/1 var(--font-title); }
.ctr__faq { display: grid; gap: 8px; }
.ctr__faq details { border-radius: 16px; background: linear-gradient(180deg, #131931, #0f1428); box-shadow: inset 0 0 0 1px #ffffff14; }
.ctr__faq summary { display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; list-style: none; font: 800 16px/1.300 var(--font-title); color: #e6ecfa; }
.ctr__faq summary::-webkit-details-marker { display: none; }
.ctr__faq summary::before { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border: solid #8592b3; border-width: 2px 2px 0 0; transform: rotate(45deg); transition: transform 0.200s; }
.ctr__faq details[open] summary::before { transform: rotate(135deg); }
.ctr__faq p { margin: 0; padding: 0 18px 16px 37px; font: 600 14px/1.600 var(--font-body, inherit); color: #aab6d6; }
@media (prefers-reduced-motion: reduce) {
  body.is-ctr .ctr, .ctr__inside .ci, .ctr__win, .ctr[data-state="craft"] .ctr__crate { animation: none; }
}
