.counting-page {
    padding-bottom: 4rem;
    background:
        radial-gradient(circle at top left, rgba(255, 218, 125, 0.26), transparent 28%),
        radial-gradient(circle at top right, rgba(124, 198, 255, 0.2), transparent 26%),
        linear-gradient(180deg, #fffdf6 0%, #fdfefe 100%);
}

.counting-hero {
    padding: 1.5rem 0 0;
}

.counting-hero-inner {
    align-items: center;
    grid-template-columns: minmax(0, 1.1fr) minmax(220px, 340px);
}

.counting-copy p {
    max-width: 58ch;
    color: var(--muted);
}

.counting-hero-art {
    display: flex;
    justify-content: center;
}

.counting-hero-image {
    width: min(100%, 260px);
    height: auto;
    filter: drop-shadow(0 16px 28px rgba(23, 38, 60, 0.12));
}

.counting-sheet-wrap {
    margin-top: 1.5rem;
}

.counting-sheet {
    position: relative;
    padding: 2rem;
    border: 4px solid #23355b;
    border-radius: 28px;
    background:
        radial-gradient(circle at top left, rgba(255, 219, 130, 0.32) 0 24px, transparent 25px 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 249, 236, 0.95) 100%);
    box-shadow: 0 18px 42px rgba(23, 38, 60, 0.1);
    overflow: hidden;
}

.counting-sheet::before,
.counting-sheet::after {
    content: '';
    position: absolute;
    pointer-events: none;
    opacity: 0.14;
}

.counting-sheet::before {
    width: 120px;
    height: 120px;
    inset: 18px auto auto 24px;
    background: radial-gradient(circle, #ffcf54 0 14px, transparent 16px 100%);
}

.counting-sheet::after {
    width: 180px;
    height: 180px;
    right: -30px;
    top: -30px;
    background: radial-gradient(circle, #7fd1ff 0 12px, transparent 14px 100%);
}

.counting-header {
    position: relative;
    margin-bottom: 1.5rem;
}

.worksheet-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.counting-header h2 {
    margin-bottom: 0.5rem;
    font-size: clamp(2.2rem, 4vw, 3.3rem);
    font-family: "Trebuchet MS", "Comic Sans MS", Arial, sans-serif;
    color: #1b2e57;
    letter-spacing: 0.03em;
}

.counting-header p {
    margin: 0;
    color: #29466f;
    font-size: 1.15rem;
    font-weight: 700;
}

.worksheet-actions {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.question-grid {
    display: grid;
    gap: 0;
    border: 3px solid #23355b;
}

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

.counting-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 230px);
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border-right: 3px solid #23355b;
    border-bottom: 3px solid #23355b;
    background: rgba(255, 255, 255, 0.94);
}

.counting-card:nth-child(2n) {
    border-right: 0;
}

.counting-card:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.animal-stage {
    display: grid;
    gap: 0.75rem;
    justify-items: center;
}

.animal-question {
    margin: 0;
    color: #1b2e57;
    font-family: "Trebuchet MS", "Comic Sans MS", Arial, sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    text-align: center;
}

.animal-group {
    width: 100%;
    min-height: 168px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: end;
    justify-items: center;
    padding: 0.85rem;
    border: 3px solid rgba(35, 53, 91, 0.12);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.animal-group[data-count="1"] {
    grid-template-columns: 1fr;
}

.animal-group[data-count="3"] .animal-figure:first-child {
    grid-column: 1 / -1;
}

.animal-group[data-count="3"] .animal-figure:first-child img {
    width: 76px;
}

.animal-group[data-count="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.animal-figure {
    display: flex;
    align-items: end;
    justify-content: center;
    width: 100%;
}

.animal-figure img {
    width: clamp(54px, 7vw, 74px);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(23, 38, 60, 0.08));
}

.choice-column {
    display: grid;
    gap: 0.75rem;
}

.counting-choice {
    min-height: 66px;
    padding: 0.8rem 1rem;
    border: 3px solid #23355b;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fff7d8 100%);
    color: #14284f;
    font-family: "Trebuchet MS", "Comic Sans MS", Arial, sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.counting-choice:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(35, 53, 91, 0.1);
}

.counting-choice.is-wrong {
    background: #d64747;
    border-color: #a11f1f;
    color: #fff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
}

.counting-choice.is-right {
    background: #2ea85f;
    border-color: #1e7b42;
    color: #fff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
}

.counting-choice.is-locked {
    cursor: default;
}

.feedback-text {
    min-height: 24px;
    font-weight: 800;
    font-size: 1rem;
    color: #2f2f2f;
}

.feedback-text.is-right {
    color: #1e7b42;
}

.feedback-text.is-wrong {
    color: #a11f1f;
}

@media (max-width: 980px) {
    .counting-hero-inner {
        grid-template-columns: 1fr;
    }

    .counting-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .counting-sheet {
        padding: 1rem;
    }

    .counting-grid {
        grid-template-columns: 1fr;
    }

    .counting-card,
    .counting-card:nth-child(2n) {
        border-right: 0;
        border-bottom: 3px solid #23355b;
    }

    .counting-card:last-child {
        border-bottom: 0;
    }

    .counting-choice {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .counting-choice {
        min-height: 58px;
        font-size: 1.3rem;
    }

    .animal-group {
        min-height: 140px;
    }
}
