:root {
    color-scheme: light;
    --ink: #263332;
    --muted: #667572;
    --line: #dce9e4;
    --soft-line: #edf5f2;
    --mint: #8edfc1;
    --mint-deep: #2f8f70;
    --green: #dff5e9;
    --blue: #e2f1f7;
    --yellow: #fff4ce;
    --coral: #ffe5de;
    --lavender: #eee9ff;
    --sky: #e5f6ff;
    --paper: #fffefa;
    --shadow: 0 18px 45px rgba(45, 92, 78, 0.12);
    font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 50% 18%, rgba(142, 223, 193, 0.12), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #fdfffe 48%, #f8fcfa 100%);
    font-size: 16px;
    line-height: 1.8;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

.site-header,
.site-footer {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0 8px;
}

.site-logo {
    font-weight: 700;
    letter-spacing: 0;
}

.site-nav,
.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: var(--muted);
    font-size: 0.92rem;
}

.site-nav a:hover,
.site-footer a:hover {
    color: var(--mint-deep);
}

main {
    overflow: hidden;
}

.lab-hero,
.category-section,
.games-section,
.about-section,
.related-section {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

.lab-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 780px;
    padding: 44px 0 34px;
    text-align: center;
}

.lab-hero-text {
    position: relative;
    z-index: 5;
    width: min(760px, 100%);
}

.series-label,
.section-label,
.game-card-label,
.game-card-category,
.related-grid span {
    margin: 0;
    color: var(--mint-deep);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.lab-hero h1 {
    margin: 8px 0 8px;
    font-size: clamp(2.8rem, 7vw, 5.8rem);
    line-height: 1.12;
    letter-spacing: 0;
}

.hero-lead {
    max-width: 720px;
    margin: 18px auto 0;
    color: #3f504d;
    font-size: clamp(1rem, 1.6vw, 1.16rem);
}

.hero-note {
    margin: 12px 0 22px;
    color: var(--muted);
    font-weight: 700;
}

.hero-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border: 1px solid #78cfb0;
    border-radius: 999px;
    background: #effbf6;
    color: #216f59;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(47, 143, 112, 0.15);
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.hero-button:hover {
    transform: translateY(-2px);
    background: #e5f8f0;
    box-shadow: 0 14px 32px rgba(47, 143, 112, 0.2);
}

.lab-scene {
    position: relative;
    width: min(1180px, 100%);
    aspect-ratio: 16 / 7;
    margin: 34px auto 8px;
    overflow: visible;
}

.lab-desk {
    position: absolute;
    z-index: 1;
    left: 2%;
    bottom: 0;
    width: 96%;
    height: auto;
    border-radius: 8px;
    filter: drop-shadow(0 24px 34px rgba(77, 90, 83, 0.12));
}

.lab-item {
    position: absolute;
    z-index: 2;
    height: auto;
    pointer-events: none;
    transform-origin: center bottom;
    filter: drop-shadow(0 10px 14px rgba(57, 74, 68, 0.1));
}

.item-lamp {
    z-index: 3;
    left: 78%;
    bottom: 47.5%;
    width: 9.4%;
    animation: lamp-sway 7s ease-in-out infinite;
}

.item-notes {
    top: 30%;
    left: 15%;
    width: 8.5%;
    opacity: 0.68;
    transform: rotate(-5deg);
}

.item-test-tubes {
    left: 7%;
    bottom: 47.5%;
    width: 12.3%;
}

.item-flask {
    left: 23%;
    bottom: 47.8%;
    width: 7.8%;
}

.item-crt {
    left: 39%;
    bottom: 47.2%;
    width: 14.8%;
}

.item-keyboard {
    z-index: 3;
    left: 39.5%;
    bottom: 42.8%;
    width: 17.5%;
}

.item-wave-machine {
    left: 58.3%;
    bottom: 47.4%;
    width: 13%;
    animation: wave-glow 5.5s ease-in-out infinite;
}

.item-radar {
    left: 71.8%;
    bottom: 47.3%;
    width: 6.8%;
    animation: radar-blink 4.2s ease-in-out infinite;
}

.item-mug {
    left: 89%;
    bottom: 47.5%;
    width: 4.8%;
}

.item-ghost {
    left: 92%;
    bottom: 49%;
    width: 4.4%;
    animation: ghost-float 5.8s ease-in-out infinite;
}

@keyframes ghost-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes lamp-sway {
    0%, 100% {
        transform: rotate(-1deg);
    }
    50% {
        transform: rotate(1.5deg);
    }
}

@keyframes radar-blink {
    0%, 100% {
        filter: drop-shadow(0 10px 14px rgba(57, 74, 68, 0.1));
    }
    50% {
        filter: drop-shadow(0 10px 18px rgba(47, 143, 112, 0.28));
    }
}

@keyframes wave-glow {
    0%, 100% {
        filter: drop-shadow(0 10px 14px rgba(57, 74, 68, 0.1));
    }
    50% {
        filter: drop-shadow(0 10px 18px rgba(74, 184, 142, 0.24));
    }
}

@media (prefers-reduced-motion: reduce) {
    .lab-item {
        animation: none;
        transition: none;
    }
}

.series-label {
    margin: 0;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 2.25rem);
    line-height: 1.3;
    letter-spacing: 0;
}

.category-section,
.games-section,
.about-section,
.related-section {
    padding: 44px 0;
}

.category-section {
    margin-top: -4px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.category-card,
.game-card,
.about-grid article,
.related-grid a {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 28px rgba(42, 87, 74, 0.07);
}

.category-card {
    display: grid;
    gap: 3px;
    min-height: 94px;
    padding: 18px 14px;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.category-card span {
    color: var(--mint-deep);
    font-size: 0.8rem;
    font-weight: 900;
}

.category-card strong {
    font-size: 0.95rem;
}

.category-card:hover {
    transform: translateY(-2px);
    border-color: #9bdcc6;
    background: #f5fffb;
}

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

.game-card {
    position: relative;
    min-height: 260px;
    padding: 20px;
    overflow: hidden;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.game-card::after {
    content: "";
    position: absolute;
    right: -34px;
    bottom: -34px;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: var(--green);
    opacity: 0.75;
}

.game-card.yellow::after {
    background: var(--yellow);
}

.game-card.blue::after {
    background: var(--blue);
}

.game-card.lavender::after {
    background: var(--lavender);
}

.game-card.green::after {
    background: var(--green);
}

.game-card.coral::after {
    background: var(--coral);
}

.game-card.sky::after {
    background: var(--sky);
}

.game-card:hover {
    transform: translateY(-3px);
    border-color: #a8dfcc;
    box-shadow: var(--shadow);
}

.game-card.is-soon {
    cursor: default;
}

.game-card.is-soon:hover {
    transform: none;
    border-color: var(--line);
    box-shadow: 0 10px 28px rgba(42, 87, 74, 0.07);
}

.game-card-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f4faf7;
    color: #56716b;
    font-size: 0.78rem;
    font-weight: 800;
}

.game-card h3,
.about-grid h3 {
    position: relative;
    z-index: 1;
    margin: 10px 0 8px;
    font-size: 1.2rem;
    line-height: 1.45;
    letter-spacing: 0;
}

.game-card-icon {
    position: relative;
    z-index: 1;
    width: 92px;
    height: 92px;
    margin: 16px 0 12px;
    border: 1px solid var(--soft-line);
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
}

.game-card p,
.about-grid p {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--muted);
}

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

.about-grid article {
    padding: 22px;
}

.about-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #edf9f4;
    color: var(--mint-deep);
    font-weight: 900;
}

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

.related-grid a {
    display: grid;
    gap: 3px;
    padding: 16px 18px;
    transition: transform 160ms ease, border-color 160ms ease;
}

.related-grid a:hover {
    transform: translateY(-2px);
    border-color: #9bdcc6;
}

.related-grid strong {
    line-height: 1.45;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 36px 0 42px;
    border-top: 1px solid var(--soft-line);
    color: var(--muted);
}

.site-footer p {
    margin: 0;
    font-weight: 800;
}

@media (max-width: 920px) {
    .lab-hero {
        min-height: 0;
        padding-top: 42px;
    }

    .category-grid,
    .game-grid,
    .about-grid,
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    .site-header,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav,
    .site-footer nav {
        gap: 8px 14px;
    }

    .lab-hero,
    .category-section,
    .games-section,
    .about-section,
    .related-section,
    .site-header,
    .site-footer {
        width: min(100% - 24px, 1120px);
    }

    .lab-hero h1 {
        font-size: 2.75rem;
    }

    .lab-scene {
        width: calc(100% + 10px);
        margin-top: 18px;
    }

    .hero-lead br {
        display: none;
    }

    .section-heading {
        display: block;
    }

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .game-grid,
    .about-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }

    .game-card {
        min-height: 220px;
    }
}
