.avatar-page .blog-wrapper {
    max-width: none;
    width: 95%;
    margin: 0 auto;
    border-radius: 70px 70px 40px 40px;
}

.avatar-page .content-grid {
    display: block;
    width: 100%;
    padding: 30px 20px;
}
.avatar-page .sidebar {
    display: none;
}

.avatar-page .main-posts {
    width: 100%;
    margin: 0;
}

.avatar-container {
    background: #f5e6e6;
    border-radius: 30px;
    padding: 25px;
    margin-bottom: 20px;
    border: 4px solid #C97C7C;
}

.avatar-container h1 {
    font-family: 'Mali', cursive;
    color: #5a1a1a;
    text-align: center;
    margin-bottom: 20px;
}

.button-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}
.button-bar button {
    background: #B86B6B;
    color: white;
    border: none;
    font-family: 'Mali', cursive;
    font-size: 1rem;
    padding: 8px 20px;
    border-radius: 40px;
    cursor: pointer;
    transition: 0.2s;
}
.button-bar button:hover {
    background: #C97C7C;
    transform: scale(0.98);
}
#done-button {
    background: #8B3A3A;
    font-weight: bold;
}

.avatar-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
}
.controls-left, .controls-right {
    flex: 1;
    min-width: 230px;
    max-width: 300px;
}
#avatar-canvas {
    position: relative;
    width: 620px;
    height: 775px;
    background: #000;
    border-radius: 30px;
    overflow: hidden;
    border: 5px solid #3a0505;
    flex-shrink: 0;
}

.flash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease;
    z-index: 100;
}
.flash-overlay.show {
    opacity: 1;
}

.popup-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffd6d6;
    border: 6px solid #b33e4b;
    border-radius: 40px;
    padding: 30px 50px;
    font-family: 'Mali', cursive;
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    color: #5a1a1a;
    z-index: 1000;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    display: none;
    white-space: nowrap;
}
.popup-message.show {
    display: block;
    animation: fadeOut 2s forwards;
}
@keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

@media (max-width: 1280px) {
    .avatar-layout {
        flex-direction: column;
        align-items: center;
    }
    .controls-left, .controls-right {
        max-width: none;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
    .control-group {
        width: calc(33% - 12px);
        min-width: 170px;
    }
}
@media (max-width: 800px) {
    .control-group {
        width: calc(50% - 12px);
    }
    #avatar-canvas {
        width: 90%;
        height: auto;
        aspect-ratio: 4/5;
    }
}
@media (max-width: 550px) {
    .control-group {
        width: 100%;
    }
}

.avatar-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #f5e6e6;
    padding: 8px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.control-group label {
    font-family: 'Mali', cursive;
    font-size: 0.9rem;
    color: #5a1a1a;
    font-weight: bold;
}
select, .control-group button {
    font-family: 'Nunito', sans-serif;
    padding: 6px 12px;
    border-radius: 30px;
    border: 2px solid #C97C7C;
    background: #fff0f0;
    color: #3a1a1a;
    cursor: pointer;
    transition: all 0.2s ease;
}
select:hover {
    background: #ffd0d0;
}

.outerwear-group .outerwear-row {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}
.outerwear-group .outerwear-row select {
    flex: 1;
}