
/* =========================================
   BATLINGO - MASCOT SELECTION
   Compatible with mascot.js / index.html
========================================= */

.mascot-screen {
    --mascot-gold: #ffbd59;
    --mascot-blue: #78c5ff;

    position: fixed;
    inset: 0;
    z-index: 20000;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 100dvh;
    padding: 24px 16px;

    overflow-y: auto;

    background:
        radial-gradient(
            circle at 50% 15%,
            #294a75 0%,
            transparent 60%
        ),
        linear-gradient(145deg, #101827, #16253e);

    color: #fff;
    font-family: inherit;
}

.mascot-screen.hidden,
.mascot-screen .hidden {
    display: none !important;
}

.mascot-container {
    width: 100%;
    max-width: 700px;
    margin: auto;
    text-align: center;
}

/* =========================================
   HEADER
========================================= */

.mascot-header {
    margin-bottom: 26px;
}

.mascot-subtitle {
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--mascot-gold);
}

.mascot-header h1 {
    margin: 12px 0;
    font-size: clamp(24px, 5vw, 36px);
    line-height: 1.25;
    font-weight: 900;
}

.mascot-header p {
    font-size: 14px;
    color: #b4c3d9;
    line-height: 1.6;
}

/* =========================================
   CHARACTER SELECTION
========================================= */

.mascot-selection {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 22px;
}

.mascot-card {
    --accent: var(--mascot-gold);

    position: relative;
    min-width: 0;

    padding: 18px 12px;
    border-radius: 20px;
    border: 2px solid #354b69;

    background: #192b45;
    color: #fff;

    cursor: pointer;

    opacity: .7;
    filter: brightness(.8);

    transition:
        transform .25s ease,
        opacity .25s ease,
        filter .25s ease,
        border-color .25s ease,
        box-shadow .25s ease;
}

.mascot-card.buffalo {
    --accent: var(--mascot-blue);
}

.mascot-card:hover {
    opacity: 1;
    filter: brightness(1);
    transform: translateY(-4px);
}

.mascot-card.selected {
    opacity: 1;
    filter: brightness(1.08);
    transform: translateY(-7px);

    border-color: var(--accent);

    box-shadow:
        0 0 26px color-mix(
            in srgb,
            var(--accent) 32%,
            transparent
        ),
        inset 0 0 18px color-mix(
            in srgb,
            var(--accent) 8%,
            transparent
        );
}

.mascot-card:focus-visible,
.mascot-ok-btn:focus-visible,
.mascot-confirm-buttons button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* =========================================
   SELECTED ICON
========================================= */

.mascot-selected-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;

    display: none;
    place-items: center;

    width: 28px;
    height: 28px;

    border-radius: 50%;
    background: var(--accent);
    color: #142136;

    font-weight: 900;
}

.mascot-card.selected .mascot-selected-icon {
    display: grid;
}

/* =========================================
   MASCOT IMAGE
========================================= */

.mascot-image-wrapper {
    width: 100%;
    height: clamp(150px, 27vw, 230px);

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 14px;
    transform-origin: center bottom;
}

.mascot-image {
    display: block;
    width: 100%;
    height: 100%;

    object-fit: contain;

    filter: drop-shadow(0 8px 12px #0006);
}

.mascot-image[hidden],
.mascot-fallback[hidden] {
    display: none !important;
}

.mascot-fallback {
    font-size: clamp(85px, 16vw, 140px);
    line-height: 1;

    filter: drop-shadow(0 8px 9px #0005);
}

.mascot-card-name {
    display: block;

    font-size: clamp(17px, 3vw, 24px);
    font-weight: 900;
    letter-spacing: 1px;
}

.mascot-card-type {
    display: block;
    margin-top: 7px;

    font-size: 12px;
    color: #b7c7dc;
}

/* =========================================
   SELECTION ANIMATION
========================================= */

.mascot-card.mascot-pop .mascot-image-wrapper {
    animation: monkeySelect .6s ease-out both;
}

.mascot-card.buffalo.mascot-pop .mascot-image-wrapper {
    animation-name: buffaloSelect;
}

@keyframes monkeySelect {
    0% {
        transform: translateY(8px) scale(.88);
    }

    45% {
        transform:
            translateY(-16px)
            scale(1.13)
            rotate(-4deg);
    }

    75% {
        transform:
            translateY(3px)
            scale(1.03)
            rotate(2deg);
    }

    100% {
        transform:
            translateY(0)
            scale(1.06)
            rotate(0);
    }
}

@keyframes buffaloSelect {
    0% {
        transform: translateY(0) scale(.94);
    }

    40% {
        transform: translateY(-9px) scale(1.1);
    }

    70% {
        transform: translateY(5px) scale(1.04);
    }

    100% {
        transform: translateY(0) scale(1.06);
    }
}

/* Selected Mascot idle movement */

.mascot-card.selected:not(.mascot-pop)
.mascot-image-wrapper {
    animation: mascotIdle 3s ease-in-out infinite;
}

@keyframes mascotIdle {
    0%, 100% {
        transform: translateY(0) scale(1.06);
    }

    50% {
        transform: translateY(-6px) scale(1.06);
    }
}

/* =========================================
   MASCOT DETAILS
========================================= */

.mascot-details {
    margin-bottom: 22px;
    padding: 20px;

    background: #1b2d47;
    border: 1px solid #425b7a;
    border-radius: 18px;

    text-align: center;
}

.mascot-details.show {
    animation: mascotDetailsReveal .35s ease-out both;
}

@keyframes mascotDetailsReveal {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mascot-details-title {
    display: block;
    color: #ffca76;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
}

.mascot-details h2 {
    margin: 9px 0;
    font-size: 22px;
    font-weight: 900;
}

.mascot-details .mascot-description {
    margin: 0 auto;
    max-width: 530px;

    font-size: 13px;
    line-height: 1.7;
    color: #c1d0e3;
}

/* =========================================
   TRAITS
========================================= */

.mascot-traits {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;

    gap: 8px;
    margin-top: 16px;
}

.mascot-trait {
    padding: 7px 12px;

    border: 1px solid #506b8e;
    border-radius: 30px;

    background: #293d5a;
    color: #ecf3ff;

    font-size: 12px;
}

/* =========================================
   DEFAULT SKILL
========================================= */

.mascot-skill-box {
    margin-top: 20px;
    padding: 16px;

    border: 1px solid #54749a;
    border-radius: 13px;

    background: #253b59;
}

.mascot-skill-label {
    color: #ffcc7d;

    font-size: 10px;
    font-weight: 900;
    letter-spacing: 2px;
}

#mascotSkillName {
    margin: 10px 0 8px;

    font-size: 17px;
    font-weight: 900;
}

#mascotSkillDescription {
    margin: 0;

    font-size: 13px;
    line-height: 1.7;
    color: #d0deee;
}

.mascot-skill-note {
    display: block;
    margin-top: 11px;

    font-size: 11px;
    color: #a5b6ce;
}

/* =========================================
   BUTTONS
========================================= */

.mascot-ok-btn {
    width: min(100%, 330px);

    padding: 15px 20px;

    border: none;
    border-radius: 12px;

    background: linear-gradient(
        135deg,
        #ffca68,
        #ff963c
    );

    color: #172033;
    font-size: 16px;
    font-weight: 900;

    cursor: pointer;

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.mascot-ok-btn:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 25px #ffb34755;
}

.mascot-ok-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.mascot-footer-note {
    font-size: 11px;
    color: #8da1bc;
    margin-top: 14px;
}

.mascot-message {
    min-height: 18px;
    margin-top: 12px;

    font-size: 13px;
    color: #ffb0b0;
}

/* =========================================
   CONFIRMATION POPUP
========================================= */

.mascot-confirm {
    position: fixed;
    inset: 0;
    z-index: 20001;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 18px;

    background: #050b16e8;
    backdrop-filter: blur(5px);
}

.mascot-confirm-panel {
    width: min(100%, 410px);

    padding: 28px 23px;
    border: 1px solid #617fa6;
    border-radius: 22px;

    background: #1d304b;

    text-align: center;
    box-shadow: 0 20px 60px #0009;

    animation: mascotConfirmOpen .25s ease-out;
}

@keyframes mascotConfirmOpen {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mascot-confirm-icon {
    font-size: 45px;
    margin-bottom: 12px;
}

.mascot-confirm-panel h2 {
    margin-bottom: 12px;
    font-size: 21px;
    font-weight: 900;
}

#mascotConfirmText {
    font-size: 15px;
    color: #e4eefc;
    line-height: 1.6;
}

.mascot-confirm-warning {
    margin-top: 13px;

    font-size: 12px;
    line-height: 1.6;
    color: #ffc67e;
}

.mascot-confirm-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.mascot-confirm-buttons button {
    flex: 1;
    min-width: 0;

    padding: 13px 8px;

    border: none;
    border-radius: 11px;

    font-weight: 900;
    cursor: pointer;
}

.mascot-cancel-btn {
    background: #40536f;
    color: #fff;
}

.mascot-save-btn {
    background: #ffbe60;
    color: #152137;
}

.mascot-confirm-buttons button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* =========================================
   MOBILE RESPONSIVE
========================================= */

@media (max-width: 480px) {
    .mascot-screen {
        align-items: flex-start;
        padding: 20px 12px;
    }

    .mascot-header {
        margin-bottom: 20px;
    }

    .mascot-selection {
        gap: 10px;
        margin-bottom: 17px;
    }

    .mascot-card {
        padding: 13px 7px;
        border-radius: 16px;
    }

    .mascot-image-wrapper {
        height: 155px;
    }

    .mascot-card-type {
        font-size: 10px;
    }

    .mascot-details {
        padding: 15px 12px;
    }

    .mascot-details h2 {
        font-size: 19px;
    }

    .mascot-skill-box {
        padding: 13px 10px;
    }
}

/* =========================================
   REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {
    .mascot-card,
    .mascot-image-wrapper,
    .mascot-details,
    .mascot-confirm-panel {
        animation: none !important;
        transition: none !important;
    }
}
