/* ============================================================
   NATTERPOP
   A NATTERFLY ORIGINAL
============================================================ */

.natterpop-wrapper {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 18px;
    color: #ffffff;
    text-align: center;
}

.natterpop-intro {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
    padding: 13px 15px;
    border: 1px solid #35515c;
    border-radius: 4px;
    background: #10242c;
    text-align: left;
}

.natterpop-intro.is-hidden {
    display: none;
}

.natterpop-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 82px;
    height: 82px;
    border: 1px solid #35515c;
    border-radius: 50%;
    background: #07171d;
}

.natterpop-logo-wrap img {
    display: block;
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.natterpop-original {
    display: block;
    margin-bottom: 3px;
    color: #77c8e8;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.natterpop-intro-copy h2 {
    margin: 0 0 5px;
    color: #ffffff;
    font-size: 24px;
}

.natterpop-intro-copy p {
    margin: 0;
    color: #b5c8cf;
    font-size: 11px;
    line-height: 1.55;
}

.natterpop-topbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 8px;
}

.natterpop-stat {
    padding: 8px 7px;
    border: 1px solid #35515c;
    border-radius: 4px;
    background: #10242c;
}

.natterpop-stat span {
    display: block;
    margin-bottom: 2px;
    color: #9fb5be;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.natterpop-stat strong {
    display: block;
    color: #ffffff;
    font-size: 16px;
}

.natterpop-objective {
    min-height: 28px;
    margin-bottom: 8px;
    padding: 6px 8px;
    border: 1px solid #2f4b57;
    border-radius: 4px;
    background: #0d2028;
    color: #c3d5dc;
    font-size: 10px;
    font-weight: 700;
}

.natterpop-board {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
    max-width: 594px;
    margin: 0 auto;
    padding: 9px;
    border: 1px solid #35515c;
    border-radius: 7px;
    background:
        radial-gradient(circle at 50% 10%, rgb(45 96 113 / 35%), transparent 55%),
        #07171d;
    box-shadow: inset 0 0 24px rgb(0 0 0 / 22%);
}

.natterpop-tile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    min-width: 0;
    padding: 5px;
    border: 1px solid #55727c;
    border-radius: 11px;
    background: linear-gradient(180deg, #f9fcfd, #d9e6ea);
    box-shadow:
        inset 0 1px 0 rgb(255 255 255 / 80%),
        0 2px 4px rgb(0 0 0 / 24%);
    color: #17343f;
    cursor: pointer;
    transition:
        transform .11s ease,
        box-shadow .11s ease,
        border-color .11s ease;
}

.natterpop-tile:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: #79a0af;
}

.natterpop-tile.is-selected {
    transform: none;
    border-color: #76c9ea;
    box-shadow:
        inset 0 0 0 2px rgb(118 201 234 / 55%);
}

.natterpop-tile.is-line {
    border-color: #76c9ea;
    box-shadow:
        inset 0 0 0 2px rgb(118 201 234 / 45%),
        0 0 8px rgb(118 201 234 / 32%);
}

.natterpop-tile.is-bomb {
    border-color: #df8fdb;
    box-shadow:
        inset 0 0 0 2px rgb(223 143 219 / 48%),
        0 0 9px rgb(223 143 219 / 38%);
}

.natterpop-tile.is-wild {
    border-color: #f4c84f;
    background:
        radial-gradient(circle, #ffffff 0%, #e5f6fb 52%, #bddbe5 100%);
    box-shadow:
        inset 0 0 0 2px rgb(117 201 233 / 48%),
        0 0 12px rgb(244 200 79 / 52%);
}

.natterpop-tile img {
    display: block;
    max-width: 78%;
    max-height: 78%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.natterpop-fallback {
    font-size: clamp(22px, 4vw, 37px);
    line-height: 1;
    pointer-events: none;
}

.natterpop-special-mark {
    position: absolute;
    right: 3px;
    bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0d2a35;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    pointer-events: none;
}

.natterpop-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    color: #9fb5be;
    font-size: 8px;
}

.natterpop-legend span {
    padding: 3px 6px;
    border: 1px solid #35515c;
    border-radius: 3px;
    background: #10242c;
}

.natterpop-legend b {
    color: #ffffff;
}

.natterpop-status {
    min-height: 22px;
    margin-top: 9px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
}

.natterpop-start {
    display: block;
    margin: 8px auto 0;
}

.natterpop-wrapper.is-game-over .natterpop-intro {
    display: grid;
}

@media (max-width: 620px) {
    .natterpop-wrapper {
        padding: 9px;
    }

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

    .natterpop-board {
        gap: 3px;
        padding: 5px;
    }

    .natterpop-tile {
        padding: 2px;
        border-radius: 7px;
    }

    .natterpop-special-mark {
        width: 14px;
        height: 14px;
        font-size: 8px;
    }
}

@media (max-width: 430px) {
    .natterpop-intro {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .natterpop-logo-wrap {
        width: 58px;
        height: 58px;
    }

    .natterpop-logo-wrap img {
        width: 42px;
        height: 42px;
    }

    .natterpop-intro-copy h2 {
        font-size: 19px;
    }

    .natterpop-intro-copy p {
        font-size: 9px;
    }

    .natterpop-board {
        gap: 2px;
        padding: 4px;
    }

    .natterpop-tile {
        border-radius: 5px;
    }
}


/* ============================================================
   NATTERPOP MOTION / FEEDBACK
============================================================ */

.natterpop-wrapper {
    position: relative;
}

.natterpop-tile.is-popping {
    z-index: 4;
    pointer-events: none;
    animation: natterpopPop .52s cubic-bezier(.2,.8,.2,1) forwards;
}

@keyframes natterpopPop {
    0%   { transform: scale(1) rotate(0deg); opacity: 1; }
    18%  { transform: scale(1.16) rotate(0deg); opacity: 1; }
    36%  { transform: scale(.88) rotate(0deg); opacity: 1; }
    55%  { transform: scale(1.12) rotate(-2deg); opacity: 1; }
    64%  { transform: scale(1.08) rotate(3deg); opacity: 1; }
    73%  { transform: scale(1.1) rotate(-3deg); opacity: 1; }
    82%  { transform: scale(1.06) rotate(2deg); opacity: 1; }
    100% { transform: scale(.12) rotate(0deg); opacity: 0; }
}

.natterpop-tile.is-dropping {
    animation: natterpopDrop .40s cubic-bezier(.18,.78,.24,1.08) both;
}

@keyframes natterpopDrop {
    from {
        transform: translateY(calc(-1 * var(--drop-rows) * (100% + 5px)));
    }
    82% {
        transform: translateY(3px);
    }
    to {
        transform: translateY(0);
    }
}

.natterpop-praise {
    position: absolute;
    z-index: 20;
    left: 50%;
    top: 56%;
    max-width: 90%;
    padding: 8px 16px;
    border: 1px solid rgb(255 255 255 / 40%);
    border-radius: 16px;
    background: rgb(7 23 29 / 88%);
    color: #ffffff;
    box-shadow: 0 7px 24px rgb(0 0 0 / 34%);
    font-size: clamp(18px, 5vw, 34px);
    font-weight: 900;
    letter-spacing: .025em;
    line-height: 1.05;
    text-align: center;
    text-shadow: 0 2px 0 rgb(0 0 0 / 25%);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(.65) rotate(-2deg);
}

.natterpop-praise.is-showing {
    animation: natterpopPraise 1.8s cubic-bezier(.18,.75,.25,1) both;
}

@keyframes natterpopPraise {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(.55) rotate(-4deg); }
    20%  { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(2deg); }
    38%  { opacity: 1; transform: translate(-50%, -50%) scale(.98) rotate(0); }
    72%  { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
    100% { opacity: 0; transform: translate(-50%, -63%) scale(.9) rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
    .natterpop-tile.is-popping,
    .natterpop-tile.is-dropping,
    .natterpop-praise.is-showing {
        animation-duration: .01ms !important;
    }
}

/* ============================================================
   NATTERPOP MUSIC TOGGLE
============================================================ */

.natterpop-music-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    margin: 0 0 10px auto;
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 4px;
    background: rgba(0, 0, 0, .18);
    color: inherit;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.natterpop-music-toggle:hover {
    background: rgba(0, 0, 0, .28);
}

.natterpop-music-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .natterpop-music-toggle {
        min-height: 44px;
    }
}