/* =============================================
   AVATARMAKER.CSS — Avatar Maker styles
   Sofia's Game Arcade
   ============================================= */

/* ---- Layout ---- */
.game-container {
    max-width: 460px;
    margin: 0 auto;
    padding: 52px 16px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.screen.active {
    display: flex;
    animation: screenIn 0.3s ease;
}

@keyframes screenIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- WELCOME SCREEN ---- */
.welcome-title {
    font-size: 2.4rem;
    font-weight: 800;
    text-align: center;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 0.5rem;
}

.welcome-credit {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}

.welcome-preview {
    width: 160px;
    height: 240px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    animation: gentlePulse 3s ease-in-out infinite;
}

.welcome-preview svg {
    width: 100%;
    height: 100%;
    display: block;
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.03); }
}

/* ---- CREATOR SCREEN ---- */
.creator-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.creator-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
}

.avatar-preview {
    width: 180px;
    height: 270px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
    transition: box-shadow var(--transition-med);
}

.avatar-preview svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Tabs */
.tabs-row {
    display: flex;
    gap: 6px;
    width: 100%;
    overflow-x: auto;
    padding: 12px 2px 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs-row::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex-shrink: 0;
    padding: 6px 13px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.8rem;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tab-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    border-color: var(--accent-blue);
    background: rgba(96, 165, 250, 0.15);
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.25);
}

/* Options panel */
.options-panel {
    width: 100%;
    max-height: 240px;
    overflow-y: auto;
    padding: 2px 0 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.options-panel::-webkit-scrollbar {
    width: 4px;
}

.options-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.options-section-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 4px 4px;
    font-weight: 600;
}

.options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px;
}

/* Colour swatches */
.color-swatch {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
    outline: none;
}

.color-swatch:hover {
    transform: scale(1.12);
}

.color-swatch.active {
    border-color: var(--accent-green);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
    transform: scale(1.08);
}

/* Style option buttons */
.style-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-subtle);
    background: var(--bg-card);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 64px;
    min-height: 50px;
    outline: none;
}

.style-btn:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.style-btn.active {
    border-color: var(--accent-green);
    background: rgba(74, 222, 128, 0.08);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.2);
}

.style-btn svg {
    display: block;
}

.style-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 3px;
    white-space: nowrap;
}

/* ---- SHOWCASE SCREEN ---- */
.showcase-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.showcase-preview {
    width: 240px;
    height: 360px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: showcaseIn 0.5s ease;
}

.showcase-preview svg {
    width: 100%;
    height: 100%;
    display: block;
}

@keyframes showcaseIn {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.showcase-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ---- BUTTONS ---- */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-start {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    font-size: 1.15rem;
    padding: 14px 36px;
}

.btn-done {
    background: var(--accent-green);
    color: #111;
    padding: 8px 20px;
    font-size: 0.85rem;
}

.btn-save {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
}

.btn-edit {
    background: var(--accent-purple);
}

.btn-reset {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid var(--border-subtle);
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 380px) {
    .welcome-title {
        font-size: 2rem;
    }

    .avatar-preview {
        width: 150px;
        height: 225px;
    }

    .showcase-preview {
        width: 200px;
        height: 300px;
    }

    .options-panel {
        max-height: 200px;
    }

    .tab-btn {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    .style-btn {
        min-width: 56px;
        min-height: 46px;
    }

    .color-swatch {
        width: 34px;
        height: 34px;
    }
}

@media (min-height: 800px) {
    .avatar-preview {
        width: 200px;
        height: 300px;
    }

    .options-panel {
        max-height: 280px;
    }
}
