
@font-face {
    font-family: 'IRANSansWeb';
    src: url('../../fonts/iransans/IRANSansWeb(FaNum).woff2') format('woff2'), url('../../fonts/iransans/IRANSansWeb(FaNum).woff') format('woff');
    font-weight: normal;
    font-display: swap;
}



/* ===================== فونت و ریست ===================== */
:root {
    --pink: #ff5fa2;
    --pink2: #ff8fc0;
    --purple: #7b4dff;
    --purple2: #a98bff;
    --yellow: #ffd23f;
    --orange: #ff9f1c;
    --green: #2ec4b6;
    --bg1: #fff0f6;
    --bg2: #e7f0ff;
    --ink: #3a2456;
    --shadow: 0 10px 30px rgba(123,77,255,.25);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: "IRANSansWeb",Tahoma,sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at 15% 10%, #ffe3f1 0, transparent 40%), radial-gradient(circle at 85% 90%, #dbe7ff 0, transparent 40%), linear-gradient(160deg, var(--bg1), var(--bg2));
    overflow: hidden;
    user-select: none;
    touch-action: none;
}

/* ===================== استیج موبایلی ===================== */
#app {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.phone {
    position: relative;
    width: min(100vw, 430px);
    height: min(100vh, 880px);
    max-height: 100vh;
    background: linear-gradient(160deg,#ffffff,#fff7fb);
    border-radius: 34px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (max-width:430px) {
    .phone {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}

/* ===================== حباب‌های پس‌زمینه ===================== */
.bubbles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

    .bubbles span {
        position: absolute;
        bottom: -60px;
        border-radius: 50%;
        background: radial-gradient(circle at 30% 30%, #ffffffaa, #ff9fce55);
        animation: rise linear infinite;
        opacity: .55;
    }

@keyframes rise {
    to {
        transform: translateY(-115vh) rotate(360deg);
        opacity: 0;
    }
}

/* ===================== صفحه‌ها ===================== */
.screen {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    flex-direction: column;
    padding: 22px;
    overflow: auto;
}

    .screen.active {
        display: flex;
        animation: fadeIn .45s ease both;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(.97);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===================== لوگو / برند ===================== */
.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}




.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes bob {
    0%,100% {
        transform: translateY(0) rotate(-3deg);
    }

    50% {
        transform: translateY(-10px) rotate(3deg);
    }
}

.brand h1 {
    margin: 8px 0 0;
    font-size: 30px;
    letter-spacing: -1px;
}

    .brand h1 b {
        color: var(--pink);
    }

.brand p {
    margin: 2px 0 0;
    color: #8a7aa6;
    font-size: 14px;
}

/* ===================== کارت ===================== */
.card {
    background: #fff;
    border-radius: 26px;
    padding: 20px;
    margin-top: 18px;
    box-shadow: 0 8px 24px rgba(123,77,255,.12);
    border: 2px solid #ffe3f1;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin: 0 4px 8px;
    color: #6b5a87;
}

.field {
    position: relative;
    margin-bottom: 16px;
}

    .field .ico {
        position: absolute;
        top: 50%;
        right: 14px;
        transform: translateY(-50%);
        font-size: 20px;
        opacity: .7;
    }

input {
    width: 100%;
    padding: 10px 15px;
    font-family: inherit;
    font-size: 16px;
    border: 2px solid #efe6ff;
    border-radius: 16px;
    background: #fbf8ff;
    color: var(--ink);
    transition: .2s;
    outline: none;
}

    input:focus {
        border-color: var(--purple2);
        background: #fff;
        box-shadow: 0 0 0 4px #a98bff33;
    }

    input.bad {
        border-color: #ff5d73;
        background: #fff2f4;
    }

.err {
    color: #ff5d73;
    font-size: 12px;
    margin: -10px 6px 12px;
    min-height: 14px;
    display: block;
}

/* ===================== سختی ===================== */
.diff-title {
    font-size: 15px;
    font-weight: 800;
    margin: 6px 4px 10px;
    color: #6b5a87;
}

.diffs {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 10px;
    margin-bottom: 6px;
}

.diff {
    cursor: pointer;
    border: 2px solid #efe6ff;
    border-radius: 18px;
    padding: 12px 6px;
    text-align: center;
    background: #fbf8ff;
    transition: .2s;
}

    .diff .emo {
        font-size: 26px;
    }

    .diff .nm {
        font-size: 14px;
        font-weight: 800;
        margin-top: 4px;
    }

    .diff .tm {
        font-size: 11px;
        color: #9a8ab5;
        margin-top: 2px;
    }

    .diff.sel {
        border-color: var(--pink);
        background: linear-gradient(160deg,#fff,#ffeef6);
        transform: translateY(-2px);
        box-shadow: 0 8px 18px #ff5fa233;
    }

/* ===================== دکمه ===================== */
.btn {
    width: 100%;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
    font-size: 18px;
    color: #fff;
    padding: 16px;
    border-radius: 18px;
    margin-top: 8px;
    background: linear-gradient(135deg,var(--pink),var(--purple));
    box-shadow: 0 10px 22px #ff5fa244;
    transition: .15s;
    letter-spacing: .3px;
}

    .btn:active {
        transform: scale(.96);
    }

    .btn.ghost {
        background: #fff;
        color: var(--purple);
        border: 2px solid #e6dbff;
        box-shadow: none;
    }

.btn-row {
    display: flex;
    gap: 10px;
}

    .btn-row .btn {
        margin-top: 14px;
    }

/* ===================== هدر بازی (HUD) ===================== */
.hud {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    z-index: 3;
}

.pill {
    background: #fff;
    border-radius: 16px;
    padding: 8px 12px;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 5px 14px rgba(123,77,255,.14);
    display: flex;
    align-items: center;
    gap: 6px;
    border: 2px solid #ffe3f1;
    min-width: 64px;
    justify-content: center;
}

    .pill.time {
        border-color: #ffe2b0;
    }

        .pill.time.warn {
            animation: flash .6s steps(2) infinite;
            color: #ff5d73;
            border-color: #ffb3c0;
        }

@keyframes flash {
    50% {
        background: #fff2f4;
    }
}

.pill small {
    font-size: 10px;
    opacity: .6;
    font-weight: 700;
}

.pill b {
    font-size: 17px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 2px solid #ffe3f1;
    background: #fff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(123,77,255,.14);
}

/* ===================== کنواس بازی ===================== */
.stage {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px 14px;
    transition: padding .45s ease;
}

#maze {
    width: 100%;
    height: 100%;
    border-radius: 24px;
    background: transparent;
    /*       box-shadow: inset 0 0 0 4px rgba(255,227,241,.6), 0 10px 26px rgba(123,77,255,.18);*/
    touch-action: none;
    transition: border-radius .45s ease;
}

/* ===== حالت تمام‌صفحه (فول‌اسکرین) حین بازی: ماز کل صفحه را می‌گیرد ===== */
.phone.immersive .stage {
    padding: 0;
}

.phone.immersive #maze {
    border-radius: 0;
}

.phone.immersive .hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 6;
    padding: max(45px, env(safe-area-inset-top)) 16px 16px;
    background: linear-gradient(to bottom, rgba(45,12,55,.55), rgba(45,12,55,0));
}

.hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffffcc;
    backdrop-filter: blur(4px);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: normal;
    color: #000000;
    box-shadow: var(--shadow);
    pointer-events: none;
    transition: .4s;
    text-align: center;
    line-height: normal;
}

/* ===================== مودال پایان ===================== */
.overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(58,36,86,.45);
    backdrop-filter: blur(6px);
}

    .overlay.active {
        display: flex;
        animation: fadeIn .3s ease both;
    }

.modal {
    width: 100%;
    max-width: 340px;
    background: #fff;
    border-radius: 28px;
    padding: 26px;
    text-align: center;
    box-shadow: var(--shadow);
    animation: pop .45s cubic-bezier(.2,1.4,.4,1) both;
}

@keyframes pop {
    from {
        transform: scale(.6);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal .big {
    font-size: 62px;
    line-height: 1;
    margin-bottom: 6px;
}

.modal h2 {
    margin: 6px 0;
    font-size: 26px;
}

.modal p {
    color: #8a7aa6;
    margin: 6px 0 4px;
    font-size: 15px;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0 6px;
}

.stat {
    background: #fbf8ff;
    border-radius: 16px;
    padding: 12px;
    border: 2px solid #efe6ff;
}

    .stat .v {
        font-size: 22px;
        font-weight: 900;
        color: var(--purple);
    }

    .stat .l {
        font-size: 11px;
        color: #9a8ab5;
        margin-top: 2px;
    }

/* ===================== کانفتی ===================== */
#fx {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}

.foot {
    margin-top: auto;
    text-align: center;
    font-size: 11px;
    color: #b3a6c9;
    padding: 12px 0 4px;
}

.badge {
    display: inline-block;
    background: #fff0f6;
    color: var(--pink);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 11px;
    margin-bottom: 8px;
}

/* ===================== شمارش معکوس شروع ===================== */
.countdown {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(123,77,255,.12), rgba(58,36,86,.45));
}

    .countdown.active {
        display: flex;
    }

    .countdown .num {
        font-size: 140px;
        font-weight: 900;
        color: #fff;
        text-shadow: 0 10px 40px rgba(123,77,255,.6), 0 0 0 #fff;
        animation: cd .9s cubic-bezier(.2,1.5,.4,1);
    }

        .countdown .num.go {
            font-size: 84px;
            color: var(--green);
        }

@keyframes cd {
    0% {
        transform: scale(.2) rotate(-20deg);
        opacity: 0;
    }

    40% {
        transform: scale(1.15) rotate(4deg);
        opacity: 1;
    }

    100% {
        transform: scale(.6);
        opacity: 0;
    }
}

/* ===================== کمبو ===================== */
.combo {
    position: absolute;
    top: 110px;
    left: 50%;
    transform: translateX(-50%) scale(.6);
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    font-weight: 900;
    font-size: 30px;
    color: #fff;
    text-shadow: 0 4px 14px rgba(255,95,162,.6);
    transition: opacity .15s;
}

    .combo.show {
        opacity: 1;
        animation: comboPop .5s cubic-bezier(.2,1.6,.4,1);
    }

@keyframes comboPop {
    0% {
        transform: translateX(-50%) scale(.4) rotate(-8deg);
    }

    60% {
        transform: translateX(-50%) scale(1.2) rotate(4deg);
    }

    100% {
        transform: translateX(-50%) scale(1);
    }
}

.combo small {
    display: block;
    font-size: 13px;
    color: #ffe98a;
    margin-top: -4px;
}

/* ===================== فلش برد ===================== */
.winflash {
    position: absolute;
    inset: 0;
    z-index: 9;
    background: #fff;
    opacity: 0;
    pointer-events: none;
}

    .winflash.go {
        animation: wf .6s ease-out;
    }

@keyframes wf {
    0% {
        opacity: .9;
    }

    100% {
        opacity: 0;
    }
}

/* ===================== ستاره‌های مرحله ===================== */
.stars {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 2px 0 8px;
    font-size: 40px;
}

    .stars span {
        opacity: .25;
        transform: scale(.8);
        display: inline-block;
    }

        .stars span.on {
            opacity: 1;
            animation: starPop .5s cubic-bezier(.2,1.6,.4,1) both;
        }

            .stars span.on:nth-child(2) {
                animation-delay: .18s;
            }

            .stars span.on:nth-child(3) {
                animation-delay: .36s;
            }

@keyframes starPop {
    0% {
        transform: scale(0) rotate(-40deg);
    }

    60% {
        transform: scale(1.3) rotate(10deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

/* ===================== دکمه صدا ===================== */
#maze {
    will-change: transform;
}

/* ===================== بک‌گراند موشن‌دار پاستیلی (کد-محور) ===================== */
.phone {
    background: linear-gradient(160deg, #ffd0e7 0%, #f3c4ee 45%, #d9bfff 100%);
}

#bgCanvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
}

#skyParticles {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.sky-particle {
    position: absolute;
    border-radius: 50%;
    animation: skyFloat linear infinite;
}

@keyframes skyFloat {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: .6;
    }

    100% {
        transform: translateY(-115vh) scale(.3);
        opacity: 0;
    }
}

/* ===================== صفحه‌ی خوش‌آمد (شیشه‌ای) ===================== */
#screen-register {
    align-items: center;
    padding: 18px;
    gap: 0;
    padding-top: 15%;
}

}

.welcome-inner {
    width: 100%;
    max-width: 330px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 13px;
}

.logo-wrap {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

    .logo-wrap .logo {
        width: 230px;
        /*           border-radius: 28px;*/
        /*               background: linear-gradient(145deg,var(--pink),var(--purple));*/
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 50px;
        /*             box-shadow: 0 10px 30px rgba(255,60,160,.5);*/
        overflow: hidden;
   
    }

        .logo-wrap .logo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

.tagline {
    font-size: 18px;
    color: #e85d12;
    font-weight: 800;
    /* background: linear-gradient(90deg, rgba(255, 140, 40, .55), rgba(255, 60, 160, .55)); */
    backdrop-filter: blur(8px);
    /* border: 1px solid rgba(255, 255, 255, .32); */
    border-radius: 20px;
    padding: 6px 18px;
    /* text-shadow: 0 1px 4px rgba(0, 0, 0, .35); */
    margin-bottom: 15px;
}

.gem-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    height: 22px;
    margin-bottom: 15px;
}

.gem {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    /*        box-shadow: 0 4px 10px rgba(0,0,0,.3), inset 0 -3px 6px rgba(0,0,0,.2), inset 0 3px 6px rgba(255,255,255,.55);*/
    animation: gemBob 1.2s ease-in-out infinite;
}

@keyframes gemBob {
    0%,100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-9px);
    }
}

.glass-card {
    width: 100%;
    background: rgba(255,255,255,.13);
    backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255,255,255,.32);
    border-radius: 22px;
    padding: 12px 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.25);
    margin-bottom: 10px;
}

    .glass-card .field {
        margin-bottom: 10px;
    }

        .glass-card .field:last-child {
            margin-bottom: 0;
        }

        .glass-card .field .ico {
            color: #a64d7d;
            opacity: .85;
        }

    .glass-card input {
        background: rgba(255,255,255,.94);
        border: 2px solid rgba(255,180,210,.55);
        color: #333;
        text-align: right;
    }

        .glass-card input:focus {
            border-color: var(--pink);
            background: #fff;
            box-shadow: 0 0 0 4px rgba(255,111,168,.22);
        }

        .glass-card input.bad {
            border-color: #ff5d73;
            background: #fff2f4;
        }

#screen-register .err {
    color: #ffd0d8;
    text-shadow: 0 1px 3px rgba(0,0,0,.4);
    margin: 6px 4px 0;
    min-height: 0;
}

    #screen-register .err:empty {
        margin: 0;
    }

.lv-title {
    font-size: 16px;
    font-weight: 800;
    color: #069edb;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 1px 3px rgba(0,0,0,.3);
}

#screen-register .diffs {
    grid-template-columns: repeat(3,1fr);
    gap: 8px;
    margin: 0;
}

#screen-register .diff {
    border: 2.5px solid rgba(255,255,255,.4);
    border-radius: 18px;
    padding: 11px 4px;
    background: rgba(255,255,255,.11);
    backdrop-filter: blur(10px);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,.2);
    text-shadow: 0 1px 3px rgba(0,0,0,.3);
}

    #screen-register .diff[data-d="easy"] {
        border-color: #4ade80;
    }

    #screen-register .diff[data-d="medium"] {
        border-color: #ffb347;
    }

    #screen-register .diff[data-d="hard"] {
        border-color: #ff6b6b;
    }

    #screen-register .diff .emo {
        font-size: 24px;
    }

    #screen-register .diff .nm {
        font-size: 13px;
        font-weight: 800;
        margin-top: 3px;
        color: #d8166e;
    }

    #screen-register .diff .tm {
        font-size: 10px;
        color: rgb(102 102 102);
        margin-top: 2px;
    }

    #screen-register .diff.sel {
        transform: scale(1.07);
        background: rgb(217 22 110 / 33%);
        box-shadow: 0 6px 22px rgba(0,0,0,.3);
    }

.btn-play {
    width: 100%;
    padding: 16px;
    border: none;
    cursor: pointer;
    background: linear-gradient(180deg,#FF90C4 0%,#FF3D8A 48%,#CC0060 100%);
    color: #fff;
    border-radius: 26px;
    font-family: inherit;
    font-weight: 900;
    font-size: 21px;
    letter-spacing: .5px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 0 #880040, 0 14px 30px rgba(200,0,80,.42), inset 0 2px 0 rgba(255,255,255,.32);
    text-shadow: 0 2px 6px rgba(0,0,0,.22);
    transition: transform .1s, box-shadow .1s;
}

    .btn-play::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 46%;
        background: rgba(255,255,255,.18);
        border-radius: 26px 26px 60% 60%;
    }

    .btn-play:active {
        transform: translateY(5px);
        box-shadow: 0 3px 0 #880040, 0 5px 14px rgba(200,0,80,.28);
    }

.welcome-hint {
    font-size: 11px;
    color: rgba(255,255,255,.7);
    text-align: center;
    line-height: 1.9;
    text-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* ===================== دکمه خروج ===================== */
.icon-btn.quit {
    color: #ff3d6e;
    font-weight: 900;
    line-height: 1;
}

/* ===================== انتخاب کاراکتر ===================== */
.char-title {
    font-size: 14px;
    font-weight: 800;
    color: #d8166e;
    text-align: center;
    margin-bottom: 12px;
    text-shadow: 0 1px 3px rgba(0,0,0,.25);
}

.chars {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 10px;
}

.char {
    cursor: pointer;
    border: 2.5px solid rgba(255,255,255,.4);
    border-radius: 18px;
    padding: 10px 4px 8px;
    background: rgba(255,255,255,.13);
    backdrop-filter: blur(10px);
    text-align: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.2);
    transition: .18s;
}

    .char canvas {
        width: 58px;
        height: 58px;
        display: block;
        margin: 0 auto;
    }

    .char .cnm {
        font-size: 13px;
        font-weight: 800;
        margin-top: 4px;
        color: #444444;
        text-shadow: 0 1px 3px rgba(0,0,0,.35);
    }

    .char.sel {
        transform: scale(1.07);
        background: rgb(217 22 110 / 33%);
        border-color: #ff7fb8;
        box-shadow: 0 6px 22px rgba(0,0,0,.3);
    }

