body {
    margin: 0;
}

.titleScreen {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    background: #0c0807;
    overflow: hidden;
    min-height: 100svh;
    transform-origin: 50% 45%;
    transition: transform 520ms cubic-bezier(.22, 1, .36, 1);
}

.titleScreen::before {
    content: "";
    position: absolute;
    inset: -20%;
    z-index: 0;
    pointer-events: none;

    background:
        radial-gradient(900px 600px at 20% 30%, rgba(164, 74, 203, .10), transparent 55%),
        radial-gradient(900px 600px at 80% 60%, rgba(90, 157, 245, .10), transparent 55%),
        radial-gradient(700px 500px at 55% 20%, rgba(255, 255, 255, .35), transparent 60%);
    filter: blur(10px) saturate(1.15) contrast(1.05);
    opacity: .9;

    animation: bgDrift 12s ease-in-out infinite;
    will-change: transform;
}

@keyframes bgDrift {

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

    50% {
        transform: translate3d(-2%, 1%, 0) scale(1.03);
    }
}

.titleScreen::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    mix-blend-mode: screen;

    filter:
        drop-shadow(0 0 10px rgba(255, 255, 255, .22)) drop-shadow(0 0 18px rgba(90, 157, 245, .14)) drop-shadow(0 0 18px rgba(164, 74, 203, .12));
    opacity: var(--p-opacity, .72);

    animation:
        particles 9s ease-in-out infinite,
        twinkle 1.6s steps(2, end) infinite;

    will-change: transform;
}

@keyframes particles {

    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    50% {
        transform: translate3d(12px, -10px, 0);
    }
}

@keyframes twinkle {

    0%,
    100% {
        filter: blur(.2px) brightness(1) contrast(1);
    }

    50% {
        filter: blur(.15px) brightness(1.18) contrast(1.08);
    }
}

.titleInner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 22px;
    transform: translateY(clamp(-32px, -3vh, -12px)) translateY(8px);
    opacity: 0;
    animation: fadeInTitle 900ms cubic-bezier(.22, 1, .36, 1) forwards;
    animation-delay: 200ms;
}

@keyframes fadeInTitle {
    0% {
        opacity: 0;
        transform: translateY(clamp(-32px, -3vh, -12px)) translateY(12px);
    }

    100% {
        opacity: 1;
        transform: translateY(clamp(-32px, -3vh, -12px)) translateY(0);
    }
}

.logo {
    margin: 0 auto;
    font: 900 64px/1.05 system-ui, "Zen Maru Gothic";
    letter-spacing: 0.06em;
    position: relative;
    display: inline-block;
    overflow: hidden;
    border-radius: 14px;
}

.logo span {
    position: relative;
    display: inline-block;
    padding: 12px 10px;

    color: transparent;
    -webkit-text-fill-color: transparent;

    animation:
        floatLogo 4.2s ease-in-out infinite,
        shadowBreath 4.2s ease-in-out infinite;
    animation-delay: 1.2s;
    animation-fill-mode: both;
    will-change: transform;
}

@keyframes floatLogo {

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

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

@keyframes shadowBreath {

    0%,
    100% {
        text-shadow: 0 10px 22px rgba(0, 0, 0, .08);
    }

    50% {
        text-shadow: 0 14px 26px rgba(0, 0, 0, .12);
    }
}

.logo span::before {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    z-index: 1;

    background: linear-gradient(90deg, #a44acb, #5a9df5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    text-shadow: 0 10px 22px rgba(0, 0, 0, .08);
    pointer-events: none;
}

.logo span::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;

    background: linear-gradient(120deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, .10) 38%,
            rgba(255, 255, 255, .95) 50%,
            rgba(255, 255, 255, .10) 62%,
            rgba(255, 255, 255, 0) 100%);

    background-size: 260% 100%;
    background-position: -140% 0;

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    mix-blend-mode: screen;
    opacity: .95;
    filter: blur(0.6px);

    animation: titleShineBG 3.2s ease-in-out infinite;
}

.logo.pause span::after {
    animation: none;
}

@keyframes titleShineBG {
    0% {
        background-position: 140% 0;
    }

    40% {
        background-position: -180% 0;
    }

    100% {
        background-position: -180% 0;
    }
}

.subtitle {
    margin: 14px 0 26px;
    font: 700 16px/1.2 system-ui, "Noto Sans JP";
    letter-spacing: 0.18em;
    color: rgba(58, 58, 58, .72);
    animation-delay: 0.35s;
}

.startBtn {
    -webkit-tap-highlight-color: transparent;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    width: min(320px, 86vw);
    height: 64px;
    border: none;
    border-radius: 999px;

    background: linear-gradient(90deg, #a44acb 0%, #7d77f0 40%, #5a9df5 100%);
    background-size: 200% 100%;
    background-position: 0% 50%;

    color: rgba(255, 255, 255, .96);
    font: 800 18px/1 system-ui, "Noto Sans JP";
    letter-spacing: 0.14em;
    cursor: pointer;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .16);

    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease,
        background-position .6s ease;

    animation: btnShine 6s ease-in-out infinite;
}

.startBtn:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 18px 46px rgba(0, 0, 0, .18);
    background-position: 100% 50%;
}

.startBtn:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .14);
}

@keyframes btnShine {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 48px;
    }
}

.startBtn::before,
.startBtn::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: sparkle 2s infinite ease-in-out;
}

.startBtn::before {
    top: -10px;
    left: 20%;
}

.startBtn::after {
    bottom: -10px;
    right: 20%;
}

@keyframes sparkle {

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

    50% {
        transform: scale(1.5);
        opacity: 1;
    }
}

.startBtn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 4px rgba(90, 157, 245, .22),
        0 16px 40px rgba(0, 0, 0, .16);
}

.howBtn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    z-index: 0;
    margin-top: 14px;
    width: min(260px, 70vw);
    height: 48px;
    border-radius: 999px;

    border: 1px solid rgba(160, 190, 255, .55);
    background: rgba(255, 255, 255, .06);

    color: rgba(255, 255, 255, .82);

    font: 700 14px/1 system-ui, "Noto Sans JP";
    letter-spacing: .18em;
    cursor: pointer;

    box-shadow:
        0 10px 26px rgba(0, 0, 0, .35),
        inset 0 1px 0 rgba(255, 255, 255, .10);

    transition:
        background .25s ease,
        color .25s ease,
        border-color .25s ease,
        transform .12s ease,
        box-shadow .25s ease;
    text-shadow: 0 0 10px rgba(120, 170, 255, .22);
}

.howBtn::before {
    content: "";
    position: absolute;
    top: -30%;
    left: -60%;
    width: 45%;
    height: 160%;
    pointer-events: none;
    z-index: 0;

    background: linear-gradient(120deg,
            transparent 0%,
            rgba(255, 255, 255, .0) 30%,
            rgba(255, 255, 255, .55) 50%,
            rgba(255, 255, 255, .0) 70%,
            transparent 100%);

    transform: skewX(-20deg);
    opacity: 0;
    transition: opacity .2s ease;
}

.howBtn:hover {
    background: rgba(255, 255, 255, .10);
    border-color: rgba(160, 190, 255, .80);
    color: rgba(255, 255, 255, .92);
    transform: translateY(-1px);
    box-shadow:
        0 14px 32px rgba(0, 0, 0, .45),
        inset 0 1px 0 rgba(255, 255, 255, .14);
}

.howBtn:hover::before {
    opacity: 1;
    animation: howShine 850ms cubic-bezier(.22, 1, .36, 1) 1;
    animation-fill-mode: both;
}

.howBtn:active {
    transform: translateY(1px);
    background: rgba(255, 255, 255, .08);
}

@keyframes howShine {
    0% {
        left: -60%;
    }

    100% {
        left: 120%;
    }
}

.howBtn:active {
    transform: translateY(1px);
}

.howBtn:active::before {
    opacity: 1;
    animation: howShine 520ms cubic-bezier(.22, 1, .36, 1) 1;
}

@media(max-width:480px) {
    .howBtn {
        margin-top: 18px;
    }
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s cubic-bezier(.22, 1, .36, 1);
}

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

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 28, .35);
    backdrop-filter: blur(6px);
}

.modal__panel {
    position: relative;
    width: min(520px, calc(100vw - 48px));
    border-radius: 22px;
    padding: 18px 18px 16px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
    border: 1px solid rgba(90, 157, 245, .18);
    transform: translateY(10px) scale(.98);
    transition: transform .22s cubic-bezier(.22, 1, .36, 1);
    z-index: 1;
    margin: 0 auto;
}

.modal.is-open .modal__panel {
    transform: translateY(0) scale(1);
}

.modal__title {
    margin: 6px 0 10px;
    font: 900 18px/1.2 system-ui, "Noto Sans JP";
    letter-spacing: .12em;
    color: rgba(58, 58, 58, .82);
    text-align: center;
}

.modal__content {
    padding: 10px 12px 6px;
    opacity: 0;
    transform: translateY(6px);
    transition: .25s ease;
}

.modal.is-open .modal__content {
    opacity: 1;
    transform: translateY(0);
}

.howList {
    margin: 0;
    padding-left: 1.2em;
    color: rgba(58, 58, 58, .78);
    font: 600 14px/1.7 system-ui, "Noto Sans JP";
}

.howNote {
    margin: 10px 0 0;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
}

.howNote__title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .10em;
    color: rgba(58, 58, 58, .70);
}

.howNote__body {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    color: rgba(58, 58, 58, .55);
    line-height: 1.7;
}

.modal__actions {
    display: flex;
    justify-content: center;
    padding: 10px 0 2px;
}

.modal__btn {
    width: min(220px, 70vw);
    height: 44px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(164, 74, 203, .85), rgba(90, 157, 245, .85));
    color: rgba(255, 255, 255, .96);
    font: 800 14px/1 system-ui, "Noto Sans JP";
    letter-spacing: .16em;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .14);
}

.modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 12px;
    background: rgba(250, 248, 244, .7);
    color: rgba(58, 58, 58, .7);
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}

#titleScreen {
    opacity: 1;
    transform: translateZ(0) scale(1);
    transform-origin: center;
    filter: blur(0);
    transition:
        opacity 420ms cubic-bezier(.22, 1, .36, 1),
        transform 420ms cubic-bezier(.22, 1, .36, 1),
        filter 420ms cubic-bezier(.22, 1, .36, 1);
    will-change: opacity, transform, filter;
    will-change: transform, filter;
}

body.isModalOpen #titleScreen {
    transform: translateZ(0) scale(0.98);
    filter: blur(1.4px);
}

#titleScreen.is-leaving {
    opacity: 0;
    transform: translateZ(0) scale(1.12);
    filter: blur(8px);
}

.titleScreen.zooming::after {
    animation: particlesCollect .5s forwards;
}

.titleScreen.is-zooming::after {
    animation: particlesCollect 520ms cubic-bezier(.22, 1, .36, 1) forwards;
    opacity: .95;
}

.titleScreen.is-zooming::before {
    animation: bgCollect 520ms cubic-bezier(.22, 1, .36, 1) forwards;
}

.titleScreen.is-zooming {
    transform: scale(1.08);
    --p-opacity: .95;
    --p2-opacity: .75;
}

.titleScreen.is-zooming .titleInner {
    transition: opacity 260ms ease;
    opacity: 0.2;
}

.titleScreen.is-zooming .sparkLayer {
    animation: particlesCollect2 520ms cubic-bezier(.22, 1, .36, 1) forwards;
    opacity: .7;
}

@keyframes particlesCollect2 {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(1.2px);
    }

    100% {
        transform: translate3d(0, 0, 0) scale(.2);
        filter: blur(2.2px);
    }
}

@keyframes particlesCollect {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: .9;
        filter: blur(0px);
    }

    100% {
        transform: translate3d(0, 0, 0) scale(0.15);
        opacity: 0;
        filter: blur(1.2px);
    }
}

@keyframes bgCollect {
    0% {
        transform: translate3d(0, 0, 0) scale(1.03);
        opacity: .9;
    }

    100% {
        transform: translate3d(0, 0, 0) scale(1.10);
        opacity: .75;
    }
}

.sparkLayer {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: var(--p2-opacity, .55);
    filter: blur(1.6px) drop-shadow(0 0 26px rgba(255, 255, 255, .22)) drop-shadow(0 0 30px rgba(90, 157, 245, .18)) drop-shadow(0 0 30px rgba(164, 74, 203, .16));

    background:
        radial-gradient(22px 22px at 18% 30%, rgba(255, 255, 255, .18), transparent 62%),
        radial-gradient(26px 26px at 72% 56%, rgba(90, 157, 245, .16), transparent 64%),
        radial-gradient(30px 30px at 45% 76%, rgba(164, 74, 203, .14), transparent 66%),
        radial-gradient(18px 18px at 84% 26%, rgba(255, 255, 255, .14), transparent 62%);

    animation:
        particles2 11s ease-in-out infinite,
        twinkle2 2.2s steps(2, end) infinite;
    will-change: transform;
}

@keyframes twinkle2 {

    0%,
    100% {
        opacity: var(--p2-opacity, .55);
    }

    50% {
        opacity: calc(var(--p2-opacity, .55) + .10);
    }
}

@keyframes particles2 {

    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    50% {
        transform: translate3d(-10px, 8px, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .logo span {
        animation: none;
    }

    .titleScreen::before,
    .titleScreen::after {
        animation: none;
    }

    .startBtn {
        animation: none;
    }

    .howBtn:hover::before {
        animation: none;
        opacity: .18;
    }

    .modal,
    .modal__panel {
        transition: none;
    }

    #titleScreen {
        transition: none;
    }

    #titleScreen {
        transition: none;
    }

    #titleScreen.is-leaving {
        transform: none;
        filter: none;
    }

    .titleScreen.is-zooming {
        transform: none;
    }

    .titleScreen.is-zooming::before,
    .titleScreen.is-zooming::after {
        animation: none;
    }
}

@media (pointer: fine) {
    .howNote {
        opacity: .75;
    }
}

@media (pointer: coarse) {
    .pcOnly {
        display: none;
    }

    .modal__content {
        padding: 6px 12px 6px;
    }
}

@media (max-width: 480px) {
    .sparkLayer {
        filter: blur(2px) drop-shadow(0 0 32px rgba(255, 255, 255, .22)) drop-shadow(0 0 34px rgba(90, 157, 245, .18)) drop-shadow(0 0 34px rgba(164, 74, 203, .16));
    }
}