.games-page {
    --page-background-image: url("TOOL%E8%83%8C%E6%99%AF.PNG");
    --arcade-cyan: #36ddf5;
    --arcade-magenta: #f05bcb;
    --arcade-violet: #9568ff;
    --arcade-amber: #ffb85c;
    background-color: #080b10;
    color: #e8edf2;
}

.games-page::before {
    background-image:
        linear-gradient(180deg, rgb(8 11 16 / .94), rgb(8 11 16 / .78) 44%, #080b10 100%),
        repeating-linear-gradient(90deg, transparent 0 11.9%, rgb(160 180 200 / .045) 12% 12.08%, transparent 12.18% 24%),
        repeating-linear-gradient(0deg, transparent 0 119px, rgb(160 180 200 / .045) 120px, transparent 121px 240px),
        radial-gradient(ellipse at 50% 82%, rgb(54 221 245 / .09), transparent 48%),
        var(--page-background-image);
    background-position: center, center, center, center, center top;
    background-repeat: no-repeat, repeat, repeat, no-repeat, no-repeat;
    background-size: cover, auto, auto, cover, cover;
}

.games-page > header {
    min-height: 0;
    padding-top: 40px;
    padding-bottom: 30px;
}

.games-page header h1 .games-title-label {
    display: block;
    margin-bottom: .2em;
    color: #d7dce2;
    font-size: .48em;
    letter-spacing: .34em;
}

.games-page header h1 .games-title-arcade {
    display: block;
    color: #c9faff;
    text-shadow: 0 0 3px #36ddf5, 0 0 12px rgb(54 221 245 / .5), 0 0 28px rgb(54 221 245 / .23);
    animation: arcade-sign-glow 5s ease-in-out infinite;
}

.games-main {
    max-width: 1380px;
}

.games-section {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 48px clamp(20px, 4vw, 56px) 76px;
}

.games-section::before,
.games-section::after {
    position: absolute;
    z-index: -1;
    pointer-events: none;
    content: "";
}

.games-section::before {
    top: 0;
    right: 3%;
    bottom: 0;
    left: 3%;
    border-right: 1px solid rgb(54 221 245 / .14);
    border-left: 1px solid rgb(54 221 245 / .14);
    box-shadow: inset 1px 0 rgb(54 221 245 / .06), inset -1px 0 rgb(54 221 245 / .06);
}

.games-section::after {
    right: -5%;
    bottom: -34px;
    left: -5%;
    height: 190px;
    background:
        linear-gradient(180deg, transparent, rgb(8 11 16 / .8)),
        repeating-linear-gradient(90deg, transparent 0 9.9%, rgb(54 221 245 / .09) 10%, transparent 10.1% 20%);
    opacity: .48;
    transform: perspective(220px) rotateX(28deg);
    transform-origin: bottom;
}

.games-intro,
.games-intro-japanese {
    max-width: 760px;
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

.games-intro {
    margin-top: 0;
    margin-bottom: 6px;
    color: #e8edf2;
    font-size: clamp(1rem, 2vw, 1.15rem);
    letter-spacing: .035em;
}

.games-intro-japanese {
    margin-top: 0;
    margin-bottom: 38px;
    color: #a7b2be;
    font-size: .9rem;
}

.games-machine-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: clamp(20px, 2.4vw, 34px);
}

.arcade-machine {
    --machine-neon: var(--arcade-cyan);
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 14px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--machine-neon) 58%, #222b35);
    background:
        linear-gradient(135deg, rgb(255 255 255 / .055), transparent 28%),
        linear-gradient(155deg, #1a2028, #0d1117 46%, #090c11);
    box-shadow:
        inset 0 1px rgb(255 255 255 / .08),
        inset 0 0 24px rgb(0 0 0 / .65),
        0 14px 32px rgb(0 0 0 / .48),
        0 0 17px color-mix(in srgb, var(--machine-neon) 11%, transparent);
    color: #e8edf2;
    text-decoration: none;
    transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease, background-color .24s ease;
}

.arcade-machine::before,
.arcade-machine::after {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    content: "";
}

.arcade-machine::before {
    inset: 5px;
    border: 1px solid color-mix(in srgb, var(--machine-neon) 30%, transparent);
}

.arcade-machine::after {
    top: 18px;
    right: 18px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--machine-neon);
    box-shadow: 0 0 8px var(--machine-neon);
}

.arcade-machine-puzzle { --machine-neon: var(--arcade-cyan); }
.arcade-machine-fortress { --machine-neon: var(--arcade-violet); }
.arcade-machine-strike { --machine-neon: var(--arcade-magenta); }
.arcade-machine-loading { --machine-neon: var(--arcade-amber); }

.machine-marquee {
    display: flex;
    min-height: 88px;
    flex-direction: column;
    justify-content: center;
    padding: 4px 8px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--machine-neon) 50%, #303741);
    text-align: center;
}

.machine-index {
    margin-bottom: 4px;
    color: #aeb8c3;
    font-size: .62rem;
    letter-spacing: .18em;
}

.machine-title {
    color: #f2f5f8;
    font-size: clamp(1.05rem, 1.7vw, 1.4rem);
    font-weight: 800;
    letter-spacing: .105em;
    line-height: 1.3;
    text-shadow: 0 0 12px color-mix(in srgb, var(--machine-neon) 38%, transparent);
}

.machine-subtitle {
    margin-top: 4px;
    color: #c1c9d2;
    font-size: .77rem;
    letter-spacing: .045em;
}

.machine-screen {
    display: grid;
    min-height: 0;
    aspect-ratio: 16 / 10;
    place-items: center;
    margin: 14px 2px 16px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--machine-neon) 55%, #252d37);
    background:
        linear-gradient(145deg, #111720, #05070a),
        #080b10;
    box-shadow:
        inset 0 0 20px rgb(0 0 0 / .9),
        0 0 14px color-mix(in srgb, var(--machine-neon) 17%, transparent);
}

.machine-screen img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.arcade-machine-fortress .machine-screen {
    background:
        linear-gradient(90deg, rgb(149 104 255 / .08), transparent 20% 80%, rgb(149 104 255 / .08)),
        #05060a;
}

.arcade-machine-strike .machine-screen {
    border-radius: 50% / 8%;
}

.machine-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 0 5px;
}

.machine-description {
    color: #e8edf2;
    font-size: .91rem;
    font-weight: 600;
    line-height: 1.55;
}

.machine-japanese {
    margin-top: 8px;
    color: #b7c1cc;
    font-size: .82rem;
    line-height: 1.7;
}

.machine-play {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 20px 5px 3px;
    padding-top: 12px;
    border-top: 1px solid rgb(255 255 255 / .1);
    color: var(--machine-neon);
    font-size: .83rem;
    font-weight: 800;
    letter-spacing: .2em;
    text-shadow: 0 0 8px color-mix(in srgb, var(--machine-neon) 30%, transparent);
    transition: color .24s ease, text-shadow .24s ease;
}

.machine-play span {
    font-size: 1.35rem;
    line-height: 1;
    transition: transform .24s ease;
}

.arcade-machine:hover,
.arcade-machine:focus-visible {
    z-index: 2;
    border-color: var(--machine-neon);
    background-color: #171d25;
    box-shadow:
        inset 0 1px rgb(255 255 255 / .1),
        inset 0 0 26px rgb(0 0 0 / .55),
        0 18px 38px rgb(0 0 0 / .55),
        0 0 24px color-mix(in srgb, var(--machine-neon) 22%, transparent);
    transform: translateY(-4px);
}

.arcade-machine:hover .machine-play,
.arcade-machine:focus-visible .machine-play {
    color: #fff;
    text-shadow: 0 0 9px var(--machine-neon), 0 0 18px var(--machine-neon);
}

.arcade-machine:hover .machine-play span,
.arcade-machine:focus-visible .machine-play span {
    transform: translateX(4px);
}

.arcade-machine:focus-visible {
    outline: 2px solid #e8edf2;
    outline-offset: 5px;
}

.arcade-machine-loading {
    border-style: dashed;
    cursor: default;
}

.machine-loading-screen {
    position: relative;
    display: grid;
    min-height: 0;
    aspect-ratio: 16 / 10;
    place-items: center;
    margin: 14px 2px 16px;
    overflow: hidden;
    border: 1px solid rgb(255 184 92 / .32);
    background:
        radial-gradient(ellipse, rgb(255 184 92 / .07), transparent 55%),
        repeating-linear-gradient(0deg, transparent 0 5px, rgb(255 255 255 / .025) 6px, transparent 7px 12px),
        #080a0d;
}

.loading-orbit {
    position: absolute;
    width: 78px;
    aspect-ratio: 1;
    border: 1px solid rgb(255 184 92 / .38);
    border-radius: 50%;
    box-shadow: 0 0 20px rgb(255 184 92 / .08), inset 0 0 18px rgb(255 184 92 / .08);
    animation: machine-orbit 8s linear infinite;
}

.loading-orbit::before,
.loading-orbit::after {
    position: absolute;
    inset: 12px -8px;
    border: 1px solid rgb(255 184 92 / .24);
    border-radius: 50%;
    content: "";
}

.loading-orbit::after {
    transform: rotate(60deg);
}

.loading-message {
    z-index: 1;
    color: #e8c99e;
    font-size: .73rem;
    font-weight: 700;
    letter-spacing: .17em;
    line-height: 1.8;
    text-align: center;
    text-shadow: 0 0 8px rgb(255 184 92 / .42);
}

.loading-dots {
    animation: loading-pulse 1.8s steps(4, end) infinite;
}

.machine-play-loading {
    color: #be9b6a;
    text-shadow: none;
}

.games-notice {
    max-width: 860px;
    margin: 40px auto 0;
    padding-top: 17px;
    border-top: 1px solid rgb(255 255 255 / .1);
    color: #aeb8c3;
    font-size: .78rem;
    line-height: 1.7;
}

.games-notice p {
    margin: 0 0 8px;
}

.arcade-machine.machine-enter-pending {
    opacity: 0;
    transform: translateY(18px);
}

.arcade-machine {
    transition:
        opacity .55s ease,
        transform .55s ease,
        border-color .24s ease,
        box-shadow .24s ease,
        background-color .24s ease;
}

.arcade-machine:nth-child(2) { transition-delay: .08s; }
.arcade-machine:nth-child(3) { transition-delay: .16s; }
.arcade-machine:nth-child(4) { transition-delay: .24s; }

@keyframes arcade-sign-glow {
    0%, 100% { text-shadow: 0 0 3px #36ddf5, 0 0 12px rgb(54 221 245 / .5), 0 0 28px rgb(54 221 245 / .23); }
    50% { text-shadow: 0 0 4px #36ddf5, 0 0 16px rgb(54 221 245 / .62), 0 0 34px rgb(54 221 245 / .28); }
}

@keyframes machine-orbit {
    to { transform: rotate(360deg); }
}

@keyframes loading-pulse {
    0%, 20% { opacity: .25; }
    60%, 100% { opacity: 1; }
}

@media (max-width: 960px) {
    .games-machine-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }

    .machine-title {
        font-size: clamp(1.05rem, 2.5vw, 1.4rem);
    }
}

@media (max-width: 600px) {
    .games-page > header {
        padding: 32px 16px 24px;
    }

    .games-section {
        padding: 36px 20px 52px;
    }

    .games-section::before {
        right: 10px;
        left: 10px;
        border-right: 0;
        border-left: 0;
    }

    .games-section::after {
        opacity: .22;
    }

    .games-intro {
        font-size: .96rem;
    }

    .games-intro-japanese {
        margin-bottom: 28px;
        font-size: .84rem;
    }

    .games-machine-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .arcade-machine {
        padding: 12px;
    }

    .machine-marquee {
        min-height: 80px;
    }

    .machine-screen,
    .machine-loading-screen {
        aspect-ratio: 16 / 9;
    }
}

@media (prefers-reduced-motion: reduce) {
    .games-page header h1 .games-title-arcade,
    .loading-orbit,
    .loading-dots {
        animation: none;
    }

    .arcade-machine,
    .machine-play,
    .machine-play span {
        transition: none;
    }

    .arcade-machine.machine-enter-pending {
        opacity: 1;
        transform: none;
    }
}
