:root {
    --ink: #253331;
    --muted: #667572;
    --line: #dce9e4;
    --mint: #8edfc1;
    --mint-deep: #2f8f70;
    --warn: #efb75d;
    --bad: #df7c74;
    --paper: #fffefa;
    --shadow: 0 18px 45px rgba(45, 92, 78, 0.12);
    color-scheme: light;
    font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

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

a {
    color: inherit;
}

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

.site-header,
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.site-header {
    padding: 18px 0 8px;
}

.site-logo {
    color: var(--mint-deep);
    font-weight: 900;
    letter-spacing: 0.08em;
    text-decoration: none;
}

.site-nav,
.site-footer {
    color: var(--muted);
    font-size: 0.92rem;
}

.site-nav {
    display: flex;
    gap: 16px;
}

.site-nav a,
.site-footer a {
    text-decoration: none;
}

.reflex-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
    gap: clamp(20px, 5vw, 64px);
    align-items: center;
    padding: 56px 0 32px;
}

.series-label {
    margin: 0 0 10px;
    color: var(--mint-deep);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

h1 {
    margin: 0;
    font-size: clamp(2.25rem, 6vw, 4.8rem);
    line-height: 1.15;
    letter-spacing: 0;
}

.hero-copy p:not(.series-label) {
    max-width: 680px;
    margin: 18px 0 0;
    color: #40524f;
    font-size: 1.08rem;
}

.mini-lab {
    position: relative;
    min-height: 260px;
}

.mini-lab img {
    position: absolute;
    display: block;
    height: auto;
    filter: drop-shadow(0 16px 24px rgba(45, 92, 78, 0.14));
}

.lab-lamp {
    top: 0;
    right: 15%;
    width: min(52%, 170px);
    animation: lamp-sway 7s ease-in-out infinite;
}

.lab-button {
    right: 0;
    bottom: 18px;
    width: min(58%, 190px);
}

.game-shell {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
    padding: clamp(16px, 3vw, 28px);
}

.status-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.status-panel div {
    border: 1px solid #e7f1ed;
    border-radius: 8px;
    background: #fbfffd;
    padding: 12px;
}

.status-panel span {
    display: block;
    color: var(--mint-deep);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.status-panel strong {
    display: block;
    margin-top: 4px;
    font-size: clamp(1.2rem, 3vw, 1.7rem);
    line-height: 1.2;
}

.experiment-stage {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 320px;
    border: 1px solid #d8e9e3;
    border-radius: 8px;
    background:
        radial-gradient(circle at center 38%, rgba(142, 223, 193, 0.2), transparent 22%),
        linear-gradient(180deg, #ffffff 0%, #f8fffb 100%);
    color: var(--ink);
    cursor: pointer;
    text-align: center;
    transition: background 140ms ease, border-color 140ms ease, transform 120ms ease;
}

.experiment-stage:active {
    transform: translateY(1px);
}

.experiment-stage.waiting {
    background: linear-gradient(180deg, #fffefa 0%, #fbfaf3 100%);
}

.experiment-stage.ready {
    border-color: #67cba9;
    background:
        radial-gradient(circle at center 38%, rgba(142, 223, 193, 0.48), transparent 28%),
        linear-gradient(180deg, #f7fffb 0%, #e8f9f1 100%);
}

.experiment-stage.false-start {
    border-color: #f1b3ab;
    background: #fff6f4;
}

.stage-light {
    display: block;
    width: clamp(72px, 15vw, 126px);
    height: clamp(72px, 15vw, 126px);
    border: 2px solid #dbe9e4;
    border-radius: 50%;
    background: #f3f6f4;
    box-shadow: inset 0 0 0 10px #fff;
}

.waiting .stage-light {
    background: #fff1c9;
    box-shadow: inset 0 0 0 10px #fff, 0 0 26px rgba(239, 183, 93, 0.24);
}

.ready .stage-light {
    background: var(--mint);
    box-shadow: inset 0 0 0 10px #fff, 0 0 34px rgba(47, 143, 112, 0.3);
}

.false-start .stage-light {
    background: #f2a69e;
}

.stage-title {
    display: block;
    margin-top: 18px;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: 0.04em;
}

.stage-message {
    display: block;
    width: min(620px, calc(100% - 24px));
    color: var(--muted);
    font-weight: 700;
}

.control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 18px 0;
}

.primary-button,
.ghost-button {
    min-height: 46px;
    border-radius: 999px;
    padding: 0 22px;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.primary-button {
    border: 1px solid #78cfb0;
    background: #effbf6;
    color: #216f59;
}

.ghost-button {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
}

.result-panel {
    border-top: 1px solid #edf5f2;
    padding-top: 18px;
}

.result-panel h2 {
    margin: 0 0 6px;
    font-size: 1.25rem;
}

.result-panel p {
    margin: 0;
    color: var(--muted);
}

.log-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.log-list li {
    border: 1px solid #e1eee9;
    border-radius: 999px;
    background: #fbfffd;
    padding: 4px 12px;
    color: #3f504d;
    font-weight: 800;
}

.info-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 28px 0 48px;
}

.info-section article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    padding: 18px;
}

.info-section h2 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.info-section p {
    margin: 0;
    color: var(--muted);
}

.site-footer {
    border-top: 1px solid #edf5f2;
    padding: 32px 0 40px;
}

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

@media (max-width: 760px) {
    .site-header,
    .site-footer,
    .reflex-page {
        width: min(100% - 24px, 1080px);
    }

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

    .reflex-hero,
    .info-section {
        grid-template-columns: 1fr;
    }

    .reflex-hero {
        padding-top: 32px;
    }

    .mini-lab {
        min-height: 180px;
    }

    .status-panel {
        grid-template-columns: repeat(2, 1fr);
    }

    .experiment-stage {
        min-height: 280px;
    }
}
