.lcmg-player {
    --lcmg-navy: #16325c;
    --lcmg-blue: #2374ab;
    --lcmg-sky: #eaf7ff;
    --lcmg-yellow: #ffd166;
    --lcmg-green: #198754;
    --lcmg-red: #b42318;
    max-width: 820px;
    margin: 1.5rem auto;
    overflow: hidden;
    border: 2px solid #cfe7f5;
    border-radius: 20px;
    background: #fff;
    color: #1c2733;
    box-shadow: 0 12px 32px rgba(22, 50, 92, .12);
    font-family: inherit;
}

.lcmg-player *,
.lcmg-player *::before,
.lcmg-player *::after {
    box-sizing: border-box;
}

.lcmg-header {
    padding: clamp(1.25rem, 4vw, 2.25rem);
    background: linear-gradient(135deg, var(--lcmg-navy), var(--lcmg-blue));
    color: #fff;
}

.lcmg-title {
    margin: 0;
    color: inherit;
    font-size: clamp(1.6rem, 4vw, 2.35rem);
    line-height: 1.15;
}

.lcmg-instructions {
    margin: .7rem 0 0;
    color: inherit;
    font-size: 1.05rem;
}

.lcmg-progress {
    height: 9px;
    background: #dceaf3;
}

.lcmg-progress__bar {
    height: 100%;
    width: 0;
    background: var(--lcmg-yellow);
    transition: width .25s ease;
}

.lcmg-stage {
    padding: clamp(1.25rem, 4vw, 2.5rem);
}

.lcmg-counter {
    margin: 0 0 .4rem;
    color: #52606d;
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.lcmg-prompt {
    margin: 0 0 1.5rem;
    color: var(--lcmg-navy);
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    line-height: 1.3;
}

.lcmg-targets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(.5rem, 2vw, 1rem);
    max-width: 570px;
    margin: 0 auto 1rem;
}

.lcmg-target-wrap {
    display: grid;
    gap: .45rem;
    text-align: center;
}

.lcmg-target-label {
    color: var(--lcmg-navy);
    font-weight: 800;
}

.lcmg-target {
    display: grid;
    min-height: clamp(82px, 18vw, 130px);
    place-items: center;
    border: 3px dashed #80b9dc;
    border-radius: 16px;
    background: var(--lcmg-sky);
    color: #52758d;
    font: 800 clamp(2rem, 8vw, 4.4rem)/1 inherit;
    cursor: pointer;
}

.lcmg-target.is-filled {
    border-style: solid;
    border-color: var(--lcmg-blue);
    background: #fff;
    color: var(--lcmg-navy);
}

.lcmg-target.is-over {
    outline: 4px solid var(--lcmg-yellow);
    outline-offset: 2px;
}

.lcmg-small-hint {
    margin: .8rem 0;
    color: #52606d;
    text-align: center;
    font-size: .92rem;
}

.lcmg-tile-tray {
    display: flex;
    min-height: 78px;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
    justify-content: center;
    padding: .9rem;
    border-radius: 14px;
    background: #f5f8fa;
}

.lcmg-tile {
    width: 58px;
    height: 58px;
    border: 2px solid #c58b00;
    border-radius: 12px;
    background: var(--lcmg-yellow);
    color: #432f00;
    box-shadow: 0 4px 0 #c58b00;
    font: 800 1.8rem/1 inherit;
    cursor: grab;
}

.lcmg-tile:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #c58b00;
}

.lcmg-tile.is-selected {
    outline: 4px solid var(--lcmg-blue);
    outline-offset: 3px;
}

.lcmg-choices {
    display: grid;
    gap: .75rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.lcmg-choice {
    display: flex;
    gap: .8rem;
    align-items: center;
    padding: .9rem 1rem;
    border: 2px solid #cfe1ec;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.lcmg-choice:hover,
.lcmg-choice:has(input:checked) {
    border-color: var(--lcmg-blue);
    background: var(--lcmg-sky);
}

.lcmg-choice input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    accent-color: var(--lcmg-blue);
}

.lcmg-answer-label {
    display: grid;
    max-width: 440px;
    gap: .5rem;
    color: var(--lcmg-navy);
    font-weight: 700;
}

.lcmg-answer-input {
    min-height: 52px;
    padding: .65rem .8rem;
    border: 2px solid #9bb9ca;
    border-radius: 10px;
    font: 600 1.2rem/1.2 inherit;
}

.lcmg-number-grid-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 180px);
    gap: clamp(1rem, 3vw, 2rem);
    align-items: start;
}

.lcmg-number-grid {
    display: grid;
    grid-template-columns: repeat(var(--lcmg-grid-columns), minmax(0, 1fr));
    border: 2px solid var(--lcmg-navy);
    background: var(--lcmg-navy);
    gap: 2px;
}

.lcmg-grid-cell {
    display: grid;
    min-width: 0;
    aspect-ratio: 1;
    place-items: center;
    padding: .2rem;
    border: 0;
    border-radius: 0;
    color: #122033;
    font: 800 clamp(.82rem, 3.6vw, 1.75rem)/1 inherit;
}

.lcmg-grid-cell--tone-0 {
    background: #94d0df;
}

.lcmg-grid-cell--tone-1 {
    background: #dbe8f3;
}

.lcmg-grid-cell--tone-2 {
    background: #f28c18;
}

.lcmg-grid-cell--tone-3 {
    background: #9bd64e;
}

.lcmg-grid-target {
    border: 3px dashed #9aa8b4;
    background: #fff;
    color: #65727d;
    cursor: pointer;
}

.lcmg-grid-target.is-filled {
    border-style: solid;
    border-color: var(--lcmg-blue);
    background: #f7fbfe;
    color: var(--lcmg-navy);
}

.lcmg-grid-target.is-over {
    outline: 4px solid var(--lcmg-yellow);
    outline-offset: -5px;
}

.lcmg-grid-tray-title {
    margin: 0 0 .55rem;
    color: var(--lcmg-navy);
    font-weight: 800;
    text-align: center;
}

.lcmg-grid-tile-tray {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    gap: .65rem;
}

.lcmg-grid-tile {
    min-height: 62px;
    padding: .5rem;
    border: 2px solid #aeb5bb;
    border-radius: 10px;
    background: #e2e3e5;
    color: #16191c;
    box-shadow: 0 3px 0 #aeb5bb;
    font: 800 1.35rem/1 inherit;
    cursor: grab;
}

.lcmg-grid-tile.is-selected {
    outline: 4px solid var(--lcmg-blue);
    outline-offset: 3px;
}

.lcmg-number-line-wrap {
    overflow-x: auto;
    padding: .5rem .25rem;
}

.lcmg-number-line {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--lcmg-line-columns), minmax(52px, 1fr));
    min-width: max-content;
    margin: 1rem 0 1.5rem;
    padding-top: 1rem;
}

.lcmg-number-line::before {
    position: absolute;
    top: 1.43rem;
    right: 1.6rem;
    left: 1.6rem;
    height: 4px;
    background: var(--lcmg-navy);
    content: '';
}

.lcmg-line-tick {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 82px;
    place-items: start center;
}

.lcmg-line-marker {
    width: 4px;
    height: 22px;
    background: var(--lcmg-navy);
}

.lcmg-line-label,
.lcmg-line-target {
    margin-top: .5rem;
    font-weight: 800;
}

.lcmg-line-target {
    min-width: 44px;
    min-height: 42px;
    border: 2px dashed #8da7b8;
    border-radius: 8px;
    background: #fff;
    color: #65727d;
}

.lcmg-line-target.is-filled {
    border-style: solid;
    border-color: var(--lcmg-blue);
    color: var(--lcmg-navy);
}

.lcmg-line-target.is-over {
    outline: 4px solid var(--lcmg-yellow);
}

.lcmg-number-line-tray,
.lcmg-single-tray {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.lcmg-ten-frames {
    display: grid;
    grid-template-columns: repeat(5, minmax(48px, 76px));
    gap: 6px;
    justify-content: center;
    padding: 8px;
    border: 4px solid var(--lcmg-navy);
    border-radius: 12px;
    background: #eef6fb;
}

.lcmg-ten-cell {
    aspect-ratio: 1;
    border: 2px solid #91a8b7;
    border-radius: 50%;
    background: #fff;
}

.lcmg-ten-cell.is-filled {
    border-color: #b66d00;
    background: var(--lcmg-yellow);
    box-shadow: inset 0 0 0 5px #fff4cf;
}

.lcmg-model-total,
.lcmg-array-equation {
    margin: 1rem 0 0;
    color: var(--lcmg-navy);
    font-size: 1.35rem;
    font-weight: 850;
    text-align: center;
}

.lcmg-base-ten-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}

.lcmg-place-control {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    gap: .35rem;
    align-items: center;
    text-align: center;
}

.lcmg-place-control strong {
    grid-column: 1 / -1;
}

.lcmg-step-button {
    min-height: 42px;
    border: 2px solid var(--lcmg-blue);
    border-radius: 9px;
    background: #fff;
    color: var(--lcmg-blue);
    font-size: 1.4rem;
    font-weight: 800;
}

.lcmg-place-count {
    font-size: 1.35rem;
    font-weight: 850;
}

.lcmg-base-ten-visual {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    min-height: 130px;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: #f4f8fb;
}

.lcmg-base-ten-place {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-content: flex-start;
    justify-content: center;
}

.lcmg-base-block {
    display: inline-block;
    border: 1px solid #986400;
    background: var(--lcmg-yellow);
}

.lcmg-base-block--hundreds {
    width: 44px;
    height: 44px;
    background-image: linear-gradient(#d69b17 1px, transparent 1px), linear-gradient(90deg, #d69b17 1px, transparent 1px);
    background-size: 8px 8px;
}

.lcmg-base-block--tens {
    width: 12px;
    height: 54px;
}

.lcmg-base-block--ones {
    width: 15px;
    height: 15px;
}

.lcmg-bond-diagram {
    position: relative;
    width: min(100%, 430px);
    min-height: 270px;
    margin: 0 auto 1rem;
}

.lcmg-bond-circle,
.lcmg-bond-target {
    position: absolute;
    z-index: 2;
    display: grid;
    width: 92px;
    height: 92px;
    place-items: center;
    border: 3px solid var(--lcmg-blue);
    border-radius: 50%;
    background: #fff;
    color: var(--lcmg-navy);
    font-size: 1.65rem;
    font-weight: 850;
}

.lcmg-bond-whole {
    top: 0;
    left: calc(50% - 46px);
}

.lcmg-bond-part1 {
    bottom: 0;
    left: calc(28% - 46px);
}

.lcmg-bond-part2 {
    right: calc(28% - 46px);
    bottom: 0;
}

.lcmg-bond-line {
    position: absolute;
    top: 88px;
    width: 4px;
    height: 105px;
    background: #8097a7;
    transform-origin: top;
}

.lcmg-bond-line--left {
    left: 49%;
    transform: rotate(40deg);
}

.lcmg-bond-line--right {
    right: 49%;
    transform: rotate(-40deg);
}

.lcmg-single-target {
    border-style: dashed;
    cursor: pointer;
}

.lcmg-single-target.is-filled {
    border-style: solid;
    background: var(--lcmg-sky);
}

.lcmg-single-target.is-over {
    outline: 4px solid var(--lcmg-yellow);
}

.lcmg-array-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.lcmg-array-label {
    display: grid;
    gap: .35rem;
    color: var(--lcmg-navy);
    font-weight: 800;
}

.lcmg-array-label input {
    width: 100px;
    min-height: 48px;
    border: 2px solid #9bb9ca;
    border-radius: 9px;
    text-align: center;
    font-size: 1.2rem;
}

.lcmg-dot-array {
    display: grid;
    grid-template-columns: repeat(var(--lcmg-array-columns), 24px);
    gap: 10px;
    justify-content: center;
    min-height: 80px;
    margin-top: 1.25rem;
    padding: 1rem;
    overflow-x: auto;
    border-radius: 12px;
    background: #f4f8fb;
}

.lcmg-array-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--lcmg-blue);
    box-shadow: inset 0 0 0 4px #bde5fa;
}

.lcmg-fraction-compare {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.lcmg-fraction-card {
    display: grid;
    gap: 1rem;
    justify-items: center;
    padding: 1rem;
    border-radius: 14px;
    background: #f4f8fb;
}

.lcmg-fraction-number {
    display: grid;
    min-width: 54px;
    gap: .2rem;
    color: var(--lcmg-navy);
    font-size: 1.4rem;
    font-weight: 850;
    text-align: center;
}

.lcmg-fraction-rule {
    height: 3px;
    background: currentColor;
}

.lcmg-fraction-bar {
    display: grid;
    grid-template-columns: repeat(var(--lcmg-fraction-parts), minmax(12px, 1fr));
    width: min(100%, 240px);
    min-height: 54px;
    border: 2px solid var(--lcmg-navy);
}

.lcmg-fraction-part {
    border-right: 1px solid var(--lcmg-navy);
    background: #fff;
}

.lcmg-fraction-part:last-child {
    border-right: 0;
}

.lcmg-fraction-part.is-filled {
    background: var(--lcmg-yellow);
}

.lcmg-comparison-choices {
    display: grid;
    gap: .5rem;
}

.lcmg-comparison-button {
    width: 50px;
    height: 50px;
    border: 2px solid var(--lcmg-blue);
    border-radius: 50%;
    background: #fff;
    color: var(--lcmg-blue);
    font-size: 1.5rem;
    font-weight: 850;
}

.lcmg-comparison-button.is-selected {
    background: var(--lcmg-blue);
    color: #fff;
}

.lcmg-equation {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--lcmg-navy);
    font-size: clamp(1.45rem, 5vw, 2.4rem);
    font-weight: 850;
}

.lcmg-expression {
    display: inline-flex;
    gap: .45rem;
    align-items: center;
}

.lcmg-equation-target {
    min-width: 74px;
    min-height: 62px;
    border: 3px dashed #8da7b8;
    border-radius: 12px;
    background: #fff;
    color: var(--lcmg-navy);
    font: inherit;
}

.lcmg-feedback {
    min-height: 1.7rem;
    margin-top: 1.2rem;
    font-weight: 750;
}

.lcmg-feedback.is-correct {
    color: var(--lcmg-green);
}

.lcmg-feedback.is-incorrect {
    color: var(--lcmg-red);
}

.lcmg-feedback.is-hint {
    color: #7a5200;
}

.lcmg-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.lcmg-button {
    min-height: 48px;
    padding: .7rem 1.25rem;
    border: 2px solid transparent;
    border-radius: 999px;
    font: 750 1rem/1 inherit;
    cursor: pointer;
}

.lcmg-button--primary {
    background: var(--lcmg-blue);
    color: #fff;
}

.lcmg-button--primary:hover {
    background: var(--lcmg-navy);
}

.lcmg-player button:focus-visible,
.lcmg-player input:focus-visible {
    outline: 4px solid #f0a500;
    outline-offset: 3px;
}

.lcmg-player button:disabled,
.lcmg-player input:disabled {
    cursor: not-allowed;
    opacity: .75;
}

.lcmg-results {
    padding: 2rem 1rem;
    text-align: center;
}

.lcmg-results__title {
    margin: 0;
    color: var(--lcmg-navy);
    font-size: 1.8rem;
}

.lcmg-results__score {
    margin: .6rem 0 1.5rem;
    color: var(--lcmg-blue);
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 850;
}

.lcmg-notice {
    padding: .8rem 1rem;
    border-left: 4px solid #dba617;
    background: #fff8e5;
}

.lcmg-player .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 520px) {
    .lcmg-player {
        border-radius: 14px;
    }

    .lcmg-target-label {
        font-size: .83rem;
    }

    .lcmg-tile {
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 720px) {
    .lcmg-number-grid-layout {
        grid-template-columns: 1fr;
    }

    .lcmg-grid-tile-tray {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .lcmg-grid-tile {
        min-width: 62px;
    }

    .lcmg-fraction-compare {
        grid-template-columns: 1fr;
    }

    .lcmg-comparison-choices {
        grid-template-columns: repeat(3, auto);
        justify-content: center;
    }

    .lcmg-base-ten-controls {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lcmg-progress__bar {
        transition: none;
    }
}
