.auction-box,
.auction-box * {
    box-sizing: border-box;
}

.auction-box {
    width: 100%;
    margin: 12px 0;
    border: 1px solid rgba(230, 142, 38, .58);
    border-radius: 16px;
    background: #090713;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255, 185, 70, .035) inset, 0 10px 24px rgba(0,0,0,.22);
    font-family: inherit;
}

.auction-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0));
    border-bottom: 1px solid rgba(230, 142, 38, .28);
}

.auction-title-wrap {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.auction-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffd45a 0%, #ff9a22 55%, #f07b16 100%);
    color: #1b140b;
    box-shadow: 0 7px 18px rgba(255, 137, 37, .16), inset 0 1px 0 rgba(255,255,255,.28);
}

.auction-icon img {
    width: 29px;
    height: 29px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 1px 0 rgba(255,255,255,.22));
}

.auction-label {
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -.2px;
    text-shadow: 0 1px 0 rgba(0,0,0,.35);
}

.auction-head h3 {
    margin: 2px 0 0;
    font-size: 12px;
    line-height: 1.15;
    color: #f6b23b;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auction-status {
    flex: 0 0 auto;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 164, 43, .13);
    border: 1px solid rgba(255, 164, 43, .35);
    color: #ffbd57;
    font-weight: 800;
    font-size: 12px;
}

.auction-box.is-finished .auction-status {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.13);
    color: #ddd;
}

.auction-body {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 14px;
    padding: 14px 18px 12px;
}

.auction-image {
    min-height: 158px;
    border-radius: 14px;
    background: #282828;
    border: 1px solid rgba(230, 142, 38, .34);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auction-image-btn {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 158px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    overflow: hidden;
    display: block;
    font-family: inherit;
}

.auction-image-btn img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 158px;
    object-fit: cover;
    transition: transform .18s ease, filter .18s ease;
}

.auction-image-btn:hover img {
    transform: scale(1.035);
    filter: brightness(1.05);
}

.auction-image-zoom {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(9, 7, 19, .82);
    border: 1px solid rgba(255, 177, 49, .38);
    color: #ffbd57;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    opacity: 0;
    transform: translateY(4px);
    transition: .16s ease;
}

.auction-image-btn:hover .auction-image-zoom {
    opacity: 1;
    transform: translateY(0);
}

.auction-no-image {
    color: rgba(255,255,255,.55);
    font-weight: 800;
}

.auction-info {
    min-width: 0;
}

.auction-description {
    color: rgba(255,255,255,.78);
    line-height: 1.38;
    margin-bottom: 8px;
    font-size: 13px;
    max-height: 38px;
    overflow: hidden;
}

.auction-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.auction-stats > div {
    padding: 8px 10px;
    border-radius: 10px;
    background: #292929;
    border: 1px solid rgba(255,255,255,.08);
}

.auction-stats span {
    display: block;
    color: rgba(255,255,255,.55);
    font-size: 11px;
    margin-bottom: 4px;
}

.auction-stats b {
    display: block;
    color: #fff;
    font-size: 16px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auction-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 8px 0;
}

.auction-btn,
.auction-main-btn {
    border: 0;
    border-radius: 10px;
    padding: 9px 12px;
    font-weight: 900;
    cursor: pointer;
    transition: .15s ease;
    font-family: inherit;
}

.auction-btn {
    background: #2b2b2b;
    border: 1px solid rgba(255,255,255,.09);
    color: #fff;
}

.auction-btn:hover {
    border-color: rgba(255, 176, 54, .45);
    background: #333;
}

.auction-main-btn {
    background: linear-gradient(135deg, #ffc62e, #ff7d22);
    color: #fff;
    min-width: 136px;
    box-shadow: 0 6px 14px rgba(255, 127, 32, .10);
}

.auction-main-btn:hover {
    filter: brightness(1.03);
    transform: none;
}

.auction-main-btn:disabled {
    opacity: .65;
    cursor: wait;
    transform: none;
}

.auction-custom-bid {
    display: flex;
    gap: 7px;
    margin-top: 8px;
}

.auction-custom-bid input {
    min-width: 0;
    flex: 1;
    border: 1px solid rgba(230, 142, 38, .24);
    background: #17151f;
    color: #fff;
    border-radius: 10px;
    padding: 9px 11px;
    font-weight: 800;
    outline: none;
}

.auction-custom-bid input:focus {
    border-color: rgba(255, 180, 53, .65);
}

.auction-login-note,
.auction-winner {
    margin-top: 9px;
    padding: 10px 12px;
    border-radius: 13px;
    background: #292929;
    border: 1px solid rgba(230, 142, 38, .30);
    color: rgba(255,255,255,.86);
}

.auction-finish-card {
    margin-top: 9px;
    padding: 10px;
    border-radius: 14px;
    background: #292929;
    border: 1px solid rgba(230, 142, 38, .42);
    box-shadow: 0 0 24px rgba(255, 151, 42, .08) inset;
}

.auction-finish-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 8px;
}

.auction-finish-title span {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffc62e, #ff7d22);
    box-shadow: 0 8px 22px rgba(255, 127, 32, .22);
}

.auction-finish-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-top: 1px solid rgba(255,255,255,.08);
    color: rgba(255,255,255,.72);
}

.auction-finish-line b {
    color: #ffbd57;
    text-align: right;
}

.auction-finish-grats {
    margin-top: 8px;
    color: rgba(255,255,255,.88);
    font-weight: 800;
}

.auction-ok,
.auction-error {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 11px;
    font-weight: 800;
}

.auction-ok {
    background: rgba(67, 210, 111, .14);
    color: #8dffae;
}

.auction-error {
    background: rgba(255, 65, 65, .14);
    color: #ff9a9a;
}

.auction-history {
    padding: 0 18px 14px;
}

.auction-history-title {
    margin-bottom: 8px;
    color: #f6b23b;
    font-weight: 900;
}

.auction-bid-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    background: #262626;
    border: 1px solid rgba(255,255,255,.065);
    margin-bottom: 5px;
}

.auction-bid-user {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.auction-bid-amount {
    color: #ffbd57;
    font-weight: 900;
}

.auction-bid-time {
    color: rgba(255,255,255,.48);
    font-size: 12px;
}

.auction-empty {
    padding: 10px;
    color: rgba(255,255,255,.55);
    background: #262626;
    border-radius: 12px;
}


/* Компактный режим для главной */
.auction-box .auction-history-title {
    font-size: 13px;
}

.auction-box .auction-bid-row:nth-of-type(n+7) {
    display: none;
}

.auction-box .auction-image,
.auction-box .auction-image-btn,
.auction-box .auction-image-btn img {
    max-height: 170px;
}

body.auction-modal-open {
    overflow: hidden;
}

.auction-image-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.auction-image-modal.is-open {
    display: flex;
}

.auction-image-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .74);
    backdrop-filter: blur(4px);
}

.auction-image-modal-inner {
    position: relative;
    z-index: 1;
    width: min(1100px, calc(100vw - 44px));
    max-width: calc(100vw - 44px);
    max-height: calc(100vh - 44px);
    padding: 10px;
    border-radius: 16px;
    background: #090713;
    border: 1px solid rgba(230, 142, 38, .65);
    box-shadow: 0 18px 60px rgba(0,0,0,.58), 0 0 0 1px rgba(255, 185, 70, .04) inset;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.auction-image-modal-img {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 112px);
    height: auto;
    object-fit: contain;
    border-radius: 13px;
    background: #18151f;
}

.auction-image-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffc62e, #ff7d22);
    color: #fff;
    cursor: pointer;
    font-size: 28px;
    line-height: 34px;
    font-weight: 900;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
}

.auction-image-modal-title {
    flex: 0 0 auto;
    margin-top: 8px;
    color: #ffbd57;
    font-weight: 900;
    text-align: center;
}

@media (max-width: 768px) {
    .auction-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .auction-title-wrap {
        width: 100%;
    }
    .auction-head h3 {
        white-space: normal;
    }
    .auction-body {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    .auction-history {
        padding: 0 12px 12px;
    }
    .auction-image,
    .auction-image-btn,
    .auction-image-btn img {
        min-height: 150px;
        max-height: 180px;
    }
    .auction-stats {
        grid-template-columns: 1fr;
    }
    .auction-custom-bid {
        flex-direction: column;
    }
    .auction-main-btn {
        width: 100%;
    }
    .auction-bid-row {
        grid-template-columns: 1fr auto;
    }
    .auction-bid-time {
        grid-column: 1 / -1;
    }
    .auction-image-zoom {
        opacity: 1;
        transform: none;
    }
    .auction-image-modal {
        padding: 10px;
    }
    .auction-image-modal-inner {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        padding: 10px;
        border-radius: 15px;
    }
    .auction-image-modal-img {
        max-height: calc(100vh - 92px);
        border-radius: 11px;
    }
    .auction-image-modal-close {
        top: 8px;
        right: 8px;
    }
}
