:root {
    --sun: #FFD93D;
    --coral: #FF6B6B;
    --mint: #6BCB77;
    --sky: #4D96FF;
    --lav: #C77DFF;
    --peach: #FFB347;
    --cream: #FFFBF0;
    --dark: #2D2D2D;
    --sh: 4px 4px 0 rgba(0, 0, 0, 0.13);
    --sh-lg: 6px 6px 0 rgba(0, 0, 0, 0.13);
    --r: 20px;
    --rsm: 12px;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: var(--cream);
    min-height: 100vh;
    overflow-x: hidden;
}

.nav {
    background: #fff;
    border-bottom: 3px solid var(--dark);
    padding: 7px 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .07);
}

.nav-logo {
    font-family: 'Fredoka One', cursive;
    color: var(--coral);
    font-size: 1.05rem;
    margin-right: 3px;
    flex-shrink: 0;
}

.nb {
    background: var(--cream);
    border: 2px solid #ddd;
    border-radius: 30px;
    padding: 3px 11px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.73rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--dark);
    transition: all .15s;
    white-space: nowrap;
    text-decoration: none;
}

.nb:hover,
.nb.on {
    background: var(--sky);
    color: #fff;
    border-color: var(--sky);
}

.screen {
    display: none;
    padding: 20px 14px 60px;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.screen.on {
    display: block;
}

.math-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.msym {
    position: absolute;
    font-family: 'Fredoka One', cursive;
    opacity: .07;
    color: var(--dark);
    animation: floatsym linear infinite;
    user-select: none;
    line-height: 1;
}

@keyframes floatsym {
    0% {
        transform: translateY(110vh) rotate(0deg);
    }

    100% {
        transform: translateY(-20vh) rotate(360deg);
    }
}

.card {
    background: #fff;
    border: 3px solid var(--dark);
    border-radius: var(--r);
    padding: 22px;
    box-shadow: var(--sh-lg);
    margin-bottom: 14px;
}

.logo {
    font-family: 'Fredoka One', cursive;
    font-size: 2.8rem;
    color: var(--coral);
    text-shadow: 3px 3px 0 var(--sun);
}

h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 8px;
}

h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.45rem;
    color: var(--dark);
    margin-bottom: 10px;
}

h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 7px;
}

p {
    color: #555;
    line-height: 1.6;
    font-size: .92rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 11px 22px;
    border-radius: 50px;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: .92rem;
    border: 3px solid var(--dark);
    cursor: pointer;
    transition: all .15s;
    box-shadow: var(--sh);
    text-decoration: none;
    color: var(--dark);
    background: #fff;
}

.btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, .15);
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 rgba(0, 0, 0, .1);
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

.btn-red {
    background: var(--coral);
    color: #fff;
}

.btn-sky {
    background: var(--sky);
    color: #fff;
}

.btn-mint {
    background: var(--mint);
    color: #fff;
}

.btn-sun {
    background: var(--sun);
    color: var(--dark);
}

.btn-lav {
    background: var(--lav);
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: .8rem;
}

.btn-lg {
    padding: 15px 32px;
    font-size: 1.05rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.field {
    margin-bottom: 13px;
}

.field label {
    display: block;
    font-weight: 800;
    font-size: .86rem;
    color: var(--dark);
    margin-bottom: 5px;
}

.field input {
    width: 100%;
    padding: 10px 13px;
    border: 3px solid var(--dark);
    border-radius: var(--rsm);
    font-family: 'Nunito', sans-serif;
    font-size: .93rem;
    background: var(--cream);
    outline: none;
    transition: border-color .15s;
}

.field input:focus {
    border-color: var(--sky);
}

.chk {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 13px;
}

.chk input {
    width: 19px;
    height: 19px;
    margin-top: 2px;
    accent-color: var(--coral);
    flex-shrink: 0;
}

.chk label {
    font-size: .84rem;
    color: #555;
    line-height: 1.5;
}

hr {
    border: none;
    border-top: 2px dashed #E0D8CC;
    margin: 16px 0;
}

.tile {
    background: var(--sun);
    border: 3px solid var(--dark);
    border-radius: 14px;
    width: 66px;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka One', cursive;
    font-size: 1.55rem;
    cursor: pointer;
    transition: all .15s;
    box-shadow: var(--sh);
    user-select: none;
    flex-shrink: 0;
}

.tile:hover {
    transform: translate(-2px, -3px) rotate(-3deg);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, .18);
    background: var(--peach);
}

.tile.used {
    background: #E8E8E8;
    color: #bbb;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.tiles {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.op {
    background: #fff;
    border: 3px solid var(--dark);
    border-radius: var(--rsm);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka One', cursive;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--sh);
    transition: all .15s;
    user-select: none;
}

.op:hover {
    background: var(--lav);
    color: #fff;
    border-color: var(--lav);
    transform: translate(-2px, -2px);
}

.op-exp {
    font-size: .88rem;
    width: auto;
    padding: 0 12px;
    border-color: var(--lav);
    color: var(--lav);
    font-weight: 900;
}

.op-exp:hover {
    background: var(--lav);
    color: #fff;
}

.ops {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.eq-bar {
    background: var(--cream);
    border: 3px solid var(--dark);
    border-radius: var(--rsm);
    padding: 12px 15px;
    min-height: 54px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin: 10px 0;
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    color: var(--dark);
}

.cur {
    display: inline-block;
    width: 3px;
    height: 1.2rem;
    background: var(--coral);
    animation: blink 1s step-end infinite;
    margin-left: 2px;
    vertical-align: middle;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0
    }
}

.eq-pre {
    font-size: .85rem;
    color: #999;
    font-weight: 700;
    margin-top: 2px;
    min-height: 18px;
}

.mini-inp {
    width: 62px;
    padding: 7px 4px;
    border: 3px solid var(--dark);
    border-radius: 10px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.15rem;
    text-align: center;
    background: #fff;
    outline: none;
    -moz-appearance: textfield;
}

.mini-inp::-webkit-outer-spin-button,
.mini-inp::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mini-inp:focus {
    border-color: var(--sky);
}

.mini-inp.err {
    border-color: var(--coral);
}

.res-card {
    border-radius: var(--r);
    padding: 26px;
    border: 3px solid var(--dark);
    text-align: center;
    box-shadow: var(--sh-lg);
    margin-bottom: 14px;
}

.res-ok {
    background: linear-gradient(135deg, #6BCB77, #4DB860);
}

.res-no {
    background: linear-gradient(135deg, #FFD93D, #FFC020);
}

.res-icon {
    font-size: 3.2rem;
    display: block;
    margin-bottom: 10px;
    animation: pop .4s cubic-bezier(.175, .885, .32, 1.275);
}

@keyframes pop {
    0% {
        transform: scale(0)
    }

    100% {
        transform: scale(1)
    }
}

.res-eq {
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, .25);
    border-radius: 10px;
    padding: 8px 13px;
    margin: 9px auto;
    display: inline-block;
    max-width: 100%;
    word-break: break-all;
}

.hist-row {
    background: #fff;
    border: 2.5px solid #EBE3D5;
    border-radius: var(--rsm);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 9px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .74rem;
    font-weight: 800;
    border: 2px solid var(--dark);
}

.badge-mint {
    background: var(--mint);
    color: #fff;
}

.par-hdr {
    background: var(--lav);
    border: 3px solid var(--dark);
    border-radius: var(--r);
    padding: 17px 20px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 13px;
    box-shadow: var(--sh);
}

.par-av {
    font-size: 2.2rem;
    background: #fff;
    border: 3px solid var(--dark);
    border-radius: 50%;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mail-wrap {
    background: #fff;
    border: 3px solid var(--dark);
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--sh-lg);
}

.mail-head {
    background: var(--coral);
    padding: 13px 18px;
}

.mail-head .subj {
    font-weight: 800;
    font-size: .9rem;
    color: #fff;
}

.mail-head .from {
    font-size: .76rem;
    color: rgba(255, 255, 255, .85);
    margin-top: 2px;
}

.mail-body {
    padding: 20px;
}

.steps {
    display: flex;
    margin-bottom: 22px;
}

.step {
    flex: 1;
    text-align: center;
    font-size: .76rem;
    font-weight: 800;
    color: #ccc;
}

.step.on {
    color: var(--coral);
}

.step.done {
    color: var(--mint);
}

.step-n {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka One', cursive;
    font-size: .95rem;
    margin: 0 auto 3px;
}

.step.done .step-n {
    background: var(--mint);
    color: #fff;
    border-color: var(--mint);
}

.step.on .step-n {
    background: var(--coral);
    color: #fff;
    border-color: var(--coral);
}

.age-opt {
    background: #fff;
    border: 3px solid var(--dark);
    border-radius: var(--r);
    padding: 17px 20px;
    cursor: pointer;
    transition: all .15s;
    box-shadow: var(--sh);
    display: flex;
    align-items: center;
    gap: 13px;
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 13px;
}

.age-opt:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, .13);
}

.age-opt.y:hover {
    background: #EEF6FF;
    border-color: var(--sky);
}

.age-opt.o:hover {
    background: #EEFAF0;
    border-color: var(--mint);
}

.tip {
    background: var(--cream);
    border: 2px solid var(--sun);
    border-radius: var(--rsm);
    padding: 13px;
    margin: 12px 0;
}

.tip li {
    list-style: none;
    padding: 3px 0 3px 20px;
    position: relative;
    font-weight: 700;
    font-size: .86rem;
}

.tip li::before {
    content: '✨';
    position: absolute;
    left: 0;
}

.school-tag {
    background: var(--sky);
    color: #fff;
    border: 3px solid var(--dark);
    border-radius: var(--rsm);
    padding: 4px 13px;
    font-weight: 800;
    font-size: .85rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: var(--sh);
}

.info-box {
    background: #EEF6FF;
    border: 2px solid var(--sky);
    border-radius: var(--rsm);
    padding: 11px 13px;
    font-size: .84rem;
    font-weight: 600;
    color: #333;
    margin-top: 13px;
}

.fp {
    background: #fff;
    border: 2px solid var(--dark);
    border-radius: 30px;
    padding: 5px 13px;
    font-size: .8rem;
    font-weight: 700;
}

.acct-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 0;
    border-bottom: 2px dashed #EBE3D5;
}

.acct-row:last-child {
    border-bottom: none;
}

.c-wrap {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 998;
}

.cp {
    position: absolute;
    border-radius: 2px;
    animation: fall 2.5s ease-in forwards;
}

@keyframes fall {
    0% {
        opacity: 1;
        transform: translateY(-20px) rotate(0)
    }

    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg)
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-11px)
    }
}

@keyframes pulse-solved {
    0% {
        transform: scale(1)
    }

    40% {
        transform: scale(1.3)
    }

    100% {
        transform: scale(1)
    }
}

@keyframes shake {
    0% {
        transform: translate(0, 0) rotate(0deg)
    }

    15% {
        transform: translate(-4px, 0) rotate(-4deg)
    }

    30% {
        transform: translate(4px, 0) rotate(4deg)
    }

    45% {
        transform: translate(-3px, 0) rotate(-2deg)
    }

    60% {
        transform: translate(3px, 0) rotate(2deg)
    }

    75% {
        transform: translate(-1px, 0) rotate(-1deg)
    }

    100% {
        transform: translate(0, 0) rotate(0deg)
    }
}

.shake {
    animation: shake 0.35s ease !important;
}

.game-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
}

.board-col {
    background: #fff;
    border: 3px solid var(--dark);
    border-radius: var(--r);
    padding: 16px;
    box-shadow: var(--sh-lg);
}

.builder-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tgt-grid-2col {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
}

.tgt-cell {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 3px solid var(--dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka One', cursive;
    font-size: .95rem;
    transition: transform .12s cubic-bezier(.175, .885, .32, 1.275), box-shadow .12s, background .12s;
    box-shadow: var(--sh);
    background: #fff;
    user-select: none;
    cursor: default;
}

.tgt-cell:not(.solved):not(.active):hover {
    transform: scale(1.22) rotate(-4deg);
    box-shadow: 0 0 0 4px rgba(255, 211, 61, .6), 4px 4px 0 var(--dark);
    background: var(--sun);
    z-index: 2;
}


.tgt-cell.solved {
    background: var(--mint);
    color: #fff;
    border-color: var(--mint);
}

.tgt-cell.active {
    background: var(--sky);
    color: #fff;
    border-color: var(--sky);
    transform: scale(1.15);
    box-shadow: 0 0 0 5px rgba(77, 150, 255, .4), 4px 4px 0 var(--dark);
}

.tgt-cell .ck {
    font-size: .52rem;
    margin-top: 1px;
    line-height: 1;
}

/* PAYWALL */
.pw-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.pw-overlay.show {
    display: flex;
}

@keyframes popIn {
    from {
        transform: scale(.85);
        opacity: 0
    }

    to {
        transform: scale(1);
        opacity: 1
    }
}

@media(max-width:620px) {
    .game-split {
        grid-template-columns: 1fr;
    }

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

    .tile {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }

    .op {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .logo {
        font-size: 2.2rem;
    }

    .mini-inp {
        width: 54px;
        font-size: 1rem;
    }
}

@keyframes celebPop {
    0% {
        transform: scale(0) rotate(-5deg);
        opacity: 0
    }

    70% {
        transform: scale(1.06) rotate(1deg)
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1
    }
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1
    }

    100% {
        transform: translateY(-320px) rotate(var(--rot)) scale(0.6);
        opacity: 0
    }
}

@keyframes trophyBounce {

    0%,
    100% {
        transform: scale(1) rotate(0deg)
    }

    25% {
        transform: scale(1.3) rotate(-8deg)
    }

    75% {
        transform: scale(1.2) rotate(8deg)
    }
}

#celeb-trophy {
    animation: trophyBounce 0.8s ease-in-out infinite;
}