@keyframes resultPop {
    0% {
        opacity: 0;
        transform: scale(0.92);
    }
    60% {
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.container-contract {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .container-contract {
        padding: 0 24px;
    }
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-5 {
    margin-bottom: 20px;
}

.pb-8 {
    padding-bottom: 32px;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-center {
    text-align: center;
}

.header {
    padding: 20px 16px;
    text-align: center;
}

.header-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.header-subtitle {
    font-size: 12px;
    color: #555;
    margin-top: 4px;
}

.selected-bar {
    background: #101010;
    border: 1px solid #161616;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.selected-bar-label {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
}

.selected-slots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

.selected-slot {
    width: 60px;
    height: 60px;
    background: #161616;
    border: 1px dashed #252525;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.selected-slot.filled {
    border: 1px solid #2a2a2a;
    cursor: pointer;
}

.selected-slot.filled:hover .slot-remove {
    opacity: 1;
}

.selected-slot img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.slot-remove {
    position: absolute;
    inset: 0;
    background: rgb(229, 57, 53);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
    font-size: 16px;
    color: #fff;
    cursor: pointer;
}

.slot-plus {
    font-size: 16px;
    color: #252525;
}

.bar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

.counter-badge {
    background: rgba(229, 57, 53, 0.18);
    color: #eb4b4b;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.btn-rules {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #161616;
    border: 1px solid #222;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.btn-rules:hover {
    border-color: #333;
    color: #e0e0e0;
}

.controls-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 640px) {
    .controls-layout {
        flex-direction: row;
    }
}

.balance-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    background: #101010;
    border: 1px solid #161616;
    border-radius: 8px;
    padding: 12px 16px;
    flex-wrap: wrap;
}

.balance-label {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.balance-slider {
    flex: 1;
    -webkit-appearance: none;
    background: #222;
    border-radius: 4px;
    height: 4px;
    outline: none;
}

.balance-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #e53935;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(229, 57, 53, 0.6);
    transition: transform 0.15s, box-shadow 0.15s;
}

.balance-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 12px rgba(229, 57, 53, 0.9);
}

.balance-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #e53935;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.balance-value {
    font-size: 13px;
    font-weight: 700;
    color: #e53935;
    min-width: 72px;
    text-align: right;
}

.btn-sign {
    padding: 14px 28px;
    border-radius: 8px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
    background: linear-gradient(135deg, #e53935, #c62828);
    box-shadow: 0 4px 20px rgba(229, 57, 53, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-sign:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(229, 57, 53, 0.45);
}

.btn-sign:disabled {
    background: #181818;
    box-shadow: none;
    cursor: not-allowed;
    color: #444;
}

.btn-sign.signing {
    background: #1a1a1a;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #333;
    border-top-color: #e53935;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.panels-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 1024px) {
    .panels-layout {
        flex-direction: row;
    }
}

.panel {
    flex: 1;
    min-width: 0;
    background: #101010;
    border: 1px solid #161616;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 460px;
}

/* Телефоны: инвентарь («Мои предметы») сверху, панель с подписью — снизу.
   Раньше на телефоне сверху была «Подпись»; по просьбе меняем местами. */
.panel.contract-panel {
    order: 2;
}

.panel.inventory-panel {
    order: 1;
}

@media (min-width: 1024px) {
    .panel.contract-panel {
        order: 2;
    }

    .panel.inventory-panel {
        order: 1;
    }
}

.panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 16px;
    height: 50px;
    border-bottom: 1px solid #161616;
    flex-shrink: 0;
}

.panel-title {
    font-size: 13px;
    font-weight: 700;
}

.panel-filters {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}


.container-contract  .skin-card {
    background: #252525;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-bottom: 3px solid #4b69ff;
    border-radius: 6px;
    margin-top: 0;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.Covert {
    border-bottom: 3px solid #eb4b4b;
    background-color: #1a0808;
}

.Classified {
    border-bottom: 3px solid #d32ce6;
    background-color: #130a18;
}

.Restricted {
    border-bottom: 3px solid #8847ff;
    background-color: #0d0a18;
}

.MilSpec {
    border-bottom: 3px solid #4b69ff;
    background-color: #0a0e1a;
}

.IndustrialGrade {
    border-bottom: 3px solid #5e98d9;
    background-color: #0a0f1a;
}

.ConsumerGrade {
    border-bottom: 3px solid #b0c3d9;
    background-color: #111111;
}

.skin-card-img-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    min-height: 0;
}

.skin-card-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.skin-card-info {
    padding: 0 8px 8px;
}

.skin-card-name {
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.skin-card-weapon {
    color: #6b7280;
    font-size: 9px;
    line-height: 1.2;
}

.skin-card-price {
    margin-top: 2px;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.contract-info-panel {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.req-block {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.req-item {
    flex: 1;
    min-width: 80px;
    background: #161616;
    border: 1px solid #1e1e1e;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.req-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.3s, box-shadow 0.3s;
}

.req-dot.ok {
    background: #4caf50;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}

.req-dot.bad {
    background: #333;
}

.req-text {
    font-size: 10px;
    color: #6b7280;
}

.total-block {
    background: #161616;
    border: 1px solid #1e1e1e;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.total-left {
    font-size: 11px;
    color: #6b7280;
}

.total-count {
    font-size: 10px;
    color: #444;
    margin-top: 2px;
}

.total-right {
    font-size: 16px;
    font-weight: 800;
    color: #eb4b4b;
}

.price-range-block {
    background: #161616;
    border: 1px solid #1e1e1e;
    border-radius: 10px;
    padding: 16px;
    flex-shrink: 0;
}

.prl {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 10px;
}

.price-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-badge {
    flex: 1;
    background: #101010;
    border: 1px solid #1e1e1e;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}

.pbl {
    font-size: 9px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pbv {
    font-size: 18px;
    font-weight: 800;
    color: #eb4b4b;
    margin-top: 2px;
}

.price-sep {
    font-size: 11px;
    color: #6b7280;
}

.range-bar {
    margin-top: 12px;
    height: 4px;
    background: #1e1e1e;
    border-radius: 4px;
    overflow: hidden;
}

.range-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #e53935, #ff6b35);
    transition: width 0.4s ease;
}

.range-tip {
    font-size: 10px;
    color: #444;
    margin-top: 8px;
    text-align: center;
}

.canvas-block {
    background: #161616;
    border: 1px solid #1e1e1e;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: auto;
    flex-shrink: 0;
    max-height: 600px;
}

.canvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #1e1e1e;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 6px;
}

.canvas-title {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.canvas-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 17px;
    height: 17px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.color-swatch:hover {
    transform: scale(1.2);
}

.color-swatch.active {
    border-color: #fff;
}

.tool-sep {
    width: 1px;
    height: 16px;
    background: #1e1e1e;
}

.btn-tool {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    background: #101010;
    border: 1px solid #1e1e1e;
    color: #6b7280;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.btn-tool:hover {
    background: #222;
    color: #e0e0e0;
}

.btn-tool.active {
    background: rgba(229, 57, 53, 0.18);
    border-color: #e53935;
    color: #eb4b4b;
}

.size-slider {
    width: 52px !important;
    -webkit-appearance: none;
    background: #222 !important;
    border-radius: 4px;
    height: 3px;
}

#canvas-block canvas
{
    background-color: #0E0E0E;
}

.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #e53935;
    border-radius: 50%;
    cursor: pointer;
}

::deep #sig-canvas {
    display: block;
    width: 100%;
    flex: 1;
    background: #0d0d0d;
    cursor: crosshair;
    min-height: unset;
}

.result-in-panel {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 20;
    background: #101010;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    overflow: hidden;
}

.result-in-panel.show {
    display: flex;
    animation: resultPop 0.4s cubic-bezier(0.34, 1.45, 0.64, 1) forwards;
}

.result-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 35%, rgba(229, 57, 53, 0.1) 0%, transparent 68%);
}

.res-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #6b7280;
}

.res-rarity-line {
    width: 80px;
    height: 3px;
    border-radius: 2px;
    margin: 10px auto 0;
}

.res-img {
    width: 130px;
    height: 95px;
    object-fit: contain;
    margin: 10px 0;
    filter: drop-shadow(0 4px 18px rgba(229, 57, 53, 0.5));
    animation: fadeInUp 0.35s 0.1s ease both;
}

.res-name {
    font-size: 16px;
    font-weight: 800;
    animation: fadeInUp 0.35s 0.18s ease both;
}

.res-weapon {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
    animation: fadeInUp 0.35s 0.22s ease both;
}

.res-price {
    font-size: 24px;
    font-weight: 800;
    color: #eb4b4b;
    margin: 10px 0 14px;
    animation: fadeInUp 0.35s 0.28s ease both;
}

.res-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 350px;
    animation: fadeInUp 0.35s 0.33s ease both;
}

.btn-r {
    flex: 1;
    padding: 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.btn-r.p {
    background: #e53935;
    color: #fff;
}

.btn-r.p:hover {
    opacity: 0.85;
}

.btn-r.s {
    background: #161616;
    color: #6b7280;
    border: 1px solid #1e1e1e;
}

.btn-r.s:hover {
    border-color: #333;
    color: #e0e0e0;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    z-index: 1000000000000000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    background: #101010;
    border: 1px solid #161616;
    border-radius: 14px;
    padding: 28px;
    max-width: 440px;
    width: 90%;
}

.modal-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.modal-title em {
    color: #e53935;
    font-style: normal;
}

.modal-step {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
    margin-top: 1px;
    background: rgba(229, 57, 53, 0.18);
    color: #eb4b4b;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-text {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.65;
}

.step-text strong {
    color: #e0e0e0;
}

.btn-close-modal {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    background: #e53935;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: opacity 0.2s;
}

.btn-close-modal:hover {
    opacity: 0.85;
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #222;
    border-radius: 4px;
}
