* {
    box-sizing: border-box;
}


/* =========================
   PAGE
========================= */

body {
    margin: 0;
    padding: 20px;

    background-image: url("fondo2.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;

    font-family: Arial, sans-serif;
}


/* =========================
   TITLE
========================= */

h1 {
    text-align: center;

    font-size: 40px;

    font-family: Georgia, serif;

    letter-spacing: 3px;

    color: #4a3f3b;

    margin-top: 8px;
    margin-bottom: 1px;
}


/* TITLE IMAGE */

h1 img {
    width: 650px;
    max-width: 90%;
    height: auto;
    display: block;
    margin: 0 auto;
}


/* =========================
   GAME
========================= */

#game {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
}


/* =========================
   CHARACTER
========================= */

#character {
    position: relative;

    width: min(680px, 62vw);

    aspect-ratio: 4 / 5;
}


/* CHARACTER FRAME */

#character-frame {
    position: relative;

    width: 100%;
    height: 100%;

    background-image: url("fondo4.jpg");

    background-size: cover;

    background-position: center;

    background-repeat: no-repeat;

    border-radius: 25px;

    overflow: hidden;

    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.10),
        inset 0 0 0 8px #f8f1e8,
        inset 0 0 0 10px #e6d5cc;
}


/* =========================
   DECORATIVE CORNER ORNAMENTS
========================= */

.corner {
    position: absolute;

    width: 18px;
    height: 18px;

    border-top: 3px solid #c79a9a;
    border-left: 3px solid #c79a9a;

    z-index: 10;

    pointer-events: none;
}

.corner.top-left {
    top: 18px;
    left: 18px;
}

.corner.top-right {
    top: 18px;
    right: 18px;

    transform: rotate(90deg);
}

.corner.bottom-left {
    bottom: 18px;
    left: 18px;

    transform: rotate(-90deg);
}

.corner.bottom-right {
    bottom: 18px;
    right: 18px;

    transform: rotate(180deg);
}


/* =========================
   FLOATING DECORATIONS
========================= */

.floating-decoration {
    position: fixed;

    pointer-events: none;

    z-index: 0;
}


/* HEART */

.heart {
    width: 18px;
    height: 18px;

    background: #c79a9a;

    transform: rotate(-45deg);

    opacity: 0.65;
}

.heart::before,
.heart::after {
    content: "";

    position: absolute;

    width: 18px;
    height: 18px;

    background: #c79a9a;

    border-radius: 50%;
}

.heart::before {
    top: -9px;
    left: 0;
}

.heart::after {
    top: 0;
    left: 9px;
}


/* STAR */

.star {
    width: 22px;
    height: 22px;

    background: #c79a9a;

    clip-path: polygon(
        50% 0%,
        61% 38%,
        100% 50%,
        61% 62%,
        50% 100%,
        39% 62%,
        0% 50%,
        39% 38%
    );

    opacity: 0.65;
}

.star.small {
    width: 16px;
    height: 16px;
}


/* FLOATING POSITIONS */

.float-1 {
    top: 18%;
    left: 4%;
}

.float-2 {
    top: 35%;
    right: 4%;
}

.float-3 {
    bottom: 15%;
    left: 7%;
}

.float-4 {
    bottom: 10%;
    right: 8%;
}


/* =========================
   CHARACTER LAYERS
========================= */

#character-frame img {
    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    object-fit: contain;
}


/* BACK → FRONT */

#base {
    z-index: 1;
}

#shoes {
    z-index: 2;
}

#pants {
    z-index: 3;
}

#shirt {
    z-index: 4;
}

#jacket {
    z-index: 5;
}


/* ACCESSORIES */

#bag {
    z-index: 6;
}

#belt {
    z-index: 7;
}

#scarf {
    z-index: 8;
}

#earrings {
    z-index: 9;
}

#earmuffs {
    z-index: 10;
}


/* =========================
   WARDROBE
========================= */

#controls {
    width: min(800px, 90vw);

    background-image: url("fondo7.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    padding: 20px;
    border-radius: 20px;
    border: 1px solid #eaded7;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);

    display: flex;
    flex-direction: column;
}


/* WARDROBE TITLE */

.controls-title {
    text-align: center;

    font-family: Georgia, serif;

    font-weight: bold;

    letter-spacing: 4px;

    font-size: 18px;

    color: #5a4b46;

    margin-bottom: 16px;

    padding: 10px 20px;

    border: 1px solid #d9c8c0;

    border-radius: 14px;

    background: rgba(255, 255, 255, 0.55);

    box-shadow:
        0 3px 7px rgba(0, 0, 0, 0.05);
}


/* =========================
   CATEGORY TABS
========================= */

.tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}
.tab {
    flex: 1;
    min-width: 120px;
}
.tab {
    border: 1px solid #d9c8c0;

    background: rgba(255, 255, 255, 0.65);

    color: #6b5b55;

    border-radius: 16px;

    padding: 13px 22px;

    font-size: 12px;

    font-weight: bold;

    letter-spacing: 1.5px;

    cursor: pointer;

    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.04);

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.tab:hover {
    transform: translateY(-2px);

    background: #fff;

    color: #4a3f3b;
}

.tab.active {
    background: #c79a9a;

    color: white;

    border-color: #c79a9a;

    box-shadow:
        0 3px 8px rgba(199, 154, 154, 0.25);

    transform: translateY(-2px);
}


/* =========================
   CATEGORY
========================= */

.category {
    display: none;

    padding: 18px;

    background: rgba(255, 250, 247, 0.82);

    border: 1px solid #e1d1ca;

    border-radius: 18px;

    min-height: 310px;

    box-shadow:
        inset 0 2px 8px rgba(120, 90, 80, 0.05);
}

.category.active-category {
    display: block;
}

.category.active-category {
    display: block;
}


/* CATEGORY LABEL */

.category-label {
    text-align: center;

    font-family: Georgia, serif;

    font-size: 13px;

    letter-spacing: 3px;

    color: #5a4b46;

    margin-bottom: 16px;

    padding-bottom: 10px;

    border-bottom: 1px dashed #d9c8c0;
}


/* =========================
   CLOTHING GRID
========================= */

.item-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}


/* CLOTHING BUTTON */

.item-list button {
    width: 105px;
    height: 105px;

    padding: 7px;

    border: 1px solid #ddcbc3;

    border-radius: 18px;

    background: rgba(255, 255, 255, 0.82);

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;

    box-shadow:
        0 3px 7px rgba(0, 0, 0, 0.08);

    transition:
        transform 0.15s ease,
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}


/* IMAGE */

.item-list button img {
    width: 100%;

    height: 100%;

    object-fit: contain;

    display: block;
}


/* HOVER */

.item-list button:hover {
    transform: translateY(-4px) scale(1.04);

    background: white;

    border-color: #cdaea2;

    box-shadow:
        0 5px 12px rgba(0, 0, 0, 0.12);
}


/* CLICK */

.item-list button:active {
    transform: scale(0.93);
}


/* SELECTED */

.item-list button.selected {
    border: 2px solid #c79a9a;

    background: #fff;

    box-shadow:
        0 0 0 3px rgba(199, 154, 154, 0.18),
        0 5px 12px rgba(0, 0, 0, 0.10);
}


/* NONE */

.none-symbol {
    font-family: Georgia, serif;

    font-size: 27px;

    line-height: 20px;

    color: #8f7770;
}

.item-list button small {
    display: block;

    font-size: 8px;

    letter-spacing: 1px;

    color: #6b5b55;

    margin-top: 2px;
}


/* =========================
   ACTION BUTTONS
========================= */

.wardrobe-actions {
    display: flex;

    gap: 8px;

    margin-top: 16px;
}


/* RESET */

#reset-button {
    flex: 1;

    padding: 12px 8px;

    border: none;

    border-radius: 12px;

    background: #4a3f3b;

    color: white;

    font-size: 15px;

    font-weight: bold;

    letter-spacing: 1px;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease;
}

#reset-button:hover {
    transform: translateY(-2px);

    opacity: 0.85;
}


/* RANDOM */

#random-button {
    flex: 1;

    padding: 12px 8px;

    border: 1px solid #d9b9ad;

    border-radius: 12px;

    background: #f0d9d0;

    color: #4a3f3b;

    font-size: 15px;

    font-weight: bold;

    letter-spacing: 1px;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        background 0.15s ease;
}

#random-button:hover {
    transform: translateY(-2px);

    background: #e8c8bd;
}


/* =========================
   RANDOM OUTFIT ANIMATION
========================= */

#character.randomizing {
    animation: outfitShuffle 0.45s ease;
}

@keyframes outfitShuffle {

    0% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.03) rotate(-2deg);
    }

    50% {
        transform: scale(0.98) rotate(2deg);
    }

    75% {
        transform: scale(1.02) rotate(-1deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}


/* =========================
   MOBILE
========================= */

@media (max-width: 900px) {

    #game {
        flex-direction: column;

        align-items: center;

        gap: 25px;
    }

    #character {
        width: 90vw;
    }

    #controls {
        width: 550px;

        max-width: 500px;
    }
}

/* =========================
   POPPY'S GUESTBOOK
========================= */

#poppy-guestbook {
    width: min(650px, 90%);
    margin: 50px auto 30px;
    padding: 30px;
    
    background: #fff8f2;
    border: 3px solid #e8b8c8;
    border-radius: 20px;
    
    text-align: center;
    
    box-shadow: 0 8px 20px rgba(120, 80, 90, 0.15);
}

.guestbook-title {
    font-size: 28px;
    font-weight: bold;
    color: #5b4a50;
    margin-bottom: 12px;
}

#poppy-guestbook p {
    font-size: 16px;
    line-height: 1.6;
    color: #5b4a50;
    margin-bottom: 22px;
}

.guestbook-button {
    display: inline-block;
    
    padding: 12px 24px;
    
    background: #f4c6d6;
    color: #5b4a50;
    
    border: 2px solid #d99caf;
    border-radius: 12px;
    
    text-decoration: none;
    font-weight: bold;
    
    transition: transform 0.2s ease;
}

.guestbook-button:hover {
    transform: translateY(-3px);
}