.addition-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%);
}

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

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

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

.addition-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;
}

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

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

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

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

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

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

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

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

.question-grid {
    display: grid;
    gap: 1rem;
}

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

.addition-card {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border: 3px solid #23355b;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    min-width: 0;
}

.addition-problem {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.math-digit,
.math-symbol,
.math-answer-box {
    font-family: "Trebuchet MS", "Comic Sans MS", Arial, sans-serif;
    font-weight: 900;
    line-height: 1;
}

.math-digit {
    font-size: clamp(3rem, 5vw, 4.6rem);
    color: #ffffff;
    -webkit-text-stroke: 5px #b6b6b6;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.16);
}

.math-digit[data-tone="red"] {
    -webkit-text-stroke-color: #de3b42;
}

.math-digit[data-tone="green"] {
    -webkit-text-stroke-color: #38bf4b;
}

.math-digit[data-tone="yellow"] {
    -webkit-text-stroke-color: #f2d32f;
}

.math-symbol {
    font-size: clamp(2.8rem, 5vw, 4.2rem);
    color: #ffffff;
    -webkit-text-stroke: 5px #8f9aa8;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.16);
}

.math-answer-box {
    width: clamp(72px, 8vw, 92px);
    height: clamp(62px, 7vw, 82px);
    border-radius: 20px;
    border: 4px dashed #9fb1c6;
    background: rgba(255, 255, 255, 0.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5a6f8d;
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.cube-playfield {
    position: relative;
    min-height: 170px;
    padding: 0.75rem;
    border-radius: 22px;
    border: 3px solid rgba(35, 53, 91, 0.12);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    overflow: hidden;
}

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

.cube {
    position: absolute;
    width: 46px;
    height: 46px;
    transform-style: preserve-3d;
    cursor: grab;
    touch-action: none;
}

.cube.is-dragging {
    cursor: grabbing;
}

.cube-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 2px solid rgba(35, 53, 91, 0.2);
    font-family: "Trebuchet MS", "Comic Sans MS", Arial, sans-serif;
    font-weight: 900;
    font-size: 1.2rem;
    color: #ffffff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.cube-face.front {
    transform: translateZ(10px);
}

.cube-face.top {
    transform: rotateX(90deg) translateZ(10px);
    transform-origin: center top;
}

.cube-face.side {
    transform: rotateY(90deg) translateZ(10px);
    transform-origin: right center;
}

.cube[data-color="red"] .cube-face.front {
    background: linear-gradient(135deg, #ff8a8a 0%, #e43f4a 100%);
}

.cube[data-color="red"] .cube-face.top {
    background: linear-gradient(135deg, #ffc1c1 0%, #f06a72 100%);
}

.cube[data-color="red"] .cube-face.side {
    background: linear-gradient(135deg, #d12e37 0%, #b5212a 100%);
}

.cube[data-color="blue"] .cube-face.front {
    background: linear-gradient(135deg, #96d8ff 0%, #3f8de4 100%);
}

.cube[data-color="blue"] .cube-face.top {
    background: linear-gradient(135deg, #cfeeff 0%, #79b8ff 100%);
}

.cube[data-color="blue"] .cube-face.side {
    background: linear-gradient(135deg, #2f74c0 0%, #2058a0 100%);
}

.cube[data-color="green"] .cube-face.front {
    background: linear-gradient(135deg, #acef9b 0%, #4dbb59 100%);
}

.cube[data-color="green"] .cube-face.top {
    background: linear-gradient(135deg, #d7f8cf 0%, #87d97e 100%);
}

.cube[data-color="green"] .cube-face.side {
    background: linear-gradient(135deg, #2d9440 0%, #1d7830 100%);
}

.cube[data-color="yellow"] .cube-face.front {
    background: linear-gradient(135deg, #ffe89a 0%, #f0c233 100%);
}

.cube[data-color="yellow"] .cube-face.top {
    background: linear-gradient(135deg, #fff4c8 0%, #ffd96c 100%);
}

.cube[data-color="yellow"] .cube-face.side {
    background: linear-gradient(135deg, #d1a41d 0%, #b88610 100%);
}

.answer-row {
    display: flex;
    gap: 0.65rem;
    align-items: stretch;
}

.answer-input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 54px;
    border-radius: 18px;
    border: 3px solid #9fb1c6;
    background: #fff;
    padding: 0.7rem 0.95rem;
    font-family: "Trebuchet MS", "Comic Sans MS", Arial, sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    color: #17325e;
}

.answer-input.is-right {
    border-color: #1e7b42;
    background: #ecfff3;
}

.answer-input.is-wrong {
    border-color: #a11f1f;
    background: #fff1f1;
}

.check-button {
    min-width: 112px;
    border: 3px solid #23355b;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fff7d8 100%);
    color: #17325e;
    font-family: "Trebuchet MS", "Comic Sans MS", Arial, sans-serif;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
}

.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: 1100px) {
    .addition-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

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

    .answer-row {
        flex-direction: column;
    }

    .check-button {
        min-height: 52px;
    }
}
