html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.065) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

.cursor.grab {
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.85);
}

#viewport {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    touch-action: none;
}

#world {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.pcard {
    position: absolute;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.25s ease, outline 0.15s ease;
    cursor: none;
}

.pcard:hover {
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.85);
    outline: 1px solid rgba(255, 255, 255, 0.14);
    z-index: 9999 !important;
}

.pcard-bg {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pcard-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    z-index: 0;
    display: block;
}

.pcard-id {
    position: relative;
    z-index: 1;
    font-size: clamp(16px, 3vw, 42px);
    font-weight: 700;
    letter-spacing: -0.04em;
    opacity: 0.18;
    font-variant-numeric: tabular-nums;
}

.pcard-lod {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 12px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 2;
}

.pcard-lod.visible {
    opacity: 1;
}

.pcard-series {
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.38);
    margin-bottom: 2px;
}

.pcard-title {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.pcard-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.pcard-tag {
    font-size: 8px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 2px 6px;
    border-radius: 500px;
}

.ctrl-panel {
    position: fixed;
    bottom: 28px;
    left: 24px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(10, 10, 10, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    touch-action: manipulation;
}

.ctrl-minimap {
    width: 108px;
    height: 108px;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.mm-dots {
    position: absolute;
    inset: 0;
}

.mm-dot {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.6;
}

.mm-viewport {
    position: absolute;
    border: 1px solid var(--accent, #FF4D00);
    border-radius: 1px;
    pointer-events: none;
    min-width: 4px;
    min-height: 4px;
}

.ctrl-divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
}

.ctrl-btns {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
}

.ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    cursor: none;
    touch-action: manipulation;
    transition: background 0.18s, color 0.18s;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.ctrl-btn--accent {
    color: var(--accent, #FF4D00);
    opacity: 0.8;
}

.ctrl-btn--accent:hover {
    background: rgba(255, 77, 0, 0.12);
    color: var(--accent, #FF4D00);
    opacity: 1;
}

.ctrl-zoom {
    font-size: 10px;
    letter-spacing: 0.07em;
    color: rgba(255, 255, 255, 0.25);
    padding: 4px 0 8px;
    text-align: center;
    width: 100%;
    display: block;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 48px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.modal-box {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 52px;
    width: 100%;
    max-width: 860px;
    align-items: center;
}

.modal-ph {
    width: clamp(160px, 26vw, 320px);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.7);
    flex-shrink: 0;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-series {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.38);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.modal-title {
    font-size: clamp(26px, 4vw, 50px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.modal-desc {
    font-size: 15px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.55);
    max-width: 400px;
    margin-top: 4px;
}

.modal-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.modal-tag {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 4px 12px;
    border-radius: 500px;
}

.modal-back {
    display: inline-block;
    margin-top: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.04em;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    cursor: none;
    text-align: left;
    align-self: flex-start;
    touch-action: manipulation;
    transition: color 0.2s;
}

.modal-back:hover {
    color: var(--accent, #FF4D00);
}

.modal-close {
    position: fixed;
    top: 24px;
    right: 28px;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
    z-index: 220;
    touch-action: manipulation;
    transition: background 0.2s, border-color 0.2s;
}

.modal-close:hover {
    background: var(--accent, #FF4D00);
    border-color: var(--accent, #FF4D00);
}

.modal-nav {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 220;
}

.modal-nav button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
    touch-action: manipulation;
    transition: background 0.2s, border-color 0.2s;
}

.modal-nav button:hover {
    background: var(--accent, #FF4D00);
    border-color: var(--accent, #FF4D00);
}

.modal-counter {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.1em;
    min-width: 56px;
    text-align: center;
}

@media (max-width: 680px) {
    .modal-box {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .modal-ph {
        width: 100%;
        max-width: 240px;
        margin: 0 auto;
    }

    .modal {
        padding: 40px 24px;
        align-items: center;
    }

    .ctrl-panel {
        bottom: 16px;
        left: 12px;
    }

    .ctrl-minimap {
        width: 80px;
        height: 80px;
    }
}