
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;700;900&display=swap');

/* =========================
   RESET
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, #25104b 0%, transparent 35%),
        radial-gradient(circle at 80% 80%, #071e43 0%, transparent 35%),
        #080711;

    color: white;
    font-family: 'Vazirmatn', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 30px 15px;
}

/* =========================
   MAIN CONTAINER
========================= */

.container {
    width: 100%;
    max-width: 480px;
    text-align: center;
    padding: 35px 20px;
    border: 1px solid #773cff66;
    border-radius: 30px;
    background: #120d20c9;
    backdrop-filter: blur(15px);
    box-shadow:
        0 0 30px #792cff25,
        0 0 80px #176aff18;
    animation: appear 1.2s ease;
}

.top-label {
    color: #bd8aff;
    font-size: 12px;
    letter-spacing: 5px;
    animation: pulse 2s infinite;
}

.main-title {
    font-size: clamp(30px, 8vw, 43px);
    font-weight: 900;
    margin: 15px 0 25px;
    background: linear-gradient(90deg, #9b5cff, #38d9ff);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px #8246ff70;
}

/* =========================
   PHOTO
========================= */

.photo-frame {
    width: 220px;
    height: 220px;
    margin: 0 auto;
    padding: 7px;
    border-radius: 30px;
    position: relative;
    background: linear-gradient(
        135deg,
        #b34dff,
        #00d9ff,
        #b34dff
    );
    background-size: 300% 300%;
    animation:
        neon 4s linear infinite,
        float 3s ease-in-out infinite;
    box-shadow:
        0 0 20px #9d4dff,
        0 0 55px #147dff66;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
    background: #1a1030;
    display: block;
}

/* =========================
   TEXT
========================= */

.reza-name {
    margin-top: 28px;
    font-size: 42px;
    font-weight: 900;
    color: #c49aff;
    text-shadow:
        0 0 10px #9e54ff,
        0 0 30px #783cff;
    animation: pulse 2.5s infinite;
}

.subtitle {
    margin-top: 12px;
    color: #4edcff;
    font-size: 17px;
    font-weight: 700;
}

.toxic-text {
    margin-top: 25px;
    overflow: hidden;
}

.toxic-text span {
    display: inline-block;
    font-size: clamp(30px, 9vw, 48px);
    font-weight: 900;
    color: #ff35d3;
    text-shadow:
        0 0 10px #ff35d3,
        0 0 25px #8b35ff,
        0 0 50px #8b35ff;

    animation:
        toxicEntry 1.4s cubic-bezier(.17,.89,.32,1.49) both,
        toxicGlow 1.5s 1.4s infinite alternate;
}

/* =========================
   TOXIC ANIMATION
========================= */

@keyframes toxicEntry {
    0% {
        opacity: 0;
        transform: translateX(180px) rotate(25deg) scale(0);
        filter: blur(15px);
    }

    65% {
        opacity: 1;
        transform: translateX(-15px) rotate(-8deg) scale(1.3);
        filter: blur(0);
    }

    100% {
        transform: translateX(0) rotate(0) scale(1);
    }
}

@keyframes toxicGlow {
    from {
        text-shadow: 0 0 10px #ff35d3;
        transform: scale(1);
    }

    to {
        text-shadow:
            0 0 30px #ff35d3,
            0 0 60px #8035ff;
        transform: scale(1.06);
    }
}

/* =========================
   DIVIDER
========================= */

.divider {
    height: 2px;
    width: 65%;
    margin: 25px auto;
    background: linear-gradient(
        90deg,
        transparent,
        #a15bff,
        #36d8ff,
        transparent
    );
}

/* =========================
   FUNNY BOX
========================= */

.funny-box {
    background: #211439;
    border: 1px solid #8245ff70;
    padding: 18px;
    border-radius: 18px;
    animation: float 4s ease-in-out infinite;
}

.emoji {
    font-size: 35px;
    display: block;
    margin-bottom: 8px;
}

.funny-box p {
    color: #e0d5ff;
    font-size: 14px;
    line-height: 2;
}

/* =========================
   STATS
========================= */

.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 28px;
    gap: 10px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat span {
    font-size: 23px;
    font-weight: 900;
    color: #50dfff;
    text-shadow: 0 0 15px #00aeff;
}

.stat small {
    color: #bda7e9;
}

/* =========================
   FOOTER
========================= */

footer {
    margin-top: 35px;
    color: #8566b5;
    font-size: 10px;
    letter-spacing: 4px;
}

/* =========================
   GENERAL ANIMATIONS
========================= */

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(40px) scale(.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes neon {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .7; }
}

/* =========================
   INTRO SCREEN
========================= */

.intro-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: radial-gradient(circle, #241044, #05030b 75%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    text-align: center;
    padding: 20px;
}

.warning {
    color: #ff315d;
    font-size: 20px;
    font-weight: 900;
    animation: pulse .5s infinite alternate;
}

.intro-screen h1 {
    color: #c49aff;
    font-size: 40px;
    text-shadow: 0 0 25px #9b36ff;
}

.intro-screen p {
    color: #54dfff;
}

.countdown {
    font-size: 100px;
    font-weight: 900;
    color: #ff35d3;
    text-shadow: 0 0 40px #ff35d3;
}

.count-pop {
    animation: countPop .8s ease;
}

@keyframes countPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.5) rotate(15deg);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#startBtn {
    padding: 15px 35px;
    border: 2px solid #a34dff;
    border-radius: 15px;
    background: #301052;
    color: white;
    font-family: inherit;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 0 25px #923cff;
    animation: pulse 1s infinite;
}

#startBtn:disabled {
    opacity: .5;
}

.intro-out {
    animation: introExit .8s forwards;
    pointer-events: none;
}

@keyframes introExit {
    to {
        opacity: 0;
        visibility: hidden;
        transform: scale(1.5);
    }
}

/* =========================
   MAIN ENTRANCE
========================= */

body:not(.started) .container {
    opacity: 0;
    visibility: hidden;
    animation: none;
}

body.started .container {
    visibility: visible;
    animation: bossEntry 1.5s 1s both;
}

@keyframes bossEntry {
    0% {
        opacity: 0;
        transform: scale(.2) rotate(15deg);
        filter: blur(20px);
    }

    70% {
        opacity: 1;
        transform: scale(1.1) rotate(-3deg);
        filter: blur(0);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

/* =========================
   PHOTO ENTRANCE
========================= */

body:not(.started) .photo-frame {
    animation: none;
}

body.started .photo-frame {
    animation:
        photoEntry 1.3s 2.2s both,
        neon 4s 3.5s linear infinite,
        float 3s 3.5s ease-in-out infinite;
}

@keyframes photoEntry {
    0% {
        opacity: 0;
        transform: scale(0) rotate(180deg);
        filter: blur(20px);
    }

    70% {
        opacity: 1;
        transform: scale(1.2) rotate(-10deg);
    }

    100% {
        transform: scale(1) rotate(0);
        filter: blur(0);
    }
}

/* =========================
   TOXIC TEXT ENTRANCE
========================= */

body:not(.started) .toxic-text span {
    animation: none;
    opacity: 0;
}

body.started .toxic-text span {
    animation:
        toxicEntry 1.4s 3.5s both,
        toxicGlow 1.5s 4.9s infinite alternate;
}

/* =========================
   SCREEN SHAKE
========================= */

body.shake {
    animation: screenShake .12s infinite;
}

@keyframes screenShake {
    0% { transform: translate(0, 0); }
    25% { transform: translate(5px, -4px); }
    50% { transform: translate(-5px, 3px); }
    75% { transform: translate(4px, 4px); }
    100% { transform: translate(-3px, -4px); }
}

/* =========================
   FLASH
========================= */

.glitch-flash {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: white;
    opacity: 0;
    pointer-events: none;
}

.flash-active {
    animation: flashBang .7s ease;
}

@keyframes flashBang {
    0%, 100% { opacity: 0; }
    10% { opacity: .9; }
    30% { opacity: .1; }
    50% { opacity: .8; }
    70% { opacity: 0; }
}

/* =========================
   TOAST
========================= */

.toast {
    position: fixed;
    z-index: 500;
    top: 20px;
    left: 50%;
    transform: translate(-50%, -150px);
    width: max-content;
    max-width: 90%;
    background: #210d35;
    border: 1px solid #bd54ff;
    box-shadow: 0 0 25px #a32dff;
    border-radius: 15px;
    padding: 14px 20px;
    color: white;
    font-weight: 900;
    text-align: center;
    opacity: 0;
    pointer-events: none;
}

.toast-show {
    animation: toastIn 1.8s ease both;
}

@keyframes toastIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -150px) rotate(10deg);
    }

    20%, 75% {
        opacity: 1;
        transform: translate(-50%, 20px) rotate(0);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -100px);
    }
}

/* ==================================================
   RESPONSIVE
   DESKTOP: Original styles remain unchanged above 768px
================================================== */

/* =========================
   TABLET
========================= */

@media screen and (min-width: 481px) and (max-width: 768px) {

    body {
        padding: 25px 15px;
    }

    .container {
        max-width: 430px;
        padding: 30px 20px;
        border-radius: 25px;
    }

    .main-title {
        font-size: clamp(28px, 6vw, 38px);
    }

    .photo-frame {
        width: 200px;
        height: 200px;
    }

    .reza-name {
        font-size: 36px;
    }

    .subtitle {
        font-size: 16px;
    }

    .toxic-text span {
        font-size: clamp(28px, 7vw, 42px);
    }

    .funny-box {
        padding: 16px;
    }

    .stats {
        gap: 15px;
    }

    .stat span {
        font-size: 21px;
    }

    footer {
        letter-spacing: 2px;
    }
}

/* =========================
   MOBILE
========================= */

@media screen and (max-width: 480px) {

    body {
        padding: 20px 12px;
        align-items: center;
    }

    .container {
        width: 100%;
        max-width: 380px;
        padding: 28px 16px;
        border-radius: 23px;
    }

    .top-label {
        font-size: 10px;
        letter-spacing: 3px;
    }

    .main-title {
        font-size: 29px;
        margin: 12px 0 22px;
    }

    .photo-frame {
        width: 175px;
        height: 175px;
        padding: 6px;
        border-radius: 25px;
    }

    .photo-frame img {
        border-radius: 20px;
    }

    .reza-name {
        margin-top: 23px;
        font-size: 32px;
    }

    .subtitle {
        font-size: 14px;
    }

    .toxic-text {
        margin-top: 20px;
    }

    .toxic-text span {
        font-size: clamp(25px, 8vw, 36px);
    }

    .divider {
        width: 80%;
        margin: 22px auto;
    }

    .funny-box {
        padding: 15px 12px;
        border-radius: 15px;
    }

    .emoji {
        font-size: 30px;
    }

    .funny-box p {
        font-size: 12px;
        line-height: 2.2;
    }

    .stats {
        margin-top: 23px;
        gap: 8px;
    }

    .stat span {
        font-size: 19px;
    }

    .stat small {
        font-size: 11px;
    }

    footer {
        margin-top: 28px;
        font-size: 9px;
        letter-spacing: 1px;
    }

    /* INTRO */

    .intro-screen {
        padding: 20px 15px;
        gap: 17px;
    }

    .warning {
        font-size: 17px;
    }

    .intro-screen h1 {
        font-size: 30px;
    }

    .intro-screen p {
        font-size: 13px;
    }

    .countdown {
        font-size: 75px;
    }

    #startBtn {
        padding: 13px 28px;
        font-size: 16px;
    }

    /* TOAST */

    .toast {
        width: calc(100% - 30px);
        max-width: 350px;
        padding: 12px 15px;
        font-size: 13px;
    }
}

/* =========================
   VERY SMALL MOBILE
========================= */

@media screen and (max-width: 350px) {

    body {
        padding: 15px 8px;
    }

    .container {
        padding: 23px 12px;
    }

    .main-title {
        font-size: 25px;
    }

    .photo-frame {
        width: 150px;
        height: 150px;
    }

    .reza-name {
        font-size: 28px;
    }

    .toxic-text span {
        font-size: 25px;
    }

    .stats {
        gap: 5px;
    }

    .stat span {
        font-size: 17px;
    }

    .stat small {
        font-size: 10px;
    }

    .countdown {
        font-size: 60px;
    }

    .intro-screen h1 {
        font-size: 25px;
    }
}

/* =========================
   LANDSCAPE MOBILE
========================= */

@media screen and (max-height: 500px)
and (orientation: landscape)
and (max-width: 768px) {

    body {
        align-items: flex-start;
        padding: 20px 12px;
    }

    .container {
        max-width: 500px;
        margin: auto;
    }

    .photo-frame {
        width: 130px;
        height: 130px;
    }

    .reza-name {
        margin-top: 15px;
        font-size: 28px;
    }

    .main-title {
        margin: 10px 0 15px;
    }

    .intro-screen {
        gap: 10px;
        overflow-y: auto;
    }

    .countdown {
        font-size: 55px;
    }
}

/* =========================
   ACCESSIBILITY
========================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
