/* =========================
   FOOTER
========================= */

.game-footer {
    margin: 25px 0 10px;

    font-size: 13px;
    color: #8b2867;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 950px) {

    .game {
        width: auto;
        max-width: calc(100% - 24px);
        margin: 18px auto;
    }

    .game-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pet-dashboard,
    .room,
    #items-panel {
        width: 100%;
    }

    #game-banner {
        max-width: 500px;
    }
}


@media (max-width: 650px) {

    .game {
        width: auto;
        max-width: none;
        margin: 18px 12px;
    }

    .banner-container {
        padding: 0;
    }

    #game-banner {
        max-width: 90%;
    }

    .room {
        min-height: 650px;
        border-radius: 30px;
        padding: 12px 12px 15px;
    }

    #pet-name {
        font-size: 21px;
    }

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

    .progress-wallet-row {
        flex-direction: column;
    }

    #xp-box,
    #coin-wallet {
        width: 100%;
        flex: none;
    }

    #inventory,
    #shop,
    #world-map {
        padding: 14px 10px;
        border-radius: 24px;
    }

    #inventory-items {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }

    #shop-items {
        gap: 8px;
    }

    .shop-item {
        padding: 12px 7px;
    }

    .main-tabs {
        gap: 6px;
    }

    .main-tab-button {
        font-size: 14px;
        padding: 12px 5px;
    }

    .map-area {
        height: 500px;
        min-height: 500px;
    }

    .map-location {
        width: 90px;
        height: 75px;
    }

    .map-location[data-location="home"] {
        left: 5%;
        top: 35%;
    }

    .map-location[data-location="town"] {
        left: 35%;
        top: 35%;
    }

    .map-location[data-location="shop"] {
        right: 5%;
        top: 35%;
    }

    .map-location[data-location="forest"] {
        left: 10%;
        bottom: 8%;
    }

    .map-location[data-location="beach"] {
        right: 10%;
        bottom: 8%;
    }

    .map-location[data-location="mountain"] {
        left: 35%;
        top: 8%;
    }

}


@media (max-width: 380px) {

    #inventory-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #shop-items {
        grid-template-columns: 1fr;
    }

    .room {
        min-height: 560px;
    }

    .stats {
        gap: 6px;
    }

    .stat-label {
        font-size: 10px;
    }

}
/* =========================
   COLLECTIONS
========================= */

#collections {
    background: #feffe8;
    border: 5px solid #ff40ac;
    border-radius: 30px;
    padding: 20px;
    min-height: 600px;
}

#collections h2 {
    color: #ff40ac;
    font-size: 24px;
    margin: 0 0 6px;
}

.collections-subtitle {
    margin: 0 0 18px;
    font-size: 14px;
    color: #555;
}

#collection-categories {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.collection-category {
    background: white;
    border: 3px solid #ff40ac;
    border-radius: 15px;
    padding: 12px 8px;
    margin: 0;

    color: #a72b76;
    font-size: 14px;
    font-weight: bold;

    cursor: pointer;
}

.collection-category:hover {
    background: #fff0fa;
}

.collection-category.selected {
    background: #ff40ac;
    color: white;
}

.collection-category-icon {
    display: block;
    font-size: 30px;
    margin-bottom: 5px;
}

.collection-category-name {
    display: block;
    margin-bottom: 4px;
}

.collection-category-count {
    display: block;
    font-size: 12px;
    font-weight: normal;
}

#collection-items {
    background: white;
    border: 2px dashed #ff40ac;
    border-radius: 18px;
    padding: 15px;
    min-height: 230px;
}

.collection-items-header {
    color: #ff40ac;
    font-size: 17px;
    font-weight: bold;
    margin-bottom: 12px;
}

.collection-empty {
    min-height: 170px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #a72b76;
    font-size: 14px;
    line-height: 1.5;
}

.collection-item {
    background: #fff5fb;
    border: 3px solid #ffc1e5;
    border-radius: 15px;

    padding: 15px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
}

.collection-item.has-count {
    position: relative;
}

.collection-item-count {
    position: absolute;
    top: 7px;
    right: 8px;
    min-width: 25px;
    padding: 3px 6px;
    border: 2px solid #ff40ac;
    border-radius: 12px;
    background: #feffe8;
    color: #a72b76;
    font-size: 12px;
    font-weight: bold;
}

.collection-item-icon {
    font-size: 50px;
    margin-bottom: 8px;
}

.collection-item-icon img {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto;
    object-fit: contain;
}

.collection-item-name {
    font-size: 16px;
    font-weight: bold;
    color: #a72b76;
}

.collection-item-description {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.collection-item-rarity {
    margin-top: 3px;
    color: #80503a;
    font-size: 12px;
    font-weight: 700;
}

.bug-collection-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.bug-collection-tab {
    flex: 1 1 180px;
    padding: 12px 8px;
    border: 3px solid #ff40ac;
    border-radius: 15px;
    background: white;
    color: #a72b76;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.bug-collection-tab:hover {
    background: #fff0fa;
}

.bug-collection-tab[aria-selected="true"] {
    background: #ff40ac;
    color: white;
}

.bug-collection-panel[hidden] {
    display: none;
}

.my-bug-tank {
    position: relative;
    min-height: 330px;
    overflow: hidden;
    border: 3px solid #ff40ac;
    border-radius: 16px;
    background: #ddff9a;
    isolation: isolate;
}

.my-bug-tank.my-fish-tank {
    background: #a9e4f7;
}

.my-bug-tank::after {
    content: "";
    position: absolute;
    z-index: 0;
    right: 0;
    bottom: 0;
    left: 0;
    height: 18%;
    background: #7b5128;
    border-top: 0px solid #7b4d34;
    pointer-events: none;
}

.my-bug-tank-bug {
    position: absolute;
    z-index: 1;
    transform: translate(-50%, -50%);
    font-size: clamp(25px, 4vw, 38px);
    line-height: 1;
    user-select: none;
    animation: bug-tank-swim var(--swim-duration, 8s) linear var(--swim-delay, 0s) infinite;
}

.my-fish-tank .my-bug-tank-bug {
    animation-name: fish-tank-swim;
    animation-direction: alternate;
}

.my-bug-tank-bug.is-responding {
    animation-play-state: paused;
}

.my-bug-tank-bug-icon {
    display: inline-block;
}

.my-bug-tank-bug-icon img {
    display: block;
    width: 1em;
    height: 1em;
    object-fit: contain;
}

.my-fish-tank [data-bug-id="silver-minnow"] .my-bug-tank-bug-icon img {
    width: 1.18em;
    height: 1.18em;
}

.my-fish-tank [data-bug-id="glassfish"] .my-bug-tank-bug-icon img {
    width: 1.4em;
    height: 1.4em;
}

.my-bug-tank-bug-icon.is-fleeing {
    animation: bug-tank-flee 300ms ease-in-out both;
}

.my-bug-tank-empty {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    color: #104d6a;
    font-weight: bold;
    text-align: center;
}

.bug-catalogue-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@keyframes bug-tank-swim {
    0% { left: var(--start-x); top: var(--start-y); }
    24% { left: var(--roam-x1); top: var(--roam-y1); }
    51% { left: var(--roam-x2); top: var(--roam-y2); }
    77% { left: var(--roam-x3); top: var(--roam-y3); }
    100% { left: var(--start-x); top: var(--start-y); }
}

@keyframes fish-tank-swim {
    0% { left: var(--start-x); top: var(--start-y); }
    24% { left: var(--roam-x1); top: var(--roam-y1); }
    51% { left: var(--roam-x2); top: var(--roam-y2); }
    77% { left: var(--roam-x3); top: var(--roam-y3); }
    100% { left: var(--end-x); top: var(--end-y); }
}

@keyframes bug-tank-flee {
    0% { transform: translate(var(--flee-x), var(--flee-y)); }
    16% { transform: translate(var(--flee-x), var(--flee-y)) translate(8px, -6px); }
    32% { transform: translate(var(--flee-x), var(--flee-y)) translate(-8px, 6px); }
    48% { transform: translate(var(--flee-x), var(--flee-y)) translate(7px, 5px); }
    64% { transform: translate(var(--flee-x), var(--flee-y)); }
    100% { transform: translate(var(--flee-x), var(--flee-y)); }
}

@media (prefers-reduced-motion: reduce) {
    .my-bug-tank-bug,
    .my-bug-tank-bug-icon.is-fleeing { animation: none; }
}


/* Make room for four main tabs */

.main-tabs {
    gap: 6px;
}

.main-tab-button {
    font-size: 14px;
    padding-left: 6px;
    padding-right: 6px;
}


/* Mobile collections */

@media (max-width: 650px) {

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

    #collection-categories {
        gap: 7px;
    }

    #collections {
        padding: 14px 10px;
        border-radius: 24px;
    }

    .main-tab-button {
        font-size: 12px;
        padding: 11px 4px;
    }

}

@media (max-width: 420px) {

    #collection-categories {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

}
