/* =========================================================
   NIKOOSEN WEBSITE PUZZLE
   ========================================================= */

.nikoosen-puzzle {
    width: 100%;
    min-width: 100%;
    min-height: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    perspective: 1200px;

    font-family: inherit;

    box-sizing: border-box;
}

.np-card {
    width: 100%;
    max-width: 520px;

    position: relative;
    overflow: hidden;

    box-sizing: border-box;

    background:
        linear-gradient(
            145deg,
            rgba(17, 34, 53, .97),
            rgba(7, 19, 32, .98)
        );

    border: 1px solid rgba(148, 183, 214, .14);

    border-radius: 20px;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, .38),
        inset 0 1px 0 rgba(255, 255, 255, .04);

    backdrop-filter: blur(18px);

    direction: rtl;

    font-family: inherit;
}


/* =========================================================
   HEADER
   ========================================================= */

.np-head {
    min-height: 58px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 12px 16px;

    border-bottom: 1px solid rgba(148, 183, 214, .09);
}

.np-head-title {
    display: flex;
    align-items: center;

    gap: 10px;
}

.np-live {
    width: 9px;
    height: 9px;

    flex-shrink: 0;

    border-radius: 50%;

    background: #55D6FF;

    box-shadow:
        0 0 0 4px rgba(85, 214, 255, .08),
        0 0 16px rgba(85, 214, 255, .65);

    animation: npPulse 2s infinite;
}

@keyframes npPulse {

    50% {
        opacity: .45;
        transform: scale(.82);
    }

}

.np-head-title strong {
    display: block;

    color: #F2F7FC;

    /*
     * کمی بزرگ‌تر و خواناتر
     */
    font-size: .90rem;
    font-weight: 800;

    line-height: 1.5;

    font-family: inherit;
}

.np-head-title small {
    display: block;

    margin-top: 2px;

    color: #70869D;

    font-size: .68rem;

    font-family: inherit;
}


.np-progress {
    min-width: 115px;

    font-family: inherit;
}

.np-progress > span {
    display: block;

    margin-bottom: 5px;

    color: #7791A9;

    /*
     * دیگر monospace نیست
     * تا با فونت سایت هماهنگ باشد.
     */
    font-family: inherit;

    font-size: .70rem;

    direction: rtl;
    text-align: left;
}

.np-progress-bar {
    width: 100%;
    height: 4px;

    overflow: hidden;

    border-radius: 20px;

    background: rgba(255, 255, 255, .06);
}

.np-progress-bar i {
    display: block;

    width: 0%;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #4F7CFF,
            #55D6FF
        );

    box-shadow:
        0 0 14px rgba(79, 124, 255, .45);

    transition: width .35s ease;
}


/* =========================================================
   GUIDE
   ========================================================= */

.np-guide {
    display: flex;
    align-items: center;

    gap: 10px;

    margin: 12px 14px 10px;

    padding: 10px 11px;

    border: 1px solid rgba(79, 124, 255, .14);

    border-radius: 12px;

    background:
        linear-gradient(
            90deg,
            rgba(79, 124, 255, .055),
            rgba(85, 214, 255, .025)
        );

    font-family: inherit;
}

.np-guide-icon {
    width: 33px;
    height: 33px;

    flex-shrink: 0;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: rgba(79, 124, 255, .11);

    border: 1px solid rgba(79, 124, 255, .18);

    color: #69A0FF;

    font-size: 1rem;

    font-family: inherit;
}

.np-guide > div:nth-child(2) {
    flex: 1;
}

.np-guide strong {
    display: block;

    color: #DDE8F3;

    font-size: .75rem;
    font-weight: 800;

    line-height: 1.6;

    font-family: inherit;
}

.np-guide small {
    display: block;

    margin-top: 2px;

    color: #71869B;

    font-size: .64rem;

    line-height: 1.6;

    font-family: inherit;
}

.np-guide-count {
    color: #6484A5;

    /*
     * قبلاً monospace بود.
     */
    font-family: inherit;

    font-size: .65rem;

    white-space: nowrap;
}


/* =========================================================
   PUZZLE BOARD
   ========================================================= */

.np-board-wrap {
    padding: 5px 14px 10px;
}

.np-board {

    position: relative;

    width: 100%;

    aspect-ratio: 16 / 8.7;

    display: grid;

    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);

    /*
     * ترتیب Grid بر اساس تصویر باشد.
     */
    direction: ltr;

    /*
     * فاصله بسیار کم بین قطعات
     *
     * صفر نیست تا قطعات در حالت عادی
     * قابل تشخیص بمانند.
     */
    gap: 0.15px;
    padding: 1px;

    border-radius: 14px;

    background: #071522;

    border: 1px solid rgba(148, 183, 214, .10);

    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .018),
        0 12px 35px rgba(0, 0, 0, .25);

    isolation: isolate;
}


/* =========================================================
   EMPTY SLOTS
   ========================================================= */

.np-slot {

    position: relative;

    min-width: 0;
    min-height: 0;

    overflow: hidden;

    /*
     * Border خیلی ظریف
     */
    border-radius: 2px;

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, .025),
            rgba(255, 255, 255, .008)
        );

    border: 1px solid rgba(120, 160, 195, .045);

    transition:
        background .2s,
        border-color .2s,
        transform .2s;
}

.np-slot::before {
    content: attr(data-slot);

    position: absolute;

    inset: 0;

    display: grid;
    place-items: center;

    color: rgba(128, 159, 187, .09);

    /*
     * این فقط شماره جایگاه است،
     * ولی فونت رابط سایت را می‌گیرد.
     */
    font-family: inherit;

    font-size: .58rem;

    pointer-events: none;

    z-index: 0;
}

.np-slot.np-hover {

    background: rgba(79, 124, 255, .09);

    border-color: rgba(79, 124, 255, .35);

    transform: scale(.995);
}

.np-slot.np-correct {

    border-color: rgba(85, 214, 255, .12);
}


/* =========================================================
   PUZZLE PIECES
   ========================================================= */

.np-piece {

    position: relative;

    width: 100%;
    height: 100%;

    min-width: 0;
    min-height: 0;

    overflow: hidden;

    /*
     * Border بسیار کم
     */
    border-radius: 2px;

    cursor: grab;

    user-select: none;
    -webkit-user-select: none;

    background-color: #102238;

    border: 1px solid rgba(180, 215, 240, .045);

    box-shadow:
        0 2px 6px rgba(0, 0, 0, .14);

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease,
        opacity .2s ease;
}

.np-piece:active {
    cursor: grabbing;
}

.np-piece:hover {

    z-index: 10;

    transform:
        translateY(-2px)
        scale(1.018);

    border-color:
        rgba(85, 214, 255, .32);

    box-shadow:
        0 7px 18px rgba(0, 0, 0, .30),
        0 0 15px rgba(79, 124, 255, .07);
}

.np-piece.np-selected {

    z-index: 20;

    transform: scale(1.025);

    border-color: rgba(85, 214, 255, .72);

    box-shadow:
        0 0 0 1px rgba(85, 214, 255, .14),
        0 9px 22px rgba(0, 0, 0, .34),
        0 0 20px rgba(79, 124, 255, .13);
}

.np-piece.np-dragging {

    opacity: .35;

    transform: scale(.975);
}

.np-piece.np-correct {

    cursor: default;

    border-color:
        rgba(85, 214, 255, .08);

    box-shadow:
        0 0 0 1px rgba(85, 214, 255, .02);
}


/* =========================================================
   IMAGE ART
   ========================================================= */

.np-piece-art {

    position: absolute;

    inset: -1px;

    background-repeat: no-repeat;

    background-size: 400% 300%;

    /*
     * فونت و متن ندارد؛
     * بنابراین هیچ تغییری در تصویر ایجاد نمی‌شود.
     */
    pointer-events: none;

    transform: translateZ(0);

    backface-visibility: hidden;
}


/* =========================================================
   PIECES AREA
   ========================================================= */

.np-piece-area {
    padding: 0 14px 10px;

    font-family: inherit;
}

.np-piece-title {

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 7px;
}

.np-piece-title span {

    color: #AFC1D2;

    font-size: .70rem;
    font-weight: 800;

    font-family: inherit;
}

.np-piece-title small {

    color: #61788F;

    font-size: .60rem;

    font-family: inherit;
}

.np-pieces {

    display: grid;

    grid-template-columns: repeat(6, 1fr);

    /*
     * فاصله تکه‌های پایین هم کمتر شده.
     */
    gap: 3px;

    min-height: 42px;
}


/*
 * قطعه داخل ناحیه پایین
 */

.np-pieces .np-piece {
    aspect-ratio: 1.5 / 1;
}


/* =========================================================
   SUCCESS
   ========================================================= */

.np-success {

    display: none;

    align-items: center;

    gap: 9px;

    margin: 0 14px 9px;

    padding: 10px;

    border-radius: 12px;

    border: 1px solid rgba(85, 214, 255, .20);

    background:
        linear-gradient(
            90deg,
            rgba(79, 124, 255, .10),
            rgba(85, 214, 255, .045)
        );

    animation: npSuccessIn .4s ease;

    font-family: inherit;
}

.np-success.np-show {
    display: flex;
}

@keyframes npSuccessIn {

    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}

.np-success-icon {

    width: 30px;
    height: 30px;

    flex-shrink: 0;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background:
        linear-gradient(
            135deg,
            #4F7CFF,
            #55D6FF
        );

    color: #fff;

    font-weight: 900;
    font-size: .80rem;

    box-shadow:
        0 0 18px rgba(79, 124, 255, .25);

    font-family: inherit;
}

.np-success div:nth-child(2) {
    flex: 1;
}

.np-success strong {

    display: block;

    color: #E9F5FF;

    font-size: .74rem;

    line-height: 1.5;

    font-family: inherit;
}

.np-success span {

    display: block;

    color: #6E849A;

    font-size: .61rem;

    line-height: 1.5;

    font-family: inherit;
}

.np-success button {

    border:
        1px solid rgba(79, 124, 255, .25);

    background:
        rgba(79, 124, 255, .08);

    color: #75A4FF;

    border-radius: 8px;

    padding: 7px 10px;

    font-family: inherit;

    font-size: .60rem;

    cursor: pointer;

    transition: .2s;
}

.np-success button:hover {

    background:
        rgba(79, 124, 255, .18);

    color: #fff;
}


/* =========================================================
   FOOTER
   ========================================================= */

.np-footer {

    min-height: 34px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    padding: 7px 14px;

    border-top:
        1px solid rgba(148, 183, 214, .07);

    color: #5F768D;

    font-size: .60rem;

    font-family: inherit;
}

.np-footer > span {

    display: flex;
    align-items: center;

    gap: 5px;
}

.np-footer > span i {

    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: #55D6FF;

    box-shadow:
        0 0 8px rgba(85, 214, 255, .5);
}

.np-footer button {

    border: none;

    background: none;

    color: #6381A0;

    font-family: inherit;

    font-size: .60rem;

    cursor: pointer;

    transition: color .2s;
}

.np-footer button:hover {
    color: #6FA3FF;
}


/* =========================================================
   COMPLETED / PRECISION MODE
   ========================================================= */

/*
 * وقتی پازل کامل می‌شود،
 * تصویر کاملاً یکپارچه می‌شود.
 *
 * این قسمت عمداً حفظ شده است.
 */

.np-board.np-completed {

    /*
     * هنگام کامل شدن فاصله کاملاً صفر می‌شود
     * تا تصویر یک تکه دیده شود.
     */
    gap: 0;

    padding: 1px;

    background: rgba(5, 16, 29, .92);

    border-color:
        rgba(85, 214, 255, .20);

    box-shadow:
        0 0 0 1px rgba(85, 214, 255, .10),
        0 0 38px rgba(79, 124, 255, .12),
        0 15px 40px rgba(0, 0, 0, .30);
}


.np-board.np-completed .np-slot {
    border: 0;
    border-radius: 0;
    background: transparent;
}


.np-board.np-completed .np-piece {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}


.np-board.np-completed .np-piece-art {
    filter:
        brightness(1.025)
        contrast(1.025);
}


@keyframes npPieceDone {

    0% {
        opacity: .82;
        transform: scale(.985);
    }

    55% {
        opacity: 1;
        transform: scale(1.008);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }

}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    /*
     * کل بازی تمام عرض شود.
     */
    .nikoosen-puzzle {
        width: 100%;
        padding: 0;
    }

    .np-card {
        width: 100%;
        max-width: none;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 640px) {

    /*
     * موبایل نیز دقیقاً 100% عرض.
     */
    .nikoosen-puzzle {
        width: 100%;
        padding: 0;
    }

    .np-card {
        width: 100%;
        max-width: none;

        border-radius: 16px;
    }

    .np-head {
        padding: 10px 12px;
    }

    .np-progress {
        min-width: 90px;
    }

    .np-guide {

        margin:
            9px 10px 8px;

        padding:
            9px 9px;
    }

    .np-guide strong {
        font-size: .72rem;
    }

    .np-guide small {
        font-size: .60rem;
    }

    .np-guide-count {
        font-size: .62rem;
    }

    .np-board-wrap {

        padding:
            4px 10px 8px;
    }

    .np-piece-area {

        padding:
            0 10px 8px;
    }

    /*
     * فاصله قطعات پایین در موبایل هم کم است.
     */
    .np-pieces {
        gap: 3px;
    }

    .np-piece-title span {
        font-size: .68rem;
    }

    .np-piece-title small {
        display: none;
    }

    .np-footer {
        padding-inline: 10px;
    }

}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 380px) {

    .np-head-title strong {
        font-size: .84rem;
    }

    .np-head-title small {
        font-size: .63rem;
    }

    .np-progress > span {
        font-size: .66rem;
    }

    .np-guide strong {
        font-size: .69rem;
    }

    .np-guide small {
        font-size: .57rem;
    }

}


/* =========================================================
   EXTRA INFO
   ========================================================= */

.np-extra-info {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin: 2px 14px 10px;
    padding: 11px 12px;

    border: 1px solid rgba(85, 214, 255, .10);
    border-radius: 11px;

    background:
        linear-gradient(
            90deg,
            rgba(85, 214, 255, .035),
            rgba(79, 124, 255, .055)
        );
}

.np-extra-item {
    display: flex;
    align-items: center;
    gap: 9px;
}

.np-extra-icon {
    width: 28px;
    height: 28px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border-radius: 8px;

    background: rgba(85, 214, 255, .08);
    border: 1px solid rgba(85, 214, 255, .12);

    color: #55D6FF;

    font-size: .85rem;
}

.np-extra-item strong {
    display: block;

    color: #DDE8F3;

    font-size: .72rem;
    font-weight: 800;

    line-height: 1.5;
}

.np-extra-item small {
    display: block;

    margin-top: 2px;

    color: #657D94;

    font-size: .60rem;

    line-height: 1.5;
}

.np-extra-status {
    display: flex;
    align-items: center;
    gap: 6px;

    white-space: nowrap;

    color: #6F879D;

    font-size: .61rem;
}

.np-extra-status span {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #55D6FF;

    box-shadow: 0 0 9px rgba(85, 214, 255, .55);
}


@media (min-width: 901px) {

    .np-head-title strong {
        font-size: .98rem;
    }

    .np-head-title small {
        font-size: .72rem;
    }

    .np-progress > span {
        font-size: .74rem;
    }

    .np-guide strong {
        font-size: .80rem;
    }

    .np-guide small {
        font-size: .68rem;
    }

    .np-guide-count {
        font-size: .69rem;
    }

    .np-piece-title span {
        font-size: .75rem;
    }

    .np-piece-title small {
        font-size: .64rem;
    }

    .np-footer {
        font-size: .64rem;
    }

    .np-footer button {
        font-size: .64rem;
    }
}