* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ink: #172033;
    --muted: #64748b;
    --paper: #fff8eb;
    --card: #ffffff;
    --line: #d9e4ef;
    --blue: #2563eb;
    --green: #16a34a;
    --orange: #f97316;
    --rose: #e11d48;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
}

body {
    min-height: 100vh;
    color: var(--ink);
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 28%),
        radial-gradient(circle at 80% 18%, rgba(249, 115, 22, 0.18), transparent 30%),
        linear-gradient(180deg, #eff8ff 0%, var(--paper) 100%);
    touch-action: manipulation;
    user-select: none;
}

button,
a {
    font: inherit;
}

.game-shell {
    width: min(1180px, calc(100% - 24px));
    margin: 0 auto;
    padding: 18px 0 28px;
}

.game-header {
    display: grid;
    grid-template-columns: 54px 1fr 54px;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.home-link,
.sound-btn,
.small-btn,
.check-btn,
.next-btn {
    border: 0;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.home-link,
.sound-btn {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 18px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow);
    font-size: 24px;
}

.home-link:hover,
.sound-btn:hover,
.small-btn:hover,
.check-btn:hover,
.next-btn:hover {
    transform: translateY(-2px);
}

.eyebrow {
    color: #0f766e;
    font-weight: 800;
    font-size: 14px;
}

h1 {
    font-size: clamp(34px, 7vw, 62px);
    line-height: 1;
    letter-spacing: 0;
}

.game-board {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    grid-template-areas:
        "mission shelf"
        "basket shelf";
    gap: 16px;
}

.mission-panel,
.shelf-panel,
.basket-panel {
    border: 1px solid rgba(217, 228, 239, 0.95);
    border-radius: 22px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

.mission-panel {
    grid-area: mission;
}

.shelf-panel {
    grid-area: shelf;
}

.basket-panel {
    grid-area: basket;
}

.mission-title,
.panel-head,
.actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mission-title span,
.stats span {
    color: var(--muted);
    font-weight: 700;
}

.mission-title strong {
    border-radius: 999px;
    padding: 8px 12px;
    color: #9a3412;
    background: #ffedd5;
}

.mission-panel h2 {
    margin-top: 18px;
    font-size: 26px;
    line-height: 1.25;
}

.mission-chips {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.mission-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 16px;
    padding: 12px 14px;
    background: #f8fafc;
    color: var(--ink);
    font-weight: 800;
}

.mission-chip.done {
    background: #dcfce7;
    color: #166534;
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
}

.stats div {
    border-radius: 16px;
    padding: 14px;
    background: #eff6ff;
}

.stats strong {
    display: block;
    margin-top: 6px;
    color: var(--blue);
    font-size: 28px;
}

.panel-head h2 {
    font-size: 26px;
}

.small-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 999px;
    padding: 0 14px;
    color: white;
    background: var(--blue);
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.small-btn.muted {
    color: var(--ink);
    background: #eef2f7;
}

.shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.item-card {
    min-height: 140px;
    border: 3px solid transparent;
    border-radius: 20px;
    padding: 12px;
    background: #f8fafc;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

.item-card:active {
    transform: scale(0.98);
}

.item-card.selected {
    border-color: var(--green);
    background: #ecfdf5;
}

.item-emoji {
    display: grid;
    height: 60px;
    place-items: center;
    font-size: 42px;
}

.item-name {
    margin-top: 8px;
    font-size: 19px;
    font-weight: 900;
    text-align: center;
}

.item-kind {
    margin-top: 6px;
    color: var(--muted);
    font-weight: 700;
    text-align: center;
}

.basket-grid {
    display: grid;
    min-height: 148px;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 18px;
}

.basket-slot {
    display: grid;
    min-height: 78px;
    place-items: center;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    color: #94a3b8;
    font-size: 30px;
    font-weight: 900;
}

.basket-slot.filled {
    border-style: solid;
    border-color: #86efac;
    background: #f0fdf4;
}

.feedback {
    min-height: 58px;
    margin-top: 16px;
    border-radius: 16px;
    padding: 14px;
    background: #f8fafc;
    color: var(--muted);
    font-weight: 800;
    line-height: 1.5;
}

.feedback.good {
    color: #166534;
    background: #dcfce7;
}

.feedback.try {
    color: #9a3412;
    background: #ffedd5;
}

.actions {
    margin-top: 14px;
}

.check-btn,
.next-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    flex: 1;
    border-radius: 18px;
    padding: 0 16px;
    color: white;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.check-btn {
    background: var(--green);
}

.next-btn {
    display: none;
    background: var(--orange);
}

@media (max-width: 920px) {
    .game-board {
        grid-template-columns: 1fr;
        grid-template-areas:
            "mission"
            "shelf"
            "basket";
    }
}

@media (max-width: 540px) {
    .game-shell {
        width: min(100% - 16px, 1180px);
        padding-top: 10px;
    }

    .game-header {
        grid-template-columns: 46px 1fr 46px;
    }

    .home-link,
    .sound-btn {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }

    .mission-panel,
    .shelf-panel,
    .basket-panel {
        border-radius: 18px;
        padding: 16px;
    }

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

    .item-card {
        min-height: 128px;
    }

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

    .actions {
        flex-direction: column;
    }

    .check-btn,
    .next-btn {
        width: 100%;
    }
}
