
* { box-sizing: border-box; margin: 0; padding: 0; }

@font-face{
    font-family: 'Saans';
    src: url('Saans-TRIAL-VF.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
}


body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0031bc; /* 你的品牌蓝 */
    color: white;
    font-family: "Saans", sans-serif;
}

#startBtn {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #0031bc;
    background: white;
}

.logo-wrapper {
    position: relative;
}

/* 参考背景图 - 用于调整字母位置 */
.logo-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200%;
    height: 200%;
    background-image: url('logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0; /* 半透明，方便对照 */
    pointer-events: none;
    z-index: -1;
}

#logo {
    font-size: 200px;
    line-height: 0.9;
    display: inline-block;
}

.letter {
    display: inline-block;
    --shake-amount: 8px;    /* 会被 JS 动态改 */
    --shake-speed: 0.8s;    /* 会被 JS 动态改 */
    --letter-x: 0px;        /* 字母独立位置 X */
    --letter-y: 0px;        /* 字母独立位置 Y */
    --letter-rotate: 0deg;  /* 字母独立旋转角度 */
    font-weight: 400;       /* 会被 JS 动态改 */
    
    /* 应用独立的位置和角度 */
    transform: translate(var(--letter-x), var(--letter-y)) rotate(var(--letter-rotate));
    
    animation-name: shakeY;
    animation-duration: var(--shake-speed);
    animation-iteration-count: infinite;
    animation-direction: alternate;
    animation-timing-function: ease-in-out;
    will-change: transform;
}

/* 换行用的 span */
.br {
    display: block;
    height: 0;
}

@keyframes shakeY {
    from {
        transform: 
            translate(var(--letter-x), calc(var(--letter-y) - var(--shake-amount))) 
            rotate(var(--letter-rotate));
    }
    to {
        transform: 
            translate(var(--letter-x), calc(var(--letter-y) + var(--shake-amount))) 
            rotate(var(--letter-rotate));
    }
}

/* 照片覆盖层 */
#photoOverlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

#photoOverlay.hidden {
    display: none;
}

#photoCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 模糊遮罩层 - 使用 SVG 作为 mask */
#logoBlurMask {
    position: absolute;
    width: 50vw;
    max-width: 800px;
    aspect-ratio: 1029.32 / 840.19;
    z-index: 11;
    
    /* 应用模糊效果 */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    /* 使用内联 SVG 作为 mask */
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1029.32 840.19"><polygon points="168.51 526.77 42.52 204.43 211.96 171.05 207.56 117.57 442.95 98.28 439.44 170.79 661.75 159.21 662.05 101.01 841.57 134.42 816.85 9 935.38 0 931.18 337.8 1029.32 351.82 928.3 635 744.77 643.92 744.68 688.63 561.06 681.36 563.95 627.96 539.73 676.39 338.35 715.9 317.91 640.85 254.48 780.48 76.32 840.19 0 590.81 168.51 526.77"/></svg>');
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1029.32 840.19"><polygon points="168.51 526.77 42.52 204.43 211.96 171.05 207.56 117.57 442.95 98.28 439.44 170.79 661.75 159.21 662.05 101.01 841.57 134.42 816.85 9 935.38 0 931.18 337.8 1029.32 351.82 928.3 635 744.77 643.92 744.68 688.63 561.06 681.36 563.95 627.96 539.73 676.39 338.35 715.9 317.91 640.85 254.48 780.48 76.32 840.19 0 590.81 168.51 526.77"/></svg>');
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
}

/* Logo SVG - 只显示白色描边，不模糊 */
#logoShape {
    position: absolute;
    width: 50vw;
    max-width: 800px;
    height: auto;
    z-index: 12;
    pointer-events: none;
}

#logoShape polygon {
    fill: none;
    stroke: white;
    stroke-width: 2px;
    vector-effect: non-scaling-stroke;
}

/* 照片信息层 - 文字和logo */
.photo-info {
    position: absolute;
    inset: 0;
    z-index: 13;
    pointer-events: none;
}

/* 随机生成的vocal group名字 */
.group-name {
    position: absolute;
    /* 默认位置和角度 - 您可以自己调整 */
    top: 35%;
    left: 32%;
    transform: rotate(-5deg);
    
    color: white;
    font-size: 45px;
    font-weight: 450;
    line-height: 1;
    /* text-transform: uppercase; */
    /* letter-spacing: 0.02em; */
}

/* 日期文字 */
.photo-date {
    position: absolute;
    /* 默认位置和角度 - 您可以自己调整 */
    top: calc(35% + 65px); /* 在名字下方 */
    left: 33%;
    transform: rotate(-5deg);
    
    color: white;
    font-size: 30px;
    font-weight: 450;
    line-height: 1;
    letter-spacing: 0.05em;
}

/* VG Logo 在右下角 */
.vg-logo {
    position: absolute;
    bottom: 35%;
    right: 32%;
    width: 120px;
    height: auto;
    object-fit: contain;
}

.hint {
    position: absolute;
    bottom: 20px;
    font-size: 14px;
    opacity: 0.7;
}

.hint.hidden {
    display: none;
}

.save-hint {
    position: absolute;
    bottom: 20px;
    font-size: 14px;
    opacity: 0.9;
    color: white;
    z-index: 20;
}

.save-hint.hidden {
    display: none;
}