/* ============================================================
   ПОЛНОСТЬЮ ПЕРЕРАБОТАННЫЙ ДИЗАЙН — ITEM PAGE V3
   ============================================================ */

/* --- БАЗОВЫЕ ПЕРЕМЕННЫЕ --- */
.item-page {
    --rar: #64748b;
    --rar-soft: rgba(100,116,139,0.15);
    --bg-card: #111e32;
    --border-subtle: #2a3f5c;
    --text-primary: #eef5fd;
    --text-secondary: #b0c3db;
    --text-muted: #7a92ae;
    --shadow-heavy: 0 20px 60px -20px rgba(0,0,0,0.8);
    --radius-card: 20px;
    --radius-frame: 24px;

    max-width: 1100px;
    margin: 0 auto;
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* --- РЕДКОСТИ (цвета акцентов) --- */
.item-page.rarity-Обычный     { --rar: #7a8a9e; --rar-soft: rgba(122,138,158,0.15); }
.item-page.rarity-Необычный   { --rar: #34b86a; --rar-soft: rgba(52,184,106,0.18); }
.item-page.rarity-Редкий      { --rar: #3b8fd9; --rar-soft: rgba(59,143,217,0.18); }
.item-page.rarity-Эпический   { --rar: #9b7ae0; --rar-soft: rgba(155,122,224,0.20); }
.item-page.rarity-Легендарный { --rar: #e8b830; --rar-soft: rgba(232,184,48,0.22); }
.item-page.rarity-Мифический  { --rar: #e8657a; --rar-soft: rgba(232,101,122,0.22); }

/* --- ХЛЕБНЫЕ КРОШКИ --- */
.ip-crumbs {
    display: none;
}

/* --- ГЛАВНАЯ КАРТОЧКА (HERO) --- */
.item-page .ip-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(260px, 34%) minmax(0, 1fr);
    gap: 0;
    min-height: 440px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-heavy);
    transition: box-shadow 0.4s ease;
}

.item-page .ip-hero:hover {
    box-shadow: 0 28px 72px -24px rgba(0,0,0,0.9);
}

.ip-glow {
    position: absolute;
    z-index: 0;
    left: -120px;
    top: -120px;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--rar-soft) 0%, transparent 70%);
    pointer-events: none;
}

/* --- ЛЕВАЯ ЧАСТЬ: ИЗОБРАЖЕНИЕ --- */
.item-page .ip-showcase {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: clamp(28px, 4vw, 52px);
    background:
        radial-gradient(circle at 50% 40%, var(--rar-soft), transparent 60%),
        linear-gradient(145deg, #131f33, #09111f);
}

.item-page .ip-frame {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 42px);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-frame);
    box-shadow:
        inset 0 0 50px rgba(0,0,0,0.5),
        0 0 0 1px rgba(255,255,255,0.04),
        0 30px 50px -24px rgba(0,0,0,0.8);
    transition: transform 0.25s ease, box-shadow 0.3s ease;
}

.item-page .ip-frame:hover {
    transform: scale(1.02);
    box-shadow:
        inset 0 0 50px rgba(0,0,0,0.5),
        0 0 0 2px var(--rar-soft),
        0 35px 60px -20px rgba(0,0,0,0.9);
}

.ip-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    filter: drop-shadow(0 20px 32px rgba(0,0,0,0.6));
    transition: filter 0.3s;
}

.ip-frame:hover img {
    filter: drop-shadow(0 28px 44px rgba(0,0,0,0.75));
}

.ip-frame-ph {
    font-size: 96px;
    color: var(--rar);
    opacity: 0.7;
}

.ip-rarity {
    position: absolute;
    z-index: 3;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--rar);
    border: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
}

.ip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--rar);
    box-shadow: 0 0 14px var(--rar);
}

.ip-serial {
    margin-top: 18px;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* --- ПРАВАЯ ЧАСТЬ: ИНФОРМАЦИЯ --- */
.item-page .ip-body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(30px, 5vw, 58px);
    background: linear-gradient(145deg, #16273f, #0f1c30);
}

.ip-title {
    max-width: 720px;
    margin: 0 0 4px 0;
    font-size: clamp(32px, 4.5vw, 54px);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    background: linear-gradient(135deg, #ffffff 55%, var(--rar));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ip-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.ip-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 100px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: background 0.2s;
}

.ip-chip i {
    color: var(--rar);
    font-size: 13px;
    opacity: 0.9;
}

.ip-chip a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.ip-chip a:hover {
    color: var(--rar);
}

.item-page .ip-desc {
    max-width: 68ch;
    margin-top: 18px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
}

.ip-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.ip-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.2s;
}

.ip-flag i {
    font-size: 12px;
    opacity: 0.7;
}

.ip-flag:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.14);
}

.ip-flag.is-on {
    color: #6fd79b;
    background: rgba(52,184,106,0.15);
    border-color: rgba(52,184,106,0.35);
}

.ip-flag.is-market {
    color: #efd06a;
    background: rgba(232,184,48,0.15);
    border-color: rgba(232,184,48,0.35);
}

/* --- БЛОК ЛОТА (рынок) --- */
.ip-lot {
    margin-top: 24px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1a2029, #242b38);
    border: 1px solid #4a4d3a;
    border-left: 5px solid #d49b25;
    border-radius: 14px;
}

.ip-lot-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.ip-lot-label {
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ip-lot-price strong {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 28px;
    font-weight: 700;
    color: #f1cf61;
    font-variant-numeric: tabular-nums;
}

.ip-lot-price strong i {
    font-size: 20px;
    opacity: 0.9;
}

.ip-lot-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #c5b98f;
}

.ip-lot-meta i {
    opacity: 0.7;
}

.item-page .market-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 8px;
    background: rgba(0,0,0,0.25);
    border: 1px solid #5a523a;
    color: #d7c78f;
    font-variant-numeric: tabular-nums;
}

.item-page .market-timer.ending {
    color: #ff8098;
    background: rgba(224,26,63,0.15);
    border-color: rgba(224,26,63,0.4);
}

.ip-lot-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.btn-market-bid,
.btn-market-buyout {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 26px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s, filter 0.25s, box-shadow 0.25s;
}

.btn-market-bid {
    background: linear-gradient(135deg, #3dbe7a, #238c4e);
    box-shadow: 0 8px 24px -12px rgba(52,184,106,0.5);
}

.btn-market-buyout {
    background: linear-gradient(135deg, #e62a4a, #b3152e);
    box-shadow: 0 8px 24px -12px rgba(224,26,63,0.5);
}

.btn-market-bid:hover,
.btn-market-buyout:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 12px 32px -12px rgba(0,0,0,0.4);
}

.btn-market-bid:active,
.btn-market-buyout:active {
    transform: translateY(0);
}

.ip-lot-note {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.ip-lot-note a {
    color: inherit;
    text-decoration: underline;
}

.note-lead {
    background: rgba(52,184,106,0.12);
    border: 1px solid rgba(52,184,106,0.35);
    color: #6fd79b;
}

.note-lead i {
    color: #f1cf61;
}

.note-own {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
}

.note-login {
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.15);
    color: var(--text-secondary);
    font-weight: 400;
}

.note-login a {
    color: #e01a3f;
    font-weight: 700;
}

/* --- БЛОК "ПРИНАДЛЕЖИТ ВАМ" --- */
.ip-nosale {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
    padding: 14px 20px;
    border-radius: 14px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
    font-size: 14px;
    color: var(--text-secondary);
    transition: background 0.2s, border-color 0.2s;
}

.ip-nosale:hover {
    background: rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.08);
}

.ip-nosale i {
    font-size: 18px;
    color: var(--rar);
    opacity: 0.8;
}

.ip-nosale a {
    color: var(--rar);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
    margin-left: 4px;
}

.ip-nosale a:hover {
    color: #c4a3f0;
    text-decoration: underline;
}

/* --- ПАНЕЛИ (Характеристики, История) --- */
.item-page .ip-panel {
    position: relative;
    margin-top: 22px;
    padding: clamp(24px, 3vw, 34px);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    box-shadow: 0 14px 38px -28px rgba(0,0,0,0.6);
}

.item-page .ip-panel::before {
    content: '';
    position: absolute;
    left: 0;
    top: 28px;
    width: 4px;
    height: 28px;
    border-radius: 0 4px 4px 0;
    background: var(--rar);
}

.ip-panel-h {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary);
}

.ip-panel-h i {
    color: var(--rar);
    font-size: 15px;
}

/* --- ХАРАКТЕРИСТИКИ (сетка) --- */
.item-page .ip-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    overflow: visible;
    border: 0;
    background: transparent;
}

.item-page .ip-spec {
    min-height: 88px;
    padding: 18px 20px;
    background: linear-gradient(145deg, #192b42, #122236);
    border: 1px solid #2d405b;
    border-radius: 14px;
}

.ip-spec dt {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.ip-spec dd {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.ip-spec dd a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px dashed rgba(255,255,255,0.15);
    transition: border-color 0.2s;
}

.ip-spec dd a:hover {
    border-bottom-color: var(--rar);
}

.ip-spec dd.v-rarity {
    color: var(--rar);
}

.ip-spec dd.v-price {
    color: #f1cf61;
    font-variant-numeric: tabular-nums;
}

.ip-spec dd.v-price i {
    font-size: 12px;
    opacity: 0.85;
}

/* --- МОДАЛКА СТАВКИ --- */
.item-page .market-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6,10,18,0.8);
    backdrop-filter: blur(6px);
}

.item-page .market-modal[hidden] {
    display: none;
}

.item-page .market-modal-box {
    width: 100%;
    max-width: 420px;
    padding: 28px;
    color: var(--text-primary);
    background: linear-gradient(145deg, #15243a, #0c1a2e);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    box-shadow: 0 40px 80px -24px rgba(0,0,0,0.9);
}

.item-page .market-modal-box h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
}

.item-page .market-hint {
    margin-bottom: 16px;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.item-page .market-modal-box label {
    display: block;
    margin-bottom: 18px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.item-page .market-modal-box input {
    width: 100%;
    margin-top: 8px;
    padding: 14px;
    box-sizing: border-box;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.item-page .market-modal-box input:focus {
    border-color: var(--rar);
    box-shadow: 0 0 0 3px var(--rar-soft);
}

.item-page .market-modal-actions {
    display: flex;
    gap: 12px;
}

.item-page .market-modal-actions button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, filter 0.2s;
}

.item-page .btn-modal-confirm {
    background: linear-gradient(135deg, #e62a4a, #b3152e);
    color: #fff;
}

.item-page .btn-modal-close {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12) !important;
    color: var(--text-secondary);
}

.item-page .btn-modal-confirm:hover,
.item-page .btn-modal-close:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 860px) {
    .item-page .ip-hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .item-page .ip-showcase {
        min-height: 340px;
        padding: 32px;
    }

    .item-page .ip-frame {
        max-width: 260px;
    }

    .item-page .ip-body {
        padding: 32px 28px;
    }

    .ip-title {
        font-size: 34px;
        text-align: center;
    }

    .ip-sub,
    .ip-flags {
        justify-content: center;
    }

    .ip-nosale {
        justify-content: center;
        flex-wrap: wrap;
        text-align: center;
    }
}

@media (max-width: 560px) {
    .item-page .ip-showcase {
        min-height: 280px;
        padding: 24px;
    }

    .item-page .ip-body {
        padding: 24px 18px;
    }

    .ip-title {
        font-size: 28px;
    }

    .ip-chip,
    .ip-flag {
        font-size: 11px;
        padding: 4px 10px;
    }

    .ip-lot-actions > button {
        width: 100%;
        justify-content: center;
    }

    .ip-lot-top {
        flex-direction: column;
        align-items: stretch;
    }

    .ip-lot-meta {
        justify-content: space-between;
    }

    .item-page .ip-specs {
        grid-template-columns: 1fr;
    }

    .item-page .market-modal-box {
        padding: 20px;
        margin: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .item-page .ip-frame::after {
        animation: none;
    }
    .btn-market-bid,
    .btn-market-buyout {
        transition: none;
    }
}

/* --- БЛИК ДЛЯ ТОПОВЫХ РЕДКОСТЕЙ (опционально) --- */
.item-page.rarity-Легендарный .ip-frame::after,
.item-page.rarity-Мифический .ip-frame::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-frame);
    background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.10) 50%, transparent 60%);
    background-size: 300% 300%;
    animation: ip-sheen 5s linear infinite;
    pointer-events: none;
}

@keyframes ip-sheen {
    0% { background-position: 200% 0; }
    100% { background-position: -100% 0; }
}
