:root {
    --ink: #263331;
    --muted: #667773;
    --line: #d9ebe4;
    --mint: #68b89c;
    --mint-dark: #2f8a72;
    --paper: #fffefb;
    --soft: #f6fbf8;
    --green: #7cc8a4;
    --danger: #ff9f8f;
    --shadow: 0 18px 48px rgba(34, 83, 71, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.75;
    background:
        radial-gradient(circle at 18% 18%, rgba(104, 184, 156, 0.14), transparent 28%),
        radial-gradient(circle at 88% 22%, rgba(126, 200, 164, 0.15), transparent 30%),
        #fff;
}

a {
    color: inherit;
}

.site-header,
.site-footer {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.site-header {
    min-height: 70px;
}

.site-logo {
    color: var(--mint-dark);
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

.site-nav,
.site-footer {
    flex-wrap: wrap;
}

.site-nav {
    display: flex;
    gap: 14px;
    color: var(--muted);
    font-size: 0.86rem;
}

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

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

.mouse-page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto 64px;
}

.mouse-hero {
    min-height: 430px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    align-items: center;
    gap: clamp(26px, 5vw, 70px);
    padding: 34px 0 44px;
}

.series-label {
    margin: 0 0 12px;
    color: var(--mint-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(2.1rem, 5vw, 4rem);
    line-height: 1.15;
}

.hero-copy p:last-child {
    max-width: 620px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.8vw, 1.12rem);
}

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

.mini-lab img {
    position: absolute;
    display: block;
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 18px 24px rgba(47, 84, 73, 0.12));
}

.lab-mouse {
    width: min(56%, 260px);
    left: 12%;
    bottom: 14%;
    animation: floaty 4s ease-in-out infinite;
}

.lab-scope {
    width: min(28%, 130px);
    right: 12%;
    top: 16%;
}

.lab-panel {
    width: min(32%, 142px);
    right: 24%;
    bottom: 12%;
}

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

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

.status-panel div {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
    padding: 12px;
}

.status-panel span {
    display: block;
    color: var(--mint-dark);
    font-size: 0.72rem;
    font-weight: 800;
}

.status-panel strong {
    display: block;
    margin-top: 2px;
    font-size: clamp(1.1rem, 2.7vw, 1.6rem);
    line-height: 1.2;
}

.maze-board {
    position: relative;
    overflow: hidden;
    min-height: 390px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(104, 184, 156, 0.06) 1px, transparent 1px),
        linear-gradient(rgba(104, 184, 156, 0.06) 1px, transparent 1px),
        var(--paper);
    background-size: 34px 34px;
    touch-action: none;
}

.maze-wall {
    position: absolute;
    border-radius: 8px;
    background: rgba(104, 184, 156, 0.22);
    border: 1px solid rgba(47, 138, 114, 0.18);
}

.wall-a {
    left: 16%;
    top: 18%;
    width: 68%;
    height: 36px;
}

.wall-b {
    left: 16%;
    top: 18%;
    width: 36px;
    height: 48%;
}

.wall-c {
    right: 16%;
    top: 32%;
    width: 36px;
    height: 42%;
}

.wall-d {
    left: 26%;
    bottom: 24%;
    width: 58%;
    height: 34px;
}

.wall-e {
    left: 38%;
    top: 40%;
    width: 30%;
    height: 32px;
}

.maze-start,
.maze-goal {
    position: absolute;
    z-index: 2;
    width: 94px;
    height: 54px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    font: 900 0.95rem system-ui, sans-serif;
    cursor: pointer;
}

.maze-start {
    left: 32px;
    bottom: 32px;
    background: var(--mint-dark);
}

.maze-goal {
    right: 32px;
    top: 32px;
    background: #5d9d82;
}

.maze-cursor {
    position: absolute;
    z-index: 3;
    left: 78px;
    bottom: 58px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #fff;
    border: 3px solid var(--mint-dark);
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
}

.maze-board.is-running .maze-cursor {
    opacity: 1;
}

.maze-board.is-hit {
    animation: hit 0.25s ease;
}

.maze-message {
    position: absolute;
    left: 50%;
    bottom: 20px;
    width: min(88%, 560px);
    margin: 0;
    color: var(--muted);
    font-weight: 700;
    text-align: center;
    transform: translateX(-50%);
}

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

.primary-button,
.ghost-button {
    appearance: none;
    min-height: 48px;
    border-radius: 8px;
    padding: 0 22px;
    border: 0;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.primary-button {
    background: var(--mint-dark);
    color: #fff;
    box-shadow: 0 10px 22px rgba(47, 138, 114, 0.22);
}

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

.result-panel {
    margin-top: 20px;
    border-top: 1px dashed #c9dfd7;
    padding-top: 18px;
}

.result-panel h2 {
    margin: 0 0 4px;
    font-size: clamp(1.25rem, 3vw, 1.7rem);
}

.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 var(--line);
    border-radius: 999px;
    background: #f3fbf7;
    padding: 4px 10px;
    color: var(--mint-dark);
    font-size: 0.86rem;
}

.info-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 28px;
}

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

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

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

.info-section a {
    color: var(--mint-dark);
    font-weight: 700;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 26px 0 38px;
    color: var(--muted);
    font-size: 0.86rem;
}

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

@keyframes hit {
    0%, 100% {
        box-shadow: none;
    }
    50% {
        box-shadow: inset 0 0 0 999px rgba(255, 159, 143, 0.16);
    }
}

@media (max-width: 820px) {
    .mouse-hero {
        grid-template-columns: 1fr;
        min-height: 0;
        text-align: center;
    }

    .hero-copy p:last-child {
        margin-left: auto;
        margin-right: auto;
    }

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

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

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

@media (max-width: 540px) {
    .site-header,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .maze-board {
        min-height: 340px;
    }

    .maze-start,
    .maze-goal {
        width: 76px;
        height: 48px;
    }

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